]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModuleBase/ModuleBase_OperationDescription.h
Salome HOME
According to "operation-widget_factory-property"
[modules/shaper.git] / src / ModuleBase / ModuleBase_OperationDescription.h
1 /*
2  * ModuleBase_OperationDescription.h
3  *
4  *  Created on: Apr 2, 2014
5  *      Author: sbh
6  */
7
8 #ifndef MODULEBASE_OPERATIONDESCRIPTION_H
9 #define MODULEBASE_OPERATIONDESCRIPTION_H
10
11 #include <ModuleBase.h>
12 #include <ModuleBase_Operation.h>
13
14 #include <QObject>
15 #include <QString>
16 #include <QList>
17
18 #include <memory>
19
20 class ModuleBase_ModelWidget;
21
22 /*!
23  * \class ModuleBase_OperationDescription
24  *
25  */
26 class MODULEBASE_EXPORT ModuleBase_OperationDescription
27 {
28 public:
29   /// Constructor
30   /// \param theId - the operation identifier
31   ModuleBase_OperationDescription(const QString& theId = "");
32   /// Destructor
33   virtual ~ModuleBase_OperationDescription();
34
35   /// Unique name of the operation
36   /// \return string name of the operation.
37   const QString& operationId() const;
38
39   /// Returns XML representation of the operation's widget.
40   /// \return XML QString
41   //const QString& xmlRepresentation() const;
42
43   /// Returns a short description of operation (will be
44   /// inserted in title of property panel)
45   const QString& description() const;
46
47   /// Sets a short description of operation (will be
48   /// inserted in title of property panel)
49   void setDescription(const QString& theDescription);
50
51   /// Sets a list of model widgets, according to the operation feature xml definition
52   /// \param theWidgets a list of widgets
53   void setModelWidgets(const std::string& theXmlRepresentation,
54                        const QList<ModuleBase_ModelWidget*>& theWidgets);
55
56   /// Sets a list of model widgets, according to the operation feature xml definition
57   /// \param theWidgets a list of widgets
58   const QList<ModuleBase_ModelWidget*>& modelWidgets() const;
59
60   /// Returns true if there are no model widgets
61   /// \return the boolean value
62   bool hasXmlRepresentation() const;
63
64 private:
65   //!< Next fields could be extracted into a subclass;
66   QString myOperationId; /// the operation identifier
67   QString myDescription; /// the short description of the opertaion
68   std::string myXmlRepresentation; /// the xml definition
69   QList<ModuleBase_ModelWidget*> myWidgets; /// the list of operation widgets
70 };
71
72 #endif //ModuleBase_OperationDescription_H