xref: /haiku/headers/private/interface/ToolTipManager.h (revision f2b4344867e97c3f4e742a1b4a15e6879644601a)
1 /*
2  * Copyright 2009, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _TOOL_TIP_MANAGER_H
6 #define _TOOL_TIP_MANAGER_H
7 
8 
9 #include <Locker.h>
10 #include <Messenger.h>
11 #include <Point.h>
12 
13 
14 class BToolTip;
15 
16 
17 class BToolTipManager {
18 public:
19 	static	BToolTipManager*	Manager();
20 
21 			void				ShowTip(BToolTip* tip, BPoint point);
22 			void				HideTip();
23 
24 			void				SetShowDelay(bigtime_t time);
25 			bigtime_t			ShowDelay() const;
26 			void				SetHideDelay(bigtime_t time);
27 			bigtime_t			HideDelay() const;
28 
29 			bool				Lock()		{ return fLock.Lock(); }
30 			void				Unlock()	{ fLock.Unlock(); }
31 
32 private:
33 								BToolTipManager();
34 	virtual						~BToolTipManager();
35 
36 	static	void				_InitSingleton();
37 
38 private:
39 			BLocker				fLock;
40 			BMessenger			fWindow;
41 
42 			bigtime_t			fShowDelay;
43 			bigtime_t			fHideDelay;
44 
45 	static	BToolTipManager*	sDefaultInstance;
46 };
47 
48 
49 #endif	// _TOOL_TIP_MANAGER_H
50