MyGUI 3.5.3
MyGUI_PointerManager.h
Go to the documentation of this file.
1/*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7#ifndef MYGUI_POINTER_MANAGER_H_
8#define MYGUI_POINTER_MANAGER_H_
9
10#include "MyGUI_Prerequest.h"
11#include "MyGUI_Singleton.h"
12#include "MyGUI_EventPair.h"
13#include "MyGUI_IUnlinkWidget.h"
15#include "MyGUI_ImageBox.h"
16#include "MyGUI_IPointer.h"
18
19namespace MyGUI
20{
21
22 class MYGUI_EXPORT PointerManager :
23 private WidgetContainer,
24 public IUnlinkWidget,
25 public MemberObsolete<PointerManager>
26 {
27 MYGUI_SINGLETON_DECLARATION(PointerManager);
28
29 public:
30 PointerManager();
31
32 void initialise();
33 void shutdown();
34
36 void setVisible(bool _visible);
38 bool isVisible() const;
39
43 void setPointer(std::string_view _name);
45 void resetToDefaultPointer();
46
48 const std::string& getDefaultPointer() const;
50 void setDefaultPointer(std::string_view _value);
51
53 const std::string& getLayerName() const;
55 void setLayerName(std::string_view _value);
56
58 IPointer* getByName(std::string_view _name) const;
59
60 /*events:*/
65 EventPairConvertStringView<
66 delegates::MultiDelegate<const std::string&>,
67 delegates::MultiDelegate<std::string_view>>
68 eventChangeMousePointer;
69
70 private:
71 void _unlinkWidget(Widget* _widget) override;
72 void _load(xml::ElementPtr _node, std::string_view _file, Version _version);
73
74 void Update();
75
76 void notifyFrameStart(float _time);
77 void notifyChangeMouseFocus(Widget* _widget);
78 void setPointer(std::string_view _name, Widget* _owner);
79
80 private:
81 std::string mDefaultName;
82 IntPoint mPoint;
83 IntPoint mOldPoint;
84 bool mVisible{false};
85 std::string mLayerName;
86 std::string mSkinName;
87
88 Widget* mWidgetOwner{nullptr};
89 ImageBox* mMousePointer{nullptr};
90 IPointer* mPointer{nullptr};
91 std::string mCurrentMousePointer;
92
93 bool mIsInitialise{false};
94 std::string mXmlPointerTagName;
95 std::string mXmlPropertyTagName;
96 std::string mXmlDefaultPointerValue;
97 };
98
99} // namespace MyGUI
100
101#endif // MYGUI_POINTER_MANAGER_H_
#define MYGUI_EXPORT
#define MYGUI_SINGLETON_DECLARATION(ClassName)
types::TPoint< int > IntPoint
Definition MyGUI_Types.h:26