00001 00032 #ifndef LL_LLHOVERVIEW_H 00033 #define LL_LLHOVERVIEW_H 00034 00035 // Library includes 00036 #include "lluuid.h" 00037 #include "llview.h" 00038 #include "llframetimer.h" 00039 #include "llstring.h" 00040 #include "linked_lists.h" 00041 #include "llcoord.h" 00042 #include "v3dmath.h" 00043 00044 #include "lldarray.h" 00045 #include "llhudconnector.h" 00046 00047 class LLTool; 00048 00049 // 00050 // Classes 00051 // 00052 class LLHoverView : public LLView 00053 { 00054 public: 00055 LLHoverView(const std::string& name, const LLRect& rect); 00056 ~LLHoverView(); 00057 00058 virtual EWidgetType getWidgetType() const; 00059 virtual LLString getWidgetTag() const; 00060 00061 /*virtual*/ void draw(); 00062 00063 void updateHover(LLTool* current_tool); 00064 void cancelHover(); 00065 00066 // The last hovered object is retained even after the hover is 00067 // cancelled, so allow it to be specifically reset. JC 00068 void resetLastHoverObject(); 00069 00070 void setHoverActive(const BOOL active); 00071 00072 // We don't do hover picks while the user is typing. In fact, we stop 00073 // until the mouse is moved. 00074 void setTyping(BOOL b); 00075 00076 BOOL isHovering() const 00077 { return isHoveringLand() || isHoveringObject(); } 00078 00079 BOOL isHoveringObject() const; 00080 BOOL isHoveringLand() const; 00081 00082 LLViewerObject* getLastHoverObject() const; 00083 00084 static void pickCallback(S32 x, S32 y, MASK mask); 00085 00086 protected: 00087 void updateText(); 00088 00089 protected: 00090 LLFrameTimer mStartHoverTimer; 00091 BOOL mStartHoverPickTimer; 00092 BOOL mDoneHoverPick; 00093 00094 BOOL mHoverActive; 00095 LLCoordGL mHoverPos; 00096 00097 // How long has the hover popup been visible? 00098 LLFrameTimer mHoverTimer; 00099 00100 LLLinkedList<LLString> mText; 00101 00102 BOOL mUseHover; 00103 00104 // If not null and not dead, we're over an object. 00105 LLPointer<LLViewerObject> mLastHoverObject; 00106 00107 // If not LLVector3d::zero, we're over land. 00108 LLVector3d mHoverLandGlobal; 00109 LLVector3d mHoverOffset; 00110 00111 BOOL mTyping; 00112 00113 public: 00114 // Show in-world hover tips. Allow to turn off for movie making, game playing. 00115 // Public so menu can directly toggle. 00116 static BOOL sShowHoverTips; 00117 }; 00118 00119 00120 // 00121 // Globals 00122 // 00123 00124 extern LLHoverView *gHoverView; 00125 00126 00127 #endif