MyGUI_ResourceLayout.h
Go to the documentation of this file.
/*
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#ifndef MYGUI_RESOURCE_LAYOUT_H_
#define MYGUI_RESOURCE_LAYOUT_H_
#include "MyGUI_Prerequest.h"
#include "MyGUI_IResource.h"
#include "MyGUI_LayoutData.h"
namespace MyGUI
{
class MYGUI_EXPORT ResourceLayout : public IResource
{
MYGUI_RTTI_DERIVED(ResourceLayout)
public:
ResourceLayout() = default;
ResourceLayout(xml::ElementPtr _node, std::string_view _file);
void deserialization(xml::ElementPtr _node, Version _version) override;
const VectorWidgetInfo& getLayoutData() const;
VectorWidgetPtr createLayout(std::string_view _prefix = {}, Widget* _parent = nullptr);
// widget info -> Widget
Widget* createWidget(
const WidgetInfo& _widgetInfo,
std::string_view _prefix = {},
Widget* _parent = nullptr,
bool _template = false);
protected:
// xml -> widget info
WidgetInfo parseWidget(xml::ElementEnumerator& _widget);
protected:
VectorWidgetInfo mLayoutData;
};
} // namespace MyGUI
#endif // MYGUI_RESOURCE_LAYOUT_H_
MyGUI_IResource.h
MyGUI_LayoutData.h
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MYGUI_RTTI_DERIVED
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition MyGUI_RTTI.h:69
MyGUI::IResource::IResource
IResource(IResource const &)=delete
MyGUI::ResourceLayout::mLayoutData
VectorWidgetInfo mLayoutData
Definition MyGUI_ResourceLayout.h:45
MyGUI::ResourceLayout::deserialization
void deserialization(xml::ElementPtr _node, Version _version) override
Definition MyGUI_ResourceLayout.cpp:26
MyGUI::ResourceLayout::ResourceLayout
ResourceLayout()=default
MyGUI::ResourceLayout::createLayout
VectorWidgetPtr createLayout(std::string_view _prefix={}, Widget *_parent=nullptr)
Definition MyGUI_ResourceLayout.cpp:104
MyGUI::ResourceLayout::getLayoutData
const VectorWidgetInfo & getLayoutData() const
Definition MyGUI_ResourceLayout.cpp:224
MyGUI::Version
Definition MyGUI_Version.h:18
MyGUI::Widget
widget description should be here.
Definition MyGUI_Widget.h:40
MyGUI::xml::ElementPtr
Element * ElementPtr
Definition MyGUI_XmlDocument.h:112
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::VectorWidgetInfo
std::vector< WidgetInfo > VectorWidgetInfo
Definition MyGUI_LayoutData.h:55
MyGUI::VectorWidgetPtr
std::vector< Widget * > VectorWidgetPtr
Definition MyGUI_WidgetDefines.h:20
MyGUI::WidgetInfo
Definition MyGUI_LayoutData.h:23