MyGUI: MyGUI_ResourceLayout.h Source File

MyGUI 3.4.3

MyGUI_ResourceLayout.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_RESOURCE_LAYOUT_H_
8#define MYGUI_RESOURCE_LAYOUT_H_
9
10#include "MyGUI_Prerequest.h"
11#include "MyGUI_IResource.h"
12#include "MyGUI_LayoutData.h"
13
14namespace MyGUI
15{
16
18 class MYGUI_EXPORT ResourceLayout : public IResource
19 {
20 MYGUI_RTTI_DERIVED(ResourceLayout)
21
22 public:
23 ResourceLayout() = default;
24 ResourceLayout(xml::ElementPtr _node, std::string_view _file);
25
26 void deserialization(xml::ElementPtr _node, Version _version) override;
27
28 const VectorWidgetInfo& getLayoutData() const;
29
31 VectorWidgetPtr createLayout(std::string_view _prefix = {}, Widget* _parent = nullptr);
32
33 // widget info -> Widget
34 Widget* createWidget(
35 const WidgetInfo& _widgetInfo,
36 std::string_view _prefix = {},
37 Widget* _parent = nullptr,
38 bool _template = false);
39
40 protected:
41 // xml -> widget info
42 WidgetInfo parseWidget(xml::ElementEnumerator& _widget);
43
44 protected:
45 VectorWidgetInfo mLayoutData;
46 };
47
48} // namespace MyGUI
49
50#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