MyGUI  3.2.1
MyGUI_WidgetManager.h
Go to the documentation of this file.
00001 /*
00002  * This source file is part of MyGUI. For the latest info, see http://mygui.info/
00003  * Distributed under the MIT License
00004  * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
00005  */
00006 
00007 #ifndef __MYGUI_WIDGET_MANAGER_H__
00008 #define __MYGUI_WIDGET_MANAGER_H__
00009 
00010 #include "MyGUI_Prerequest.h"
00011 #include "MyGUI_Singleton.h"
00012 #include "MyGUI_IUnlinkWidget.h"
00013 #include "MyGUI_ICroppedRectangle.h"
00014 #include "MyGUI_Widget.h"
00015 #include <set>
00016 #include "MyGUI_BackwardCompatibility.h"
00017 
00018 namespace MyGUI
00019 {
00020     class MYGUI_EXPORT WidgetManager :
00021         public Singleton<WidgetManager>,
00022         public MemberObsolete<WidgetManager>
00023     {
00024     public:
00025         WidgetManager();
00026 
00027         void initialise();
00028         void shutdown();
00029 
00030         Widget* createWidget(WidgetStyle _style, const std::string& _type, const std::string& _skin, const IntCoord& _coord, Widget* _parent, ICroppedRectangle* _cropeedParent, const std::string& _name);
00031 
00033         void destroyWidget(Widget* _widget);
00035         void destroyWidgets(const VectorWidgetPtr& _widgets);
00037         void destroyWidgets(EnumeratorWidgetPtr _widgets);
00038 
00040         void registerUnlinker(IUnlinkWidget* _unlink);
00042         void unregisterUnlinker(IUnlinkWidget* _unlink);
00044         void unlinkFromUnlinkers(Widget* _widget);
00045 
00047         bool isFactoryExist(const std::string& _type);
00048 
00049         /*internal:*/
00050         void _deleteWidget(Widget* _widget);
00051         void _deleteDelayWidgets();
00052 
00053         const std::string& getCategoryName() const;
00054 
00055     private:
00056         void notifyEventFrameStart(float _time);
00057 
00058     private:
00059         bool mIsInitialise;
00060         std::string mCategoryName;
00061 
00062         // список менеджеров для отписки при удалении
00063         VectorIUnlinkWidget mVectorIUnlinkWidget;
00064 
00065         // список виджетов для удаления
00066         VectorWidgetPtr mDestroyWidgets;
00067     };
00068 
00069 } // namespace MyGUI
00070 
00071 #endif // __MYGUI_WIDGET_MANAGER_H__