BsEditorWidgetLayout.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsIReflectable.h"
  4. namespace BansheeEngine
  5. {
  6. /**
  7. * @brief Contains stored positions and sizes of all editor
  8. * widgets, whether docked or floating.
  9. */
  10. class EditorWidgetLayout : public IReflectable
  11. {
  12. public:
  13. /**
  14. * @brief An entry representing widgets and area of a single
  15. * widget container.
  16. */
  17. struct Entry
  18. {
  19. public:
  20. Entry();
  21. ~Entry();
  22. Vector<String> widgetNames; /**< Unique names of all widgets in the container. */
  23. bool isDocked; /**< Whether the container is floating in its own window or docked. */
  24. INT32 x, y; /**< Position of the container relative to parent window or dock manager. */
  25. UINT32 width, height; /**< Size of the container. */
  26. };
  27. private:
  28. struct PrivatelyConstruct {};
  29. public:
  30. EditorWidgetLayout(const DockManagerLayoutPtr& dockLayout);
  31. EditorWidgetLayout(const PrivatelyConstruct& dummy);
  32. /**
  33. * @brief Returns saved representations of all widget containers. Each entry contains information
  34. * about a single widget container.
  35. */
  36. Vector<Entry>& getEntries() { return mEntries; }
  37. /**
  38. * @brief Returns dock layout that contains data about how were widget containers docked in the
  39. * dock manager.
  40. */
  41. const DockManagerLayoutPtr& getDockLayout() const { return mDockLayout; }
  42. /**
  43. * @brief Sets whether the main editor window is maximized.
  44. */
  45. void setIsMainWindowMaximized(bool maximized) { mMaximized = maximized; }
  46. /**
  47. * @brief Checks whether the main editor window was maximized.
  48. */
  49. bool getIsMainWindowMaximized() const { return mMaximized; }
  50. private:
  51. Vector<Entry> mEntries;
  52. DockManagerLayoutPtr mDockLayout;
  53. bool mMaximized;
  54. /************************************************************************/
  55. /* RTTI */
  56. /************************************************************************/
  57. public:
  58. friend class EditorWidgetLayoutRTTI;
  59. static RTTITypeBase* getRTTIStatic();
  60. virtual RTTITypeBase* getRTTI() const override;
  61. };
  62. }