MyGUI: MyGUI_LayoutManager.h Source File

MyGUI 3.4.3

MyGUI_LayoutManager.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_LAYOUT_MANAGER_H_
8#define MYGUI_LAYOUT_MANAGER_H_
9
10#include "MyGUI_Prerequest.h"
11#include "MyGUI_Singleton.h"
12#include "MyGUI_EventPair.h"
13#include "MyGUI_XmlDocument.h"
14#include "MyGUI_WidgetDefines.h"
15#include "MyGUI_ResourceLayout.h"
16#include "MyGUI_BackwardCompatibility.h"
17
18namespace MyGUI
19{
20
21 using EventHandle_CreateWidgetDelegate = delegates::MultiDelegate<Widget*, const WidgetInfo&>;
22 using EventHandle_AddUserStringDelegate = EventPairConvertStringView<
23 delegates::MultiDelegate<Widget*, const std::string&, const std::string&>,
24 delegates::MultiDelegate<Widget*, std::string_view, std::string_view>>;
25
26 class MYGUI_EXPORT LayoutManager : public MemberObsolete<LayoutManager>
27 {
28 MYGUI_SINGLETON_DECLARATION(LayoutManager);
29
30 public:
31 LayoutManager();
32
33 void initialise();
34 void shutdown();
35
42 VectorWidgetPtr loadLayout(std::string_view _file, std::string_view _prefix = {}, Widget* _parent = nullptr);
43
45 void unloadLayout(VectorWidgetPtr& _widgets);
46
48 ResourceLayout* getByName(std::string_view _name, bool _throw = true) const;
49
51 bool isExist(std::string_view _name) const;
52
60 EventHandle_CreateWidgetDelegate eventCreateWidget;
61
69 EventHandle_AddUserStringDelegate eventAddUserString;
70
71 const std::string& getCurrentLayout() const;
72
73 private:
74 void _load(xml::ElementPtr _node, std::string_view _file, Version _version);
75
76 private:
77 bool mIsInitialise{false};
78 std::string mCurrentLayoutName;
79 std::string mXmlLayoutTagName;
80 };
81
82} // namespace MyGUI
83
84#endif // MYGUI_LAYOUT_MANAGER_H_
MyGUI_BackwardCompatibility.h
MyGUI_EventPair.h
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MyGUI_ResourceLayout.h
MyGUI_Singleton.h
MYGUI_SINGLETON_DECLARATION
#define MYGUI_SINGLETON_DECLARATION(ClassName)
Definition MyGUI_Singleton.h:112
MyGUI_WidgetDefines.h
MyGUI_XmlDocument.h
MyGUI::EventPairConvertStringView
Definition MyGUI_EventPair.h:213
MyGUI::LayoutManager::getCurrentLayout
const std::string & getCurrentLayout() const
Definition MyGUI_LayoutManager.cpp:105
MyGUI::LayoutManager::loadLayout
VectorWidgetPtr loadLayout(std::string_view _file, std::string_view _prefix={}, Widget *_parent=nullptr)
Definition MyGUI_LayoutManager.cpp:59
MyGUI::LayoutManager::eventAddUserString
EventHandle_AddUserStringDelegate eventAddUserString
Definition MyGUI_LayoutManager.h:69
MyGUI::LayoutManager::initialise
void initialise()
Definition MyGUI_LayoutManager.cpp:24
MyGUI::LayoutManager::eventCreateWidget
EventHandle_CreateWidgetDelegate eventCreateWidget
Definition MyGUI_LayoutManager.h:60
MyGUI::LayoutManager::LayoutManager
LayoutManager(const LayoutManager &)=delete
MyGUI::LayoutManager::shutdown
void shutdown()
Definition MyGUI_LayoutManager.cpp:39
MyGUI::MemberObsolete
Definition MyGUI_DeprecatedTypes.h:14
MyGUI::ResourceLayout
Definition MyGUI_ResourceLayout.h:19
MyGUI::Version
Definition MyGUI_Version.h:18
MyGUI::Widget
widget description should be here.
Definition MyGUI_Widget.h:40
MyGUI::delegates::MultiDelegate
Definition MyGUI_Delegate.h:190
MyGUI::xml::ElementPtr
Element * ElementPtr
Definition MyGUI_XmlDocument.h:112
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::EventHandle_AddUserStringDelegate
EventPairConvertStringView< delegates::MultiDelegate< Widget *, const std::string &, const std::string & >, delegates::MultiDelegate< Widget *, std::string_view, std::string_view > > EventHandle_AddUserStringDelegate
Definition MyGUI_LayoutManager.h:22
MyGUI::EventHandle_CreateWidgetDelegate
delegates::MultiDelegate< Widget *, const WidgetInfo & > EventHandle_CreateWidgetDelegate
Definition MyGUI_LayoutManager.h:21
MyGUI::VectorWidgetPtr
std::vector< Widget * > VectorWidgetPtr
Definition MyGUI_WidgetDefines.h:20