Emergency 20 Dokumentation  4.2.0
ToolTipManager.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Header guard ]
6 //[-------------------------------------------------------]
7 #pragma once
8 
9 
10 //[-------------------------------------------------------]
11 //[ Includes ]
12 //[-------------------------------------------------------]
13 #include <boost/noncopyable.hpp>
14 
15 
16 //[-------------------------------------------------------]
17 //[ Forward declarations ]
18 //[-------------------------------------------------------]
19 namespace em5
20 {
21  class ToolTipWindow;
22 }
23 namespace qsf
24 {
25  class GuiContext;
26 }
27 namespace Rocket
28 {
29  namespace Core
30  {
31  class EventListener;
32  class Event;
33  class Element;
34  class ElementDocument;
35  }
36 }
37 
38 
39 //[-------------------------------------------------------]
40 //[ Namespace ]
41 //[-------------------------------------------------------]
42 namespace em5
43 {
44 
45 
46  //[-------------------------------------------------------]
47  //[ Classes ]
48  //[-------------------------------------------------------]
53  class ToolTipManager : public boost::noncopyable
54  {
55 
56 
57  //[-------------------------------------------------------]
58  //[ Public methods ]
59  //[-------------------------------------------------------]
60  public:
61  explicit ToolTipManager(qsf::GuiContext& guiContext);
62  virtual ~ToolTipManager();
64 
65  bool isActive() const;
66  void setActive(bool active);
67  void forceRefresh(); // Call this method in case you need an instance tooltip refresh in case of tooltip content changes
68 
69  // Configuration
70  bool isFadeOutEnabled() const;
71  void enabledFadeOut(bool enable);
72 
73  float getFadeOutTimeInSeconds() const;
74  void setFadeOutTimeInSeconds(float fadeTime);
75 
76  bool isShowDelayEnabled() const;
77  void enabledShowDelay(bool enable);
78 
79  float getShowDelayInSeconds() const;
80  void setShowDelayInSeconds(float fadeTime);
81 
82  // This method is called by the event listener
83  void handleRocketEvent(Rocket::Core::Event& event);
84 
85 
86  //[-------------------------------------------------------]
87  //[ Private methods ]
88  //[-------------------------------------------------------]
89  private:
90  void onReloadGui();
91 
92 
93  //[-------------------------------------------------------]
94  //[ Private data ]
95  //[-------------------------------------------------------]
96  private:
97  qsf::GuiContext& mGuiContext;
98  bool mIsActive;
99  glm::ivec2 mMousePosition;
100  Rocket::Core::EventListener* mEventListener;
101  Rocket::Core::Element* mCurrentTooltipElement;
102  ToolTipWindow* mToolTipWindow;
103  boost::signals2::connection mReloadGuiConnection;
104 
105 
106  };
107 
108 
109 //[-------------------------------------------------------]
110 //[ Namespace ]
111 //[-------------------------------------------------------]
112 } // em5
Definition: ActionPriority.h:13
virtual ~ToolTipManager()
void handleRocketEvent(Rocket::Core::Event &event)
bool isFadeOutEnabled() const
void setShowDelayInSeconds(float fadeTime)
Definition: OverlayComponent.h:29
bool isShowDelayEnabled() const
qsf::GuiContext & getGuiContext() const
bool isActive() const
Definition: PickupPersonByParamedicAction.h:21
float getFadeOutTimeInSeconds() const
Ingame Graphical User Interface (GUI) context class.
Definition: GuiContext.h:62
void setFadeOutTimeInSeconds(float fadeTime)
void setActive(bool active)
ToolTipManager(qsf::GuiContext &guiContext)
EMERGENCY 5 tooltip manager class.
Definition: ToolTipManager.h:53
float getShowDelayInSeconds() const
EMERGENCY 5 tooltip window.
Definition: ToolTipWindow.h:47
void enabledShowDelay(bool enable)
void enabledFadeOut(bool enable)