BsEditorWidgetLayout.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsEditorPrerequisites.h"
  5. #include "BsIReflectable.h"
  6. namespace BansheeEngine
  7. {
  8. /** @cond INTERNAL */
  9. /** @addtogroup EditorWindow
  10. * @{
  11. */
  12. /** Contains stored positions and sizes of all editor widgets, whether docked or floating. */
  13. class EditorWidgetLayout : public IReflectable
  14. {
  15. public:
  16. /** An entry representing widgets and area of a single widget container. */
  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. * Returns saved representations of all widget containers. Each entry contains information about a single widget
  34. * container.
  35. */
  36. Vector<Entry>& getEntries() { return mEntries; }
  37. /** Returns dock layout that contains data about how were widget containers docked in the dock manager. */
  38. const DockManagerLayoutPtr& getDockLayout() const { return mDockLayout; }
  39. /** Sets whether the main editor window is maximized. */
  40. void setIsMainWindowMaximized(bool maximized) { mMaximized = maximized; }
  41. /** Checks whether the main editor window was maximized. */
  42. bool getIsMainWindowMaximized() const { return mMaximized; }
  43. private:
  44. Vector<Entry> mEntries;
  45. DockManagerLayoutPtr mDockLayout;
  46. bool mMaximized;
  47. /************************************************************************/
  48. /* RTTI */
  49. /************************************************************************/
  50. public:
  51. friend class EditorWidgetLayoutRTTI;
  52. static RTTITypeBase* getRTTIStatic();
  53. virtual RTTITypeBase* getRTTI() const override;
  54. };
  55. /** @} */
  56. /** @endcond */
  57. }