MyGUI  3.2.1
MyGUI_ISubWidget.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_I_SUB_WIDGET_H__
00008 #define __MYGUI_I_SUB_WIDGET_H__
00009 
00010 #include "MyGUI_Prerequest.h"
00011 #include "MyGUI_ICroppedRectangle.h"
00012 #include "MyGUI_ILayerNode.h"
00013 #include "MyGUI_Types.h"
00014 #include "MyGUI_IRenderTarget.h"
00015 #include "MyGUI_IStateInfo.h"
00016 #include "MyGUI_IObject.h"
00017 
00018 namespace MyGUI
00019 {
00020 
00021     class ISubWidget;
00022     typedef std::vector<ISubWidget*> VectorSubWidget;
00023 
00024     class MYGUI_EXPORT ISubWidget :
00025         public ICroppedRectangle,
00026         public IObject
00027     {
00028         MYGUI_RTTI_DERIVED( ISubWidget )
00029 
00030     public:
00031         ISubWidget() : mVisible(true) { }
00032         virtual ~ISubWidget() { }
00033 
00034         virtual void createDrawItem(ITexture* _texture, ILayerNode* _node) = 0;
00035         virtual void destroyDrawItem() = 0;
00036 
00037         virtual void setAlpha(float _alpha) { }
00038 
00039         virtual void setStateData(IStateInfo* _data) { }
00040 
00041         virtual void doRender() = 0;
00042 
00043         virtual void setAlign(Align _value)
00044         {
00045             mAlign = _value;
00046         }
00047         virtual void setVisible(bool _value)
00048         {
00049             mVisible = _value;
00050         }
00051 
00052         virtual void _updateView() { }
00053         virtual void _correctView() { }
00054 
00055         virtual void _setAlign(const IntSize& _oldsize)  { }
00056 
00057         virtual void doManualRender(IVertexBuffer* _buffer, ITexture* _texture, size_t _count) { }
00058 
00059     protected:
00060         Align mAlign;
00061         bool mVisible;
00062     };
00063 
00064 } // namespace MyGUI
00065 
00066 #endif // __MYGUI_I_SUB_WIDGET_H__