Salome HOME
Validators return InfoMessage instead of string as an error
[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   bool myModal;     ///<True if the feature has to be represented by modal dialog box\r
36   bool myIsAutoPreview; ///< Preview computation is performed automatically\r
37 \r
38   std::string myNestedFeatures; ///<Space separated list of child features\r
39   std::string myActionsWhenNested; ///<Space separated list of actions\r
40 \r
41  public:\r
42   /// Event ID that feature is loaded in workbench (GUI)\r
43   inline static const char* GUI_EVENT()\r
44   {\r
45     static const char * MY_GUI_EVENT_ID("WorkshopFeatureLoaded");\r
46     return MY_GUI_EVENT_ID;\r
47   }\r
48   /// Event ID that feature is loaded in workbench (Model)\r
49   inline static const char* MODEL_EVENT()\r
50   {\r
51     static const char * MY_MODEL_EVENT_ID("ModelFeatureLoaded");\r
52     return MY_MODEL_EVENT_ID;\r
53   }\r
54 \r
55   /// Constructs Config_FeatureMessage\r
56   CONFIG_EXPORT Config_FeatureMessage(const Events_ID theId, const void* theParent = 0);\r
57   /// Deletes Config_FeatureMessage\r
58   CONFIG_EXPORT virtual ~Config_FeatureMessage();\r
59 \r
60   //Auto-generated getters/setters\r
61   /// Feature's Id\r
62   CONFIG_EXPORT const std::string& id() const;\r
63   /// Feature's Icon\r
64   CONFIG_EXPORT const std::string& icon() const;\r
65   /// Feature's shortcut\r
66   CONFIG_EXPORT const std::string& keysequence() const;\r
67   /// Feature's text\r
68   CONFIG_EXPORT const std::string& text() const;\r
69   /// Feature's tooltip\r
70   CONFIG_EXPORT const std::string& tooltip() const;\r
71   /// Id of Feature's Group\r
72   CONFIG_EXPORT const std::string& groupId() const;\r
73   /// Id of Feature's Workbench\r
74   CONFIG_EXPORT const std::string& workbenchId() const;\r
75   /// Kind of a document which contains the feature\r
76   CONFIG_EXPORT const std::string& documentKind() const;\r
77   /// Name of a library which contains the feature\r
78   CONFIG_EXPORT const std::string& pluginLibrary() const;\r
79   /// Space separated list of nested features\r
80   CONFIG_EXPORT const std::string& nestedFeatures() const;\r
81   /// Space separated list of actions\r
82   CONFIG_EXPORT const std::string& actionsWhenNested() const;\r
83   /// If false - feature has no Property panel representation\r
84   CONFIG_EXPORT bool isUseInput() const;\r
85   /// If true - feature will not be added into the workbench\r
86   CONFIG_EXPORT bool isInternal() const;\r
87   /// If true - the feature will be represented by modal dialog box GUI\r
88   CONFIG_EXPORT bool isModal() const;\r
89 \r
90   /// If true - preview of the feature is done by any modification of the feature attributes\r
91   CONFIG_EXPORT bool isAutoPreview() const;\r
92 \r
93   ///Set feature's Id\r
94   CONFIG_EXPORT void setId(const std::string& id);\r
95   ///Set feature's Icon\r
96   CONFIG_EXPORT void setIcon(const std::string& icon);\r
97   ///Set feature's shortcut\r
98   CONFIG_EXPORT void setKeysequence(const std::string& keysequence);\r
99   ///Set feature's text\r
100   CONFIG_EXPORT void setText(const std::string& text);\r
101   ///Set feature's tooltip\r
102   CONFIG_EXPORT void setTooltip(const std::string& tooltip);\r
103   ///Set id of Feature's Group\r
104   CONFIG_EXPORT void setGroupId(const std::string& groupId);\r
105   ///Set id of Feature's Workbench\r
106   CONFIG_EXPORT void setWorkbenchId(const std::string& workbenchId);\r
107   ///Set kind of a document which contains the feature\r
108   CONFIG_EXPORT void setDocumentKind(const std::string& documentKind);\r
109   ///Set name of a library which contains the feature\r
110   CONFIG_EXPORT void setPluginLibrary(const std::string& thePluginLibrary);\r
111   ///Set space separated list of nested features\r
112   CONFIG_EXPORT void setNestedFeatures(const std::string& theNestedFeatures);\r
113   ///Set space separated list of nested features\r
114   CONFIG_EXPORT void setActionsWhenNested(const std::string& theActions);\r
115   ///Set use input state; If false - feature has no Property panel representation\r
116   CONFIG_EXPORT void setUseInput(bool isUseInput);\r
117   ///Set internal state; If true - feature will not be added into the workbench\r
118   CONFIG_EXPORT void setInternal(bool isInternal);\r
119   ///Set auto preview state; If true - preview of the feature is computed automatically\r
120   CONFIG_EXPORT void setAutoPreview(bool isAutoPreview);\r
121   ///Set modality state; If true - the feature will be represented by modal dialog box GUI\r
122   CONFIG_EXPORT void setModal(bool isModal);\r
123 };\r
124 \r
125 #endif // CONFIG_MESSAGE_H\r