2009-08-03 18:47:41 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2009, Haiku, Inc. All Rights Reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _TOOL_TIP_MANAGER_H
|
|
|
|
#define _TOOL_TIP_MANAGER_H
|
|
|
|
|
|
|
|
|
2009-08-11 11:47:49 +04:00
|
|
|
#include <Locker.h>
|
2009-08-03 18:47:41 +04:00
|
|
|
#include <Messenger.h>
|
|
|
|
#include <Point.h>
|
|
|
|
|
|
|
|
|
|
|
|
class BToolTip;
|
|
|
|
|
|
|
|
|
|
|
|
class BToolTipManager {
|
|
|
|
public:
|
|
|
|
static BToolTipManager* Manager();
|
|
|
|
|
2012-05-03 07:51:49 +04:00
|
|
|
void ShowTip(BToolTip* tip, BPoint where,
|
2012-04-29 00:09:14 +04:00
|
|
|
void* owner);
|
2009-08-03 18:47:41 +04:00
|
|
|
void HideTip();
|
|
|
|
|
|
|
|
void SetShowDelay(bigtime_t time);
|
|
|
|
bigtime_t ShowDelay() const;
|
|
|
|
void SetHideDelay(bigtime_t time);
|
|
|
|
bigtime_t HideDelay() const;
|
|
|
|
|
2009-11-30 14:06:51 +03:00
|
|
|
bool Lock() { return fLock.Lock(); }
|
|
|
|
void Unlock() { fLock.Unlock(); }
|
2009-08-11 11:47:49 +04:00
|
|
|
|
2009-08-03 18:47:41 +04:00
|
|
|
private:
|
|
|
|
BToolTipManager();
|
|
|
|
virtual ~BToolTipManager();
|
|
|
|
|
2009-11-30 14:06:51 +03:00
|
|
|
static void _InitSingleton();
|
|
|
|
|
|
|
|
private:
|
|
|
|
BLocker fLock;
|
2009-08-03 18:47:41 +04:00
|
|
|
BMessenger fWindow;
|
|
|
|
|
|
|
|
bigtime_t fShowDelay;
|
|
|
|
bigtime_t fHideDelay;
|
|
|
|
|
|
|
|
static BToolTipManager* sDefaultInstance;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _TOOL_TIP_MANAGER_H
|