MyGUI  3.2.1
MyGUI_ControllerManager.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_CONTROLLER_MANAGER_H__
8 #define __MYGUI_CONTROLLER_MANAGER_H__
9 
10 #include "MyGUI_Prerequest.h"
11 #include "MyGUI_Singleton.h"
12 #include "MyGUI_ControllerItem.h"
13 #include "MyGUI_IUnlinkWidget.h"
14 #include "MyGUI_WidgetDefines.h"
15 #include "MyGUI_ActionController.h"
16 
17 namespace MyGUI
18 {
19 
21  public Singleton<ControllerManager>,
22  public IUnlinkWidget
23  {
24  public:
26 
27  void initialise();
28  void shutdown();
29 
33  ControllerItem* createItem(const std::string& _type);
34 
42  void addItem(Widget* _widget, ControllerItem* _item);
43 
47  void removeItem(Widget* _widget);
48 
49  const std::string& getCategoryName() const;
50 
51  private:
52  void _unlinkWidget(Widget* _widget);
53  void frameEntered(float _time);
54  void clear();
55 
56  private:
57  typedef std::pair<Widget*, ControllerItem*> PairControllerItem;
58  typedef std::list<PairControllerItem> ListControllerItem;
59  ListControllerItem mListItem;
60 
61  bool mIsInitialise;
62  std::string mCategoryName;
63  };
64 
65 } // namespace MyGUI
66 
67 #endif // __MYGUI_CONTROLLER_MANAGER_H__