diff options
Diffstat (limited to 'indra/newview/lleventnotifier.h')
| -rw-r--r-- | indra/newview/lleventnotifier.h | 52 |
1 files changed, 24 insertions, 28 deletions
diff --git a/indra/newview/lleventnotifier.h b/indra/newview/lleventnotifier.h index f013f6d02e..2a9295129d 100644 --- a/indra/newview/lleventnotifier.h +++ b/indra/newview/lleventnotifier.h @@ -27,31 +27,30 @@ #ifndef LL_LLEVENTNOTIFIER_H #define LL_LLEVENTNOTIFIER_H -#include <utility> #include "llframetimer.h" #include "v3dmath.h" class LLEventNotification; class LLMessageSystem; -typedef struct event_st{ - U32 eventId = 0; - F64 eventEpoch = 0.0; - std::string eventDateStr; - std::string eventName; - std::string creator; - std::string category; - std::string desc; - U32 duration = 0; - U32 cover = 0; - U32 amount = 0; - std::string simName; - LLVector3d globalPos; - U32 flags = 0; - event_st(U32 id, F64 epoch, std::string date_str, std::string name) - : eventId(id), eventEpoch(epoch), eventDateStr(std::move(date_str)), eventName(std::move(name)){} - event_st() = default; -} LLEventStruct; +struct LLEventInfo +{ + void unpack(LLMessageSystem* msg); + + std::string mName; + U32 mID; + std::string mDesc; + std::string mCategoryStr; + U32 mDuration; + std::string mTimeStr; + LLUUID mRunByID; + std::string mSimName; + LLVector3d mPosGlobal; + F64 mUnixTime; // seconds from 1970 + BOOL mHasCover; + U32 mCover; + U32 mEventFlags; +}; class LLEventNotifier { @@ -60,8 +59,8 @@ public: virtual ~LLEventNotifier(); void update(); // Notify the user of the event if it's coming up - bool add(const LLEventStruct& event); bool add(U32 eventId, F64 eventEpoch, const std::string& eventDateStr, const std::string &eventName); + bool add(LLEventInfo event); void add(U32 eventId); @@ -76,23 +75,20 @@ public: static void processEventInfoReply(LLMessageSystem *msg, void **); - typedef boost::signals2::signal<bool(LLEventStruct event)> new_event_signal_t; - new_event_signal_t mNewEventSignal; - boost::signals2::connection setNewEventCallback(const new_event_signal_t::slot_type& cb) - { - return mNewEventSignal.connect(cb); - }; + typedef boost::signals2::signal<bool(LLEventInfo event)> info_received_signal_t; + boost::signals2::connection setEventInfoCallback(const info_received_signal_t::slot_type& cb) { return mEventInfoSignal.connect(cb); }; protected: en_map mEventNotifications; - LLFrameTimer mNotificationTimer; + LLFrameTimer mNotificationTimer; + info_received_signal_t mEventInfoSignal; }; class LLEventNotification { public: - LLEventNotification(U32 eventId, F64 eventEpoch, std::string eventDateStr, std::string eventName); + LLEventNotification(U32 eventId, F64 eventEpoch, const std::string& eventDateStr, const std::string &eventName); U32 getEventID() const { return mEventID; } |
