MyGUI 3.5.3
MyGUI_WidgetManager.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_WIDGET_MANAGER_H_
8#define MYGUI_WIDGET_MANAGER_H_
9
10#include "MyGUI_Prerequest.h"
11#include "MyGUI_Singleton.h"
12#include "MyGUI_IUnlinkWidget.h"
14#include "MyGUI_Widget.h"
15#include <set>
17
18namespace MyGUI
19{
20
21 class MYGUI_EXPORT WidgetManager : public MemberObsolete<WidgetManager>
22 {
23 MYGUI_SINGLETON_DECLARATION(WidgetManager);
24
25 public:
26 WidgetManager();
27
28 void initialise();
29 void shutdown();
30
31 Widget* createWidget(
32 WidgetStyle _style,
33 std::string_view _type,
34 std::string_view _skin,
35 const IntCoord& _coord,
36 Widget* _parent,
37 ICroppedRectangle* _cropeedParent,
38 std::string_view _name);
39
41 void destroyWidget(Widget* _widget);
43 void destroyWidgets(const VectorWidgetPtr& _widgets);
44
45#ifndef MYGUI_DONT_USE_OBSOLETE
46 using MemberObsolete<WidgetManager>::destroyWidgets;
47#endif
48
50 void registerUnlinker(IUnlinkWidget* _unlink);
52 void unregisterUnlinker(IUnlinkWidget* _unlink);
54 void unlinkFromUnlinkers(Widget* _widget);
55
57 bool isFactoryExist(std::string_view _type);
58
59 /*internal:*/
60 void _deleteWidget(Widget* _widget);
61 void _deleteDelayWidgets();
62
63 const std::string& getCategoryName() const;
64
65 private:
66 void notifyEventFrameStart(float _time);
67
68 private:
69 bool mIsInitialise{false};
70 std::string mCategoryName;
71
72 // List of managers for unlink when deleting widget
73 VectorIUnlinkWidget mVectorIUnlinkWidget;
74
75 // List of widgets to remove
76 VectorWidgetPtr mDestroyWidgets;
77 };
78
79} // namespace MyGUI
80
81#endif // MYGUI_WIDGET_MANAGER_H_
#define MYGUI_EXPORT
#define MYGUI_SINGLETON_DECLARATION(ClassName)
std::vector< IUnlinkWidget * > VectorIUnlinkWidget
std::vector< Widget * > VectorWidgetPtr