BsEditorWidgetLayout.h 2.2 KB

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