##// END OF EJS Templates
Creates a interface that defines a variable container...
Alexandre Leroux -
r209:7ef1d04a5917
parent child
Show More
@@ -0,0 +1,19
1 #ifndef SCIQLOP_IVARIABLECONTAINER_H
2 #define SCIQLOP_IVARIABLECONTAINER_H
3
4 class Variable;
5
6 /**
7 * @brief The IVariableContainer interface represents an UI object that can accommodate a variable
8 */
9 class IVariableContainer {
10
11 public:
12 virtual ~IVariableContainer() = default;
13
14 /// Checks if the container can handle the variable passed in parameter
15 virtual bool canDrop(const Variable &variable) const = 0;
16 };
17
18
19 #endif // SCIQLOP_IVARIABLECONTAINER_H
@@ -1,6 +1,7
1 1 #ifndef SCIQLOP_IVISUALIZATIONWIDGET_H
2 2 #define SCIQLOP_IVISUALIZATIONWIDGET_H
3 3
4 #include "Visualization/IVariableContainer.h"
4 5
5 6 #include <QString>
6 7 #include <memory>
@@ -10,7 +11,7 class IVisualizationWidgetVisitor;
10 11 /**
11 12 * @brief The IVisualizationWidget handles the visualization widget.
12 13 */
13 class IVisualizationWidget {
14 class IVisualizationWidget : public IVariableContainer {
14 15
15 16 public:
16 17 virtual ~IVisualizationWidget() = default;
@@ -26,6 +26,7 public:
26 26
27 27 // IVisualizationWidget interface
28 28 void accept(IVisualizationWidgetVisitor *visitor) override;
29 bool canDrop(const Variable &variable) const override;
29 30 void close() override;
30 31 QString name() const;
31 32
@@ -37,6 +37,7 public:
37 37
38 38 // IVisualizationWidget interface
39 39 void accept(IVisualizationWidgetVisitor *visitor) override;
40 bool canDrop(const Variable &variable) const override;
40 41 void close() override;
41 42 QString name() const override;
42 43
@@ -33,6 +33,7 public:
33 33
34 34 // IVisualizationWidget interface
35 35 void accept(IVisualizationWidgetVisitor *visitor) override;
36 bool canDrop(const Variable &variable) const override;
36 37 void close() override;
37 38 QString name() const;
38 39
@@ -34,6 +34,7 public:
34 34
35 35 // IVisualizationWidget interface
36 36 void accept(IVisualizationWidgetVisitor *visitor) override;
37 bool canDrop(const Variable &variable) const override;
37 38 void close() override;
38 39 QString name() const override;
39 40
@@ -64,6 +64,13 void VisualizationGraphWidget::accept(IVisualizationWidgetVisitor *visitor)
64 64 }
65 65 }
66 66
67 bool VisualizationGraphWidget::canDrop(const Variable &variable) const
68 {
69 /// @todo : for the moment, a graph can always accomodate a variable
70 Q_UNUSED(variable);
71 return true;
72 }
73
67 74 void VisualizationGraphWidget::close()
68 75 {
69 76 // The main view cannot be directly closed.
@@ -80,6 +80,13 void VisualizationTabWidget::accept(IVisualizationWidgetVisitor *visitor)
80 80 }
81 81 }
82 82
83 bool VisualizationTabWidget::canDrop(const Variable &variable) const
84 {
85 // A tab can always accomodate a variable
86 Q_UNUSED(variable);
87 return true;
88 }
89
83 90 void VisualizationTabWidget::close()
84 91 {
85 92 // The main view cannot be directly closed.
@@ -99,6 +99,13 void VisualizationWidget::accept(IVisualizationWidgetVisitor *visitor)
99 99 }
100 100 }
101 101
102 bool VisualizationWidget::canDrop(const Variable &variable) const
103 {
104 // The main widget can never accomodate a variable
105 Q_UNUSED(variable);
106 return false;
107 }
108
102 109 void VisualizationWidget::close()
103 110 {
104 111 // The main view cannot be directly closed.
@@ -75,6 +75,13 void VisualizationZoneWidget::accept(IVisualizationWidgetVisitor *visitor)
75 75 }
76 76 }
77 77
78 bool VisualizationZoneWidget::canDrop(const Variable &variable) const
79 {
80 // A tab can always accomodate a variable
81 Q_UNUSED(variable);
82 return true;
83 }
84
78 85 void VisualizationZoneWidget::close()
79 86 {
80 87 // The main view cannot be directly closed.
General Comments 0
You need to be logged in to leave comments. Login now