MyGUI
3.2.1
|
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_CONTROLLER_MANAGER_H__ 00008 #define __MYGUI_CONTROLLER_MANAGER_H__ 00009 00010 #include "MyGUI_Prerequest.h" 00011 #include "MyGUI_Singleton.h" 00012 #include "MyGUI_ControllerItem.h" 00013 #include "MyGUI_IUnlinkWidget.h" 00014 #include "MyGUI_WidgetDefines.h" 00015 #include "MyGUI_ActionController.h" 00016 00017 namespace MyGUI 00018 { 00019 00020 class MYGUI_EXPORT ControllerManager : 00021 public Singleton<ControllerManager>, 00022 public IUnlinkWidget 00023 { 00024 public: 00025 ControllerManager(); 00026 00027 void initialise(); 00028 void shutdown(); 00029 00033 ControllerItem* createItem(const std::string& _type); 00034 00042 void addItem(Widget* _widget, ControllerItem* _item); 00043 00047 void removeItem(Widget* _widget); 00048 00049 const std::string& getCategoryName() const; 00050 00051 private: 00052 void _unlinkWidget(Widget* _widget); 00053 void frameEntered(float _time); 00054 void clear(); 00055 00056 private: 00057 typedef std::pair<Widget*, ControllerItem*> PairControllerItem; 00058 typedef std::list<PairControllerItem> ListControllerItem; 00059 ListControllerItem mListItem; 00060 00061 bool mIsInitialise; 00062 std::string mCategoryName; 00063 }; 00064 00065 } // namespace MyGUI 00066 00067 #endif // __MYGUI_CONTROLLER_MANAGER_H__