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