summaryrefslogtreecommitdiff
path: root/indra/newview/lltoast.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltoast.h')
-rw-r--r--indra/newview/lltoast.h54
1 files changed, 48 insertions, 6 deletions
diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h
index 1826c13ebc..64855020a9 100644
--- a/indra/newview/lltoast.h
+++ b/indra/newview/lltoast.h
@@ -37,9 +37,10 @@
#include "llpanel.h"
#include "llmodaldialog.h"
#include "lltimer.h"
-#include "llnotifications.h"
+#include "llnotificationptr.h"
#include "llviewercontrol.h"
+#include "lltexteditor.h"
#define MOUSE_LEAVE false
#define MOUSE_ENTER true
@@ -63,7 +64,8 @@ public:
Optional<LLUUID> notif_id, //notification ID
session_id; //im session ID
Optional<LLNotificationPtr> notification;
- Optional<F32> lifetime_secs;
+ 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,
@@ -84,8 +86,16 @@ public:
// Toast handlers
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
- virtual void onMouseEnter(S32 x, S32 y, MASK mask);
- virtual void onMouseLeave(S32 x, S32 y, MASK mask);
+
+ //Fading
+
+ /** Stop fading timer */
+ virtual void stopFading();
+
+ /** Start fading timer */
+ virtual void startFading();
+
+ bool isHovered();
// Operating with toasts
// insert a panel to a toast
@@ -107,10 +117,22 @@ public:
virtual void draw();
//
virtual void setVisible(BOOL show);
+
+ /*virtual*/ void setBackgroundOpaque(BOOL b);
//
virtual void hide();
+ /*virtual*/ void onFocusLost();
+
+ /*virtual*/ void onFocusReceived();
+ /**
+ * Returns padding between floater top and wrapper_panel top.
+ * This padding should be taken into account when positioning or reshaping toasts
+ */
+ S32 getTopPad();
+
+ S32 getRightPad();
// get/set Toast's flags or states
// get information whether the notification corresponding to the toast is valid or not
@@ -125,7 +147,10 @@ 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; }
+ const LLNotificationPtr& getNotification() { return mNotification;}
// Registers signals/callbacks for events
toast_signal_t mOnFadeSignal;
@@ -140,9 +165,17 @@ public:
toast_hover_check_signal_t mOnToastHoverSignal;
boost::signals2::connection setOnToastHoverCallback(toast_hover_check_callback_t cb) { return mOnToastHoverSignal.connect(cb); }
+ boost::signals2::connection setMouseEnterCallback( const commit_signal_t::slot_type& cb ) { return mToastMouseEnterSignal.connect(cb); };
+ boost::signals2::connection setMouseLeaveCallback( const commit_signal_t::slot_type& cb ) { return mToastMouseLeaveSignal.connect(cb); };
private:
+ void onToastMouseEnter();
+
+ void onToastMouseLeave();
+
+ void handleTipToastClick(S32 x, S32 y, MASK mask);
+
// check timer
bool lifetimeHasExpired();
// on timer finished function
@@ -152,18 +185,27 @@ private:
LLUUID mSessionID;
LLNotificationPtr mNotification;
+ LLPanel* mWrapperPanel;
+
// timer counts a lifetime of a toast
LLTimer mTimer;
F32 mToastLifetime; // in seconds
+ F32 mToastFadingTime; // in seconds
- LLPanel* mPanel;
- LLButton* mHideBtn;
+ LLPanel* mPanel;
+ LLButton* mHideBtn;
+ LLTextEditor* mTextEditor;
LLColor4 mBgColor;
bool mCanFade;
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)
+ bool mIsTip;
+
+ commit_signal_t mToastMouseEnterSignal;
+ commit_signal_t mToastMouseLeaveSignal;
};
}