BsEditorWidgetLayout.h 2.3 KB

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