Emergency 20 Dokumentation  4.2.0
MessageWindow.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 "em5/Export.h"
14 
15 #include <qsf/gui/GuiDocument.h>
16 #include <qsf/job/JobProxy.h>
17 #include <qsf/math/Color3.h>
18 
19 
20 //[-------------------------------------------------------]
21 //[ Namespace ]
22 //[-------------------------------------------------------]
23 namespace em5
24 {
25 
26 
27  //[-------------------------------------------------------]
28  //[ Classes ]
29  //[-------------------------------------------------------]
31  {
32 
33 
34  //[-------------------------------------------------------]
35  //[ Public methods ]
36  //[-------------------------------------------------------]
37  public:
38  explicit MessageWindow(qsf::GuiContext& guiContext);
39  virtual ~MessageWindow();
40  void setMaximumNumberOfMessages(uint32 maximumNumberOfMessages);
41 
46  void addTextMessage(const std::string& text, const qsf::Color3& color = qsf::Color3::WHITE);
47 
52  void clear();
53 
54 
55  //[-------------------------------------------------------]
56  //[ Public virtual qsf::GuiDocument methods ]
57  //[-------------------------------------------------------]
58  public:
59  virtual void processEvent(const std::string& eventKey, Rocket::Core::Event& event) override;
60 
61 
62  //[-------------------------------------------------------]
63  //[ Private virtual qsf::GuiDocument methods ]
64  //[-------------------------------------------------------]
65  private:
66  virtual bool onPreShow() override;
67 
68 
69  //[-------------------------------------------------------]
70  //[ Private methods ]
71  //[-------------------------------------------------------]
72  private:
77  void onAnimationUpdate(const qsf::JobArguments& jobArguments);
78 
83  void open();
84 
89  void close();
90 
91 
92  //[-------------------------------------------------------]
93  //[ Private definitions ]
94  //[-------------------------------------------------------]
95  private:
96  struct NewMessageData
97  {
98  Rocket::Core::Element* element;
99  float height;
100  };
101 
102 
103  //[-------------------------------------------------------]
104  //[ Private data ]
105  //[-------------------------------------------------------]
106  private:
107  uint32 mMaximumNumberOfMessages;
108  qsf::JobProxy mAnimationJobProxy;
109  std::vector<NewMessageData> mNewMessageTextElementsList;
110 
111 
112  };
113 
114 
115 //[-------------------------------------------------------]
116 //[ Namespace ]
117 //[-------------------------------------------------------]
118 } // em5
Definition: ActionPriority.h:13
static const Color3 WHITE
White (sRGB="255 255 255", Hex="#FFFFFF")
Definition: Color3.h:41
Job proxy class.
Definition: JobProxy.h:51
unsigned int uint32
Definition: PlatformTypes.h:181
Graphical User Interface (GUI) document base class.
Definition: GuiDocument.h:51
#define EM5_API_EXPORT
Definition: Export.h:28
Color class with red, green and blue component.
Definition: Color3.h:30
Job arguments class: holds data to be passed to the called job method by the job manager.
Definition: JobArguments.h:40
Ingame Graphical User Interface (GUI) context class.
Definition: GuiContext.h:62
Definition: MessageWindow.h:30