Salome HOME
Send switch id in a attribute message as the case id
[modules/shaper.git] / src / Config / Config_AttributeMessage.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 #ifndef ATTRIBUTE_MESSAGE_H
4 #define ATTRIBUTE_MESSAGE_H
5
6 #include <Config_def.h>
7 #include <Config_FeatureMessage.h>
8 #include <Events_Message.h>
9
10 #include <string>
11
12 /*!
13  * \class Config_AttributeMessage
14  * \brief Class to pass an attribute's (widget's) entry info extracted from xml file.
15  * \code
16  * <widget id="tool_object" concealment="true" obligatory="0"/>
17  * \endcode
18  */
19 class Config_AttributeMessage : public Events_Message
20 {
21   std::string myAttributeId; ///< Attribute's unique id
22   std::string myFeatureId; ///< Attribute's feature's unique id
23   bool myIsObligatory; ///< Required to be set by user, else it's feature is invalid.
24   bool myIsConcealment; ///< If true, conceals features used as input
25   std::string myCaseId; ///< Attribute's case's id, if it placed inside a paged containers
26   std::string mySwitchId; ///< Attribute's switch id, if it placed inside a paged containers
27
28  public:
29   /// Same event as Config_FeatureMessage::MODEL_EVENT()
30   inline static const char* MODEL_EVENT()
31   {
32     return Config_FeatureMessage::MODEL_EVENT();
33   }
34
35   /// Constructor
36   CONFIG_EXPORT Config_AttributeMessage(const Events_ID theId, const void* theParent = 0);
37   /// Destructor
38   CONFIG_EXPORT virtual ~Config_AttributeMessage();
39
40   //Auto-generated getters/setters
41   /// Returns attribute's unique id
42   CONFIG_EXPORT const std::string& attributeId() const;
43   /// Returns attribute's feature's unique id
44   CONFIG_EXPORT const std::string& featureId() const;
45   /// Returns true if attribute is obligatory:
46   /// Required to be set by user, else it's feature is invalid.
47   CONFIG_EXPORT bool isObligatory() const;
48   /// Returns true if attribute should conceal input features
49   CONFIG_EXPORT bool isConcealment() const;
50   /// Returns id of a case which contain the attribute
51   CONFIG_EXPORT const std::string& caseId() const;
52   /// Returns id of a switch which contain the attribute
53   CONFIG_EXPORT const std::string& switchId() const;
54
55   /// Set attribute's unique id
56   CONFIG_EXPORT void setAttributeId(const std::string& theId);
57   /// Set attribute's feature's unique id
58   CONFIG_EXPORT void setFeatureId(const std::string& id);
59   /// Set attribute's concealment state
60   CONFIG_EXPORT void setConcealment(bool isConcealment);
61   /// Set attribute's obligatory state
62   CONFIG_EXPORT void setObligatory(bool isObligatory);
63   /// Set attribute's case
64   CONFIG_EXPORT void setCaseId(const std::string& id);
65   /// Set attribute's switch
66   CONFIG_EXPORT void setSwitchId(const std::string& id);
67 };
68
69 #endif // ATTRIBUTE_MESSAGE_H