1 /*
2  * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3  * Distributed under the MIT License
4  * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5  */
6 
7 #ifndef MYGUI_TOOL_TIP_MANAGER_H_
8 #define MYGUI_TOOL_TIP_MANAGER_H_
9 
10 #include "MyGUI_Prerequest.h"
11 #include "MyGUI_IUnlinkWidget.h"
12 #include "MyGUI_Singleton.h"
13 
14 namespace MyGUI
15 {
16 
17 	class MYGUI_EXPORT ToolTipManager :
18 		public Singleton<ToolTipManager>,
19 		public IUnlinkWidget
20 	{
21 	public:
22 		ToolTipManager();
23 
24 		void initialise();
25 		void shutdown();
26 
27 		void setDelayVisible(float _value);
28 		float getDelayVisible() const;
29 
30 		/*internal:*/
31 		void _unlinkWidget(Widget* _widget);
32 
33 	private:
34 		void notifyEventFrameStart(float _time);
35 
36 		void hideToolTip(Widget* _widget);
37 		void showToolTip(Widget* _widget, size_t _index, const IntPoint& _point);
38 		void moveToolTip(Widget* _widget, size_t _index, const IntPoint& _point);
39 
40 		bool isNeedToolTip(Widget* _widget);
41 		size_t getToolTipIndex(Widget* _widget) const;
42 
43 	private:
44 		float mDelayVisible;
45 		Widget* mOldFocusWidget;
46 		IntPoint mOldMousePoint;
47 		bool mToolTipVisible;
48 		float mCurrentTime;
49 		size_t mOldIndex;
50 		bool mNeedToolTip;
51 
52 		bool mIsInitialise;
53 	};
54 
55 } // namespace MyGUI
56 
57 #endif // MYGUI_TOOL_TIP_MANAGER_H_
58