MyGUI  3.2.1
MyGUI_ControllerItem.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_CONTROLLER_ITEM_H__
00008 #define __MYGUI_CONTROLLER_ITEM_H__
00009 
00010 #include "MyGUI_Prerequest.h"
00011 #include "MyGUI_WidgetDefines.h"
00012 #include "MyGUI_IObject.h"
00013 #include "MyGUI_Delegate.h"
00014 #include "MyGUI_EventPair.h"
00015 
00016 namespace MyGUI
00017 {
00018 
00019     class ControllerItem;
00020 
00021     typedef delegates::CMultiDelegate1<Widget*> EventHandle_WidgetPtr;
00022     typedef delegates::CMultiDelegate2<Widget*, ControllerItem*> EventHandle_WidgetPtrControllerItemPtr;
00023 
00025     class MYGUI_EXPORT ControllerItem :
00026         public IObject
00027     {
00028         MYGUI_RTTI_DERIVED( ControllerItem )
00029 
00030     public:
00031         virtual ~ControllerItem() { }
00032 
00033         virtual void prepareItem(Widget* _widget) = 0;
00034         virtual bool addTime(Widget* _widget, float _time) = 0;
00035 
00036         virtual void setProperty(const std::string& _key, const std::string& _value) { }
00037 
00042         EventPairAddParameter<EventHandle_WidgetPtr, EventHandle_WidgetPtrControllerItemPtr> eventPreAction;
00043 
00048         EventPairAddParameter<EventHandle_WidgetPtr, EventHandle_WidgetPtrControllerItemPtr> eventUpdateAction;
00049 
00054         EventPairAddParameter<EventHandle_WidgetPtr, EventHandle_WidgetPtrControllerItemPtr> eventPostAction;
00055 
00056     };
00057 
00058 } // namespace MyGUI
00059 
00060 #endif // __MYGUI_CONTROLLER_ITEM_H__