You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ovvizIVisualizationWidget.h 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. #pragma once
  2. #include <openvibe/ov_all.h>
  3. namespace OpenViBE {
  4. namespace VisualizationToolkit {
  5. /// <summary> This enum lists the different types of IVisualizationWidget supported by the platform. </summary>
  6. enum class EVisualizationWidget
  7. {
  8. Undefined, ///< Undefined widget (empty slot in an IVisualizationTree)
  9. Window, ///< Top-level IVisualizationWidget container
  10. Panel, ///< Notebook tab containing IVisualizationWidget objects
  11. Box, ///< Visualization plugin
  12. VerticalSplit, ///< Split widget that divides its client area vertically in two
  13. HorizontalSplit ///< Split widget that divides its client area horizontally in two
  14. };
  15. /**
  16. * \class IVisualizationWidget
  17. * \author Vincent Delannoy (INRIA/IRISA)
  18. * \date 2007-11
  19. * \brief Interface of visualization widgets that are handled by an IVisualizationTree
  20. * These objects are stored in an IVisualizationTree object as they are being created and modified
  21. * to suit the graphical needs of a scenario.
  22. */
  23. class IVisualizationWidget
  24. {
  25. public:
  26. virtual ~IVisualizationWidget() = default;
  27. /**
  28. * \brief Initializes the widget
  29. * \param identifier identifier of the widget
  30. * \param name name of the widget (optional)
  31. * \param type type of the widget
  32. * \param parentID parent widget identifier (OV_Undefined for top-level widgets)
  33. * \param boxID if widget type is EVisualizationWidget::Box, identifier of corresponding IBox
  34. * \param nChild number of children of this widget (none for a visualization box, 1 for a visualization panel, 2 for split widgets, variable number for windows)
  35. * \return True if widget was successfully initialized, false otherwise
  36. */
  37. virtual bool initialize(const CIdentifier& identifier, const CString& name,
  38. const EVisualizationWidget type, const CIdentifier& parentID,
  39. const CIdentifier& boxID, const size_t nChild) = 0;
  40. /**
  41. * \brief Returns the identifier of the widget
  42. * \return Widget identifier
  43. */
  44. virtual CIdentifier getIdentifier() const = 0;
  45. /**
  46. * \brief Returns the name of the widget
  47. * \return Widget name
  48. */
  49. virtual const CString& getName() const = 0;
  50. /**
  51. * \brief Sets the name of the widget
  52. * \param name name to give to the widget
  53. */
  54. virtual void setName(const CString& name) = 0;
  55. /**
  56. * \brief Returns the type of the widget
  57. * \return Widget type
  58. */
  59. virtual EVisualizationWidget getType() const = 0;
  60. /**
  61. * \brief Returns the identifier of the widget's parent (if any)
  62. * \return Widget's parent identifier if any, OV_Undefined otherwise
  63. */
  64. virtual CIdentifier getParentIdentifier() const = 0;
  65. /**
  66. * \brief Sets the identifier of the widget's parent
  67. * \param parentID identifier of the widget's parent
  68. */
  69. virtual void setParentIdentifier(const CIdentifier& parentID) = 0;
  70. /**
  71. * \brief Returns the identifier of the IBox associated to this widget.
  72. *
  73. * This only applies to widgets of type EVisualizationWidget::Box.
  74. * \return Identifier of IBox associated to this widget
  75. */
  76. virtual CIdentifier getBoxIdentifier() const = 0;
  77. /**
  78. * \brief Returns the number of children of this widget
  79. * \return Number of child widgets
  80. */
  81. virtual size_t getNbChildren() const = 0;
  82. /**
  83. * \brief Returns the index of a given child
  84. * \param identifier identifier of a child widget
  85. * \param index [out] index at which the child widget is stored
  86. * \return True if the child was found, false otherwise
  87. */
  88. virtual bool getChildIndex(const CIdentifier& identifier, size_t& index) const = 0;
  89. /**
  90. * \brief Adds a child to a widget
  91. *
  92. * Only useful for top-level widgets (EVisualizationWidget::Window) since the number
  93. * of tabs their notebook may contain is unknown a priori. The child is added after existing children.
  94. * \param childIdentifier identifier of child to be added to widget
  95. * \return True if child was successfully added
  96. */
  97. virtual bool addChild(const CIdentifier& childIdentifier) = 0;
  98. /**
  99. * \brief Removes a child from a widget
  100. * \param childIdentifier identifier of child to be removed to the widget
  101. * \return True if the child was successfully removed
  102. */
  103. virtual bool removeChild(const CIdentifier& childIdentifier) = 0;
  104. /**
  105. * \brief Returns the identifier of a given child
  106. * \param childIndex index of child whose identifier is to be retrieved
  107. * \param childIdentifier [out] identifier of child
  108. * \return True if child identifier was successfully returned, false otherwise
  109. */
  110. virtual bool getChildIdentifier(const size_t childIndex, CIdentifier& childIdentifier) const = 0;
  111. /**
  112. * \brief Sets the identifier of a child
  113. * \param childIndex index of child whose identifier is to be set
  114. * \param childIdentifier identifier of the child to be added to the widget
  115. * \return True if the child was successfully set
  116. */
  117. virtual bool setChildIdentifier(const size_t childIndex, const CIdentifier& childIdentifier) = 0;
  118. virtual void setWidth(const size_t width) = 0;
  119. virtual void setHeight(const size_t height) = 0;
  120. virtual size_t getWidth() = 0;
  121. virtual size_t getHeight() = 0;
  122. virtual void setDividerPosition(const int dividerPosition) = 0;
  123. virtual void setMaxDividerPosition(const int maxDividerPosition) = 0;
  124. virtual int getDividerPosition() = 0;
  125. virtual int getMaxDividerPosition() = 0;
  126. };
  127. } // namespace VisualizationToolkit
  128. } // namespace OpenViBE