1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
\r
3 #ifndef CONFIG_MESSAGE_H
\r
4 #define CONFIG_MESSAGE_H
\r
6 #include <Config_def.h>
\r
7 #include <Events_Message.h>
\r
12 * \class Config_FeatureMessage
\r
14 * \brief Class to pass a feature entry extracted from xml file.
\r
15 * Example of the feature entry:
\r
17 * <feature id="Part" text="New part" tooltip="Creates a new part" icon=":pictures/part_ico.png"/>
\r
20 class Config_FeatureMessage : public Events_Message
\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
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
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; ///<Space separated list of child features
\r
36 std::string myActionsWhenNested; ///<Space separated list of actions
\r
39 /// Event ID that feature is loaded in workbench (GUI)
\r
40 inline static const char* GUI_EVENT()
\r
42 static const char * MY_GUI_EVENT_ID("WorkshopFeatureLoaded");
\r
43 return MY_GUI_EVENT_ID;
\r
45 /// Event ID that feature is loaded in workbench (Model)
\r
46 inline static const char* MODEL_EVENT()
\r
48 static const char * MY_MODEL_EVENT_ID("ModelFeatureLoaded");
\r
49 return MY_MODEL_EVENT_ID;
\r
52 /// Constructs Config_FeatureMessage
\r
53 CONFIG_EXPORT Config_FeatureMessage(const Events_ID theId, const void* theParent = 0);
\r
54 /// Deletes Config_FeatureMessage
\r
55 CONFIG_EXPORT virtual ~Config_FeatureMessage();
\r
57 //Auto-generated getters/setters
\r
59 CONFIG_EXPORT const std::string& id() const;
\r
61 CONFIG_EXPORT const std::string& icon() const;
\r
62 /// Feature's shortcut
\r
63 CONFIG_EXPORT const std::string& keysequence() const;
\r
65 CONFIG_EXPORT const std::string& text() const;
\r
66 /// Feature's tooltip
\r
67 CONFIG_EXPORT const std::string& tooltip() const;
\r
68 /// Id of Feature's Group
\r
69 CONFIG_EXPORT const std::string& groupId() const;
\r
70 /// Id of Feature's Workbench
\r
71 CONFIG_EXPORT const std::string& workbenchId() const;
\r
72 /// Kind of a document which contains the feature
\r
73 CONFIG_EXPORT const std::string& documentKind() const;
\r
74 /// Name of a library which contains the feature
\r
75 CONFIG_EXPORT const std::string& pluginLibrary() const;
\r
76 /// Space separated list of nested features
\r
77 CONFIG_EXPORT const std::string& nestedFeatures() const;
\r
78 /// Space separated list of actions
\r
79 CONFIG_EXPORT const std::string& actionsWhenNested() const;
\r
80 /// If false - feature has no Property panel representation
\r
81 CONFIG_EXPORT bool isUseInput() const;
\r
82 /// If true - feature will not be added into the workbench
\r
83 CONFIG_EXPORT bool isInternal() const;
\r
86 CONFIG_EXPORT void setId(const std::string& id);
\r
87 ///Set feature's Icon
\r
88 CONFIG_EXPORT void setIcon(const std::string& icon);
\r
89 ///Set feature's shortcut
\r
90 CONFIG_EXPORT void setKeysequence(const std::string& keysequence);
\r
91 ///Set feature's text
\r
92 CONFIG_EXPORT void setText(const std::string& text);
\r
93 ///Set feature's tooltip
\r
94 CONFIG_EXPORT void setTooltip(const std::string& tooltip);
\r
95 ///Set id of Feature's Group
\r
96 CONFIG_EXPORT void setGroupId(const std::string& groupId);
\r
97 ///Set id of Feature's Workbench
\r
98 CONFIG_EXPORT void setWorkbenchId(const std::string& workbenchId);
\r
99 ///Set kind of a document which contains the feature
\r
100 CONFIG_EXPORT void setDocumentKind(const std::string& documentKind);
\r
101 ///Set name of a library which contains the feature
\r
102 CONFIG_EXPORT void setPluginLibrary(const std::string& thePluginLibrary);
\r
103 ///Set space separated list of nested features
\r
104 CONFIG_EXPORT void setNestedFeatures(const std::string& theNestedFeatures);
\r
105 ///Set space separated list of nested features
\r
106 CONFIG_EXPORT void setActionsWhenNested(const std::string& theActions);
\r
107 ///Set use input state; If false - feature has no Property panel representation
\r
108 CONFIG_EXPORT void setUseInput(bool isUseInput);
\r
109 ///Set internal state; If true - feature will not be added into the workbench
\r
110 CONFIG_EXPORT void setInternal(bool isInternal);
\r
113 #endif // CONFIG_MESSAGE_H
\r