Salome HOME
Documentation for config module updated
[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
26  public:
27   /// Same event as Config_FeatureMessage::MODEL_EVENT()
28   inline static const char* MODEL_EVENT()
29   {
30     return Config_FeatureMessage::MODEL_EVENT();
31   }
32
33   /// Constructor
34   CONFIG_EXPORT Config_AttributeMessage(const Events_ID theId, const void* theParent = 0);
35   /// Destructor
36   CONFIG_EXPORT virtual ~Config_AttributeMessage();
37
38   //Auto-generated getters/setters
39   /// Returns attribute's unique id
40   CONFIG_EXPORT const std::string& attributeId() const;
41   /// Returns attribute's feature's unique id
42   CONFIG_EXPORT const std::string& featureId() const;
43   /// Returns true if attribute is obligatory:
44   /// Required to be set by user, else it's feature is invalid.
45   CONFIG_EXPORT bool isObligatory() const;
46   /// Returns true if attribute should conceal input features
47   CONFIG_EXPORT bool isConcealment() const;
48
49   /// Set attribute's unique id
50   CONFIG_EXPORT void setAttributeId(const std::string& theId);
51   /// Set attribute's feature's unique id
52   CONFIG_EXPORT void setFeatureId(const std::string& id);
53   /// Returns attribute's concealment state
54   CONFIG_EXPORT void setConcealment(bool isConcealment);
55   /// Returns attribute's obligatory state
56   CONFIG_EXPORT void setObligatory(bool isObligatory);
57 };
58
59 #endif // ATTRIBUTE_MESSAGE_H