Salome HOME
Merge branch 'Dev_0.7.1' of newgeom:newgeom into Dev_0.7.1
[modules/shaper.git] / src / Config / Config_FeatureMessage.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D\r
2 \r
3 #ifndef CONFIG_MESSAGE_H\r
4 #define CONFIG_MESSAGE_H\r
5 \r
6 #include <Config_def.h>\r
7 #include <Events_Message.h>\r
8 \r
9 #include <string>\r
10 \r
11 /*!\r
12  * \class Config_FeatureMessage\r
13  * \ingroup Config\r
14  * \brief Class to pass a feature entry extracted from xml file.\r
15  * Example of the feature entry:\r
16  * \code\r
17  * <feature id="Part" text="New part" tooltip="Creates a new part" icon=":pictures/part_ico.png"/>\r
18  * \endcode\r
19  */\r
20 class Config_FeatureMessage : public Events_Message\r
21 {\r
22   std::string myId;  ///<Feature unique id\r
23   std::string myText;  ///<Represents action's text\r
24   std::string myTooltip;  ///<Represents action's tooltip\r
25   std::string myIcon;  ///<Represents action's icon\r
26   std::string myKeysequence;  ///<Represents action's key sequence\r
27 \r
28   std::string myGroupId;  ///<Id of feature's group\r
29   std::string myWorkbenchId;  ///<Id of feature's workbench\r
30   std::string myDocumentKind;  ///< kind of the document of the workbench (all documents if empty)\r
31   std::string myPluginLibrary;  ///<Name of feature's library\r
32 \r
33   bool myUseInput;  ///<Action is being checked until user commit the operation\r
34   bool myInternal;  ///<Internal feature without GUI representation\r
35   std::string myNestedFeatures; ///<Comma separated list of child features\r
36 \r
37  public:\r
38   /// Event ID that feature is loaded in workbench (GUI)\r
39   inline static const char* GUI_EVENT()\r
40   {\r
41     static const char * MY_GUI_EVENT_ID("WorkshopFeatureLoaded");\r
42     return MY_GUI_EVENT_ID;\r
43   }\r
44   /// Event ID that feature is loaded in workbench (Model)\r
45   inline static const char* MODEL_EVENT()\r
46   {\r
47     static const char * MY_MODEL_EVENT_ID("ModelFeatureLoaded");\r
48     return MY_MODEL_EVENT_ID;\r
49   }\r
50 \r
51   /// Constructs Config_FeatureMessage\r
52   CONFIG_EXPORT Config_FeatureMessage(const Events_ID theId, const void* theParent = 0);\r
53   /// Deletes Config_FeatureMessage\r
54   CONFIG_EXPORT virtual ~Config_FeatureMessage();\r
55 \r
56   //Auto-generated getters/setters\r
57   /// Feature's Id\r
58   CONFIG_EXPORT const std::string& id() const;\r
59   /// Feature's Icon\r
60   CONFIG_EXPORT const std::string& icon() const;\r
61   /// Feature's shortcut\r
62   CONFIG_EXPORT const std::string& keysequence() const;\r
63   /// Feature's text\r
64   CONFIG_EXPORT const std::string& text() const;\r
65   /// Feature's tooltip\r
66   CONFIG_EXPORT const std::string& tooltip() const;\r
67   /// Id of Feature's Group\r
68   CONFIG_EXPORT const std::string& groupId() const;\r
69   /// Id of Feature's Workbench\r
70   CONFIG_EXPORT const std::string& workbenchId() const;\r
71   /// Kind of a document which contains the feature\r
72   CONFIG_EXPORT const std::string& documentKind() const;\r
73   /// Name of a library which contains the feature\r
74   CONFIG_EXPORT const std::string& pluginLibrary() const;\r
75   /// Comma separated list of nested features\r
76   CONFIG_EXPORT const std::string& nestedFeatures() const;\r
77   /// If false - feature has no Property panel representation\r
78   CONFIG_EXPORT bool isUseInput() const;\r
79   /// If true - feature will not be added into the workbench\r
80   CONFIG_EXPORT bool isInternal() const;\r
81 \r
82   ///Set feature's Id\r
83   CONFIG_EXPORT void setId(const std::string& id);\r
84   ///Set feature's Icon\r
85   CONFIG_EXPORT void setIcon(const std::string& icon);\r
86   ///Set feature's shortcut\r
87   CONFIG_EXPORT void setKeysequence(const std::string& keysequence);\r
88   ///Set feature's text\r
89   CONFIG_EXPORT void setText(const std::string& text);\r
90   ///Set feature's tooltip\r
91   CONFIG_EXPORT void setTooltip(const std::string& tooltip);\r
92   ///Set id of Feature's Group\r
93   CONFIG_EXPORT void setGroupId(const std::string& groupId);\r
94   ///Set id of Feature's Workbench\r
95   CONFIG_EXPORT void setWorkbenchId(const std::string& workbenchId);\r
96   ///Set kind of a document which contains the feature\r
97   CONFIG_EXPORT void setDocumentKind(const std::string& documentKind);\r
98   ///Set name of a library which contains the feature\r
99   CONFIG_EXPORT void setPluginLibrary(const std::string& thePluginLibrary);\r
100   ///Set comma separated list of nested features\r
101   CONFIG_EXPORT void setNestedFeatures(const std::string& theNestedFeatures);\r
102   ///Set use input state; If false - feature has no Property panel representation\r
103   CONFIG_EXPORT void setUseInput(bool isUseInput);\r
104   ///Set internal state; If true - feature will not be added into the workbench\r
105   CONFIG_EXPORT void setInternal(bool isInternal);\r
106 };\r
107 \r
108 #endif // CONFIG_MESSAGE_H\r