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
25 std::string myCaseId; ///< Attribute's case's id, if it placed inside a paged containers
28 /// Same event as Config_FeatureMessage::MODEL_EVENT()
29 inline static const char* MODEL_EVENT()
31 return Config_FeatureMessage::MODEL_EVENT();
35 CONFIG_EXPORT Config_AttributeMessage(const Events_ID theId, const void* theParent = 0);
37 CONFIG_EXPORT virtual ~Config_AttributeMessage();
39 //Auto-generated getters/setters
40 /// Returns attribute's unique id
41 CONFIG_EXPORT const std::string& attributeId() const;
42 /// Returns attribute's feature's unique id
43 CONFIG_EXPORT const std::string& featureId() const;
44 /// Returns true if attribute is obligatory:
45 /// Required to be set by user, else it's feature is invalid.
46 CONFIG_EXPORT bool isObligatory() const;
47 /// Returns true if attribute should conceal input features
48 CONFIG_EXPORT bool isConcealment() const;
49 /// Returns id of a case which contain the attribute
50 CONFIG_EXPORT const std::string& caseId() const;
52 /// Set attribute's unique id
53 CONFIG_EXPORT void setAttributeId(const std::string& theId);
54 /// Set attribute's feature's unique id
55 CONFIG_EXPORT void setFeatureId(const std::string& id);
56 /// Set attribute's concealment state
57 CONFIG_EXPORT void setConcealment(bool isConcealment);
58 /// Set attribute's obligatory state
59 CONFIG_EXPORT void setObligatory(bool isObligatory);
60 /// Set attribute's case
61 CONFIG_EXPORT void setCaseId(const std::string& id);
65 #endif // ATTRIBUTE_MESSAGE_H