MyGUI_LayoutManager.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_LAYOUT_MANAGER_H_
#define MYGUI_LAYOUT_MANAGER_H_
#include "MyGUI_Prerequest.h"
#include "MyGUI_Singleton.h"
#include "MyGUI_EventPair.h"
#include "MyGUI_XmlDocument.h"
#include "MyGUI_WidgetDefines.h"
#include "MyGUI_ResourceLayout.h"
#include "MyGUI_BackwardCompatibility.h"
namespace MyGUI
{
using EventHandle_CreateWidgetDelegate = delegates::MultiDelegate<Widget*, const WidgetInfo&>;
using EventHandle_AddUserStringDelegate = EventPairConvertStringView<
delegates::MultiDelegate<Widget*, const std::string&, const std::string&>,
delegates::MultiDelegate<Widget*, std::string_view, std::string_view>>;
class MYGUI_EXPORT LayoutManager : public MemberObsolete<LayoutManager>
{
MYGUI_SINGLETON_DECLARATION(LayoutManager);
public:
LayoutManager();
void initialise();
void shutdown();
VectorWidgetPtr loadLayout(std::string_view _file, std::string_view _prefix = {}, Widget* _parent = nullptr);
void unloadLayout(VectorWidgetPtr& _widgets);
ResourceLayout* getByName(std::string_view _name, bool _throw = true) const;
bool isExist(std::string_view _name) const;
EventHandle_CreateWidgetDelegate eventCreateWidget;
EventHandle_AddUserStringDelegate eventAddUserString;
const std::string& getCurrentLayout() const;
private:
void _load(xml::ElementPtr _node, std::string_view _file, Version _version);
private:
bool mIsInitialise{false};
std::string mCurrentLayoutName;
std::string mXmlLayoutTagName;
};
} // namespace MyGUI
#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_CreateWidgetDelegate
delegates::MultiDelegate< Widget *, const WidgetInfo & > EventHandle_CreateWidgetDelegate
Definition MyGUI_LayoutManager.h:21
MyGUI::VectorWidgetPtr
std::vector< Widget * > VectorWidgetPtr
Definition MyGUI_WidgetDefines.h:20
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