diff options
Diffstat (limited to 'indra/newview/lltoast.h')
-rw-r--r-- | indra/newview/lltoast.h | 57 |
1 files changed, 27 insertions, 30 deletions
diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index 29c231a01d..b670f47045 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -57,37 +57,29 @@ public: typedef boost::function<void (LLToast* toast)> toast_callback_t; typedef boost::signals2::signal<void (LLToast* toast)> toast_signal_t; - struct Params + struct Params : public LLInitParam::Block<Params> { - LLPanel* panel; - LLUUID notif_id; //notification ID - LLUUID session_id; //im session ID - LLNotificationPtr notification; - F32 timer_period; - toast_callback_t on_delete_toast; - toast_callback_t on_mouse_enter; - bool can_fade; - bool can_be_stored; - bool enable_hide_btn; - bool is_modal; - bool is_tip; - bool force_show; - bool force_store; - - Params() : can_fade(true), - can_be_stored(true), - is_modal(false), - is_tip(false), - enable_hide_btn(true), - force_show(false), - force_store(false), - panel(NULL), - timer_period(gSavedSettings.getS32("NotificationToastTime")) - - {}; + Mandatory<LLPanel*> panel; + Optional<LLUUID> notif_id, //notification ID + session_id; //im session ID + Optional<LLNotificationPtr> notification; + Optional<F32> lifetime_secs, + fading_time_secs; // Number of seconds while a toast is fading + Optional<toast_callback_t> on_delete_toast, + on_mouse_enter; + Optional<bool> can_fade, + can_be_stored, + enable_hide_btn, + is_modal, + is_tip, + force_show, + force_store; + + + Params(); }; - LLToast(LLToast::Params p); + LLToast(const LLToast::Params& p); virtual ~LLToast(); BOOL postBuild(); @@ -134,6 +126,8 @@ public: void setCanBeStored(bool can_be_stored) { mCanBeStored = can_be_stored; } // bool getCanBeStored() { return mCanBeStored; } + // set whether this toast considered as hidden or not + void setIsHidden( bool is_toast_hidden ) { mIsHidden = is_toast_hidden; } // Registers signals/callbacks for events @@ -153,7 +147,7 @@ public: private: // check timer - bool timerHasExpired(); + bool lifetimeHasExpired(); // on timer finished function void tick(); @@ -161,8 +155,10 @@ private: LLUUID mSessionID; LLNotificationPtr mNotification; + // timer counts a lifetime of a toast LLTimer mTimer; - F32 mTimerValue; + F32 mToastLifetime; // in seconds + F32 mToastFadingTime; // in seconds LLPanel* mPanel; LLButton* mHideBtn; @@ -172,6 +168,7 @@ private: bool mCanBeStored; bool mHideBtnEnabled; bool mHideBtnPressed; + bool mIsHidden; // this flag is TRUE when a toast has faded or was hidden with (x) button (EXT-1849) }; } |