xref: /haiku/headers/private/interface/ToolTipManager.h (revision 25a7b01d15612846f332751841da3579db313082)
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 where,
22 									void* owner);
23 			void				HideTip();
24 
25 			void				SetShowDelay(bigtime_t time);
26 			bigtime_t			ShowDelay() const;
27 			void				SetHideDelay(bigtime_t time);
28 			bigtime_t			HideDelay() const;
29 
Lock()30 			bool				Lock()		{ return fLock.Lock(); }
Unlock()31 			void				Unlock()	{ fLock.Unlock(); }
32 
33 private:
34 								BToolTipManager();
35 	virtual						~BToolTipManager();
36 
37 	static	void				_InitSingleton();
38 
39 private:
40 			BLocker				fLock;
41 			BMessenger			fWindow;
42 
43 			bigtime_t			fShowDelay;
44 			bigtime_t			fHideDelay;
45 
46 	static	BToolTipManager*	sDefaultInstance;
47 };
48 
49 
50 #endif	// _TOOL_TIP_MANAGER_H
51