MyGUI  3.2.1
MyGUI_ResourceLayout.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_RESOURCE_LAYOUT_H__
00008 #define __MYGUI_RESOURCE_LAYOUT_H__
00009 
00010 #include "MyGUI_Prerequest.h"
00011 #include "MyGUI_IResource.h"
00012 #include "MyGUI_LayoutData.h"
00013 
00014 namespace MyGUI
00015 {
00016 
00018     class MYGUI_EXPORT ResourceLayout :
00019         public IResource
00020     {
00021         MYGUI_RTTI_DERIVED( ResourceLayout )
00022 
00023     public:
00024         ResourceLayout();
00025 
00026         ResourceLayout(xml::ElementPtr _node, const std::string& _file);
00027 
00028         virtual void deserialization(xml::ElementPtr _node, Version _version);
00029 
00030         const VectorWidgetInfo& getLayoutData() const;
00031 
00033         VectorWidgetPtr createLayout(const std::string& _prefix = "", Widget* _parent = nullptr);
00034 
00035         // widget info -> Widget
00036         Widget* createWidget(const WidgetInfo& _widgetInfo, const std::string& _prefix = "", Widget* _parent = nullptr, bool _template = false);
00037 
00038     protected:
00039         // xml -> widget info
00040         WidgetInfo parseWidget(xml::ElementEnumerator& _widget);
00041 
00042     protected:
00043         VectorWidgetInfo mLayoutData;
00044     };
00045 
00046 } // namespace MyGUI
00047 
00048 #endif // __MYGUI_RESOURCE_LAYOUT_H__