1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 #ifndef ATTRIBUTE_MESSAGE_H
4 #define ATTRIBUTE_MESSAGE_H
6 #include <Config_def.h>
7 #include <Config_FeatureMessage.h>
8 #include <Events_Message.h>
13 * \class Config_AttributeMessage
14 * \brief Class to pass an attribute's (widget's) entry info extracted from xml file.
16 * <widget id="tool_object" concealment="true" obligatory="0"/>
19 class Config_AttributeMessage : public Events_Message
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
27 /// Same event as Config_FeatureMessage::MODEL_EVENT()
28 inline static const char* MODEL_EVENT()
30 return Config_FeatureMessage::MODEL_EVENT();
34 CONFIG_EXPORT Config_AttributeMessage(const Events_ID theId, const void* theParent = 0);
36 CONFIG_EXPORT virtual ~Config_AttributeMessage();
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;
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);
59 #endif // ATTRIBUTE_MESSAGE_H