MyGUI  3.2.0
MyGUI_WidgetManager.h
Go to the documentation of this file.
1 
6 /*
7  This file is part of MyGUI.
8 
9  MyGUI is free software: you can redistribute it and/or modify
10  it under the terms of the GNU Lesser General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  MyGUI is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public License
20  along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
21 */
22 #ifndef __MYGUI_WIDGET_MANAGER_H__
23 #define __MYGUI_WIDGET_MANAGER_H__
24 
25 #include "MyGUI_Prerequest.h"
26 #include "MyGUI_Singleton.h"
27 #include "MyGUI_IUnlinkWidget.h"
29 #include "MyGUI_Widget.h"
30 #include <set>
32 
33 namespace MyGUI
34 {
36  public Singleton<WidgetManager>,
37  public MemberObsolete<WidgetManager>
38  {
39  public:
40  WidgetManager();
41 
42  void initialise();
43  void shutdown();
44 
45  Widget* createWidget(WidgetStyle _style, const std::string& _type, const std::string& _skin, const IntCoord& _coord, Widget* _parent, ICroppedRectangle* _cropeedParent, const std::string& _name);
46 
48  void destroyWidget(Widget* _widget);
50  void destroyWidgets(const VectorWidgetPtr& _widgets);
52  void destroyWidgets(EnumeratorWidgetPtr _widgets);
53 
55  void registerUnlinker(IUnlinkWidget* _unlink);
57  void unregisterUnlinker(IUnlinkWidget* _unlink);
59  void unlinkFromUnlinkers(Widget* _widget);
60 
62  bool isFactoryExist(const std::string& _type);
63 
64  /*internal:*/
65  void _deleteWidget(Widget* _widget);
66  void _deleteDelayWidgets();
67 
68  private:
69  void notifyEventFrameStart(float _time);
70 
71  private:
72  bool mIsInitialise;
73 
74  // список менеджеров для отписки при удалении
75  VectorIUnlinkWidget mVectorIUnlinkWidget;
76 
77  // список виджетов для удаления
78  VectorWidgetPtr mDestroyWidgets;
79  };
80 
81 } // namespace MyGUI
82 
83 #endif // __MYGUI_WIDGET_MANAGER_H__