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 14class BToolTip; 15 16 17class BToolTipManager { 18public: 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 30 bool Lock() { return fLock.Lock(); } 31 void Unlock() { fLock.Unlock(); } 32 33private: 34 BToolTipManager(); 35 virtual ~BToolTipManager(); 36 37 static void _InitSingleton(); 38 39private: 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