| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- #pragma once
- #include "CmEditorPrerequisites.h"
- #include "CmModule.h"
- #include <QtCore/QString>
- #include "3rdParty/pugixml/pugixml.hpp"
- namespace CamelotEditor
- {
- enum WindowDockState
- {
- WDS_LEFT,
- WDS_RIGHT,
- WDS_TOP,
- WDS_BOTTOM,
- WDS_CENTER,
- WDS_FLOATING
- };
- struct WindowLayoutDesc
- {
- WindowLayoutDesc()
- :width(0), height(0), left(0), top(0),
- screenIdx(-1), maximized(true), dockState(WDS_FLOATING),
- dockParentId(-1), activeWidget(0), id(0)
- {
- }
- UINT32 activeWidget;
- Vector<QString>::type childWidgetNames;
- INT32 id;
- UINT32 width;
- UINT32 height;
- UINT32 left;
- UINT32 top;
- UINT32 screenIdx;
- bool maximized;
- WindowDockState dockState;
- INT32 dockParentId;
- };
- class EditorPrefs : public CamelotFramework::Module<EditorPrefs>
- {
- public:
- UINT32 getNumRecentlyUsedProjects() const;
- const QString& getRecentlyUsedProjectPath(UINT32 idx) const;
- void addRecentlyUsedProjectPath(const QString& path);
- void removeRecentlyUsedProjectPath(UINT32 idx);
- void setLastUsedProjectDirectory(const QString& value);
- const QString& getLastUsedProjectDirectory() const;
- void setMainWindowLayout(const WindowLayoutDesc& desc);
- const WindowLayoutDesc& getMainWindowLayout() const;
- void setWindowLayouts(const Vector<WindowLayoutDesc>::type& descs);
- const Vector<WindowLayoutDesc>::type& getWindowLayouts() const;
- void save(const QString& path, bool overwrite = true) const;
- void load(const QString& path);
- private:
- Vector<QString>::type mRecentlyUsedProjects;
- QString mLastUsedProjectDirectory;
- WindowLayoutDesc mMainWindowLayout;
- Vector<WindowLayoutDesc>::type mWindowLayouts;
- void saveWindowLayout(pugi::xml_node parentNode, const WindowLayoutDesc& desc) const;
- WindowLayoutDesc loadWindowLayout(pugi::xml_node node) const;
- void clear();
- };
- EditorPrefs& gEditorPrefs();
- }
|