]> SALOME platform Git repositories - modules/shaper.git/blob - src/Config/Config_AttributeMessage.h
Salome HOME
7b2bd12b6014c223bd1f7161fd5ca4b5986706d4
[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
27  public:
28   /// Same event as Config_FeatureMessage::MODEL_EVENT()
29   inline static const char* MODEL_EVENT()
30   {
31     return Config_FeatureMessage::MODEL_EVENT();
32   }
33
34   /// Constructor
35   CONFIG_EXPORT Config_AttributeMessage(const Events_ID theId, const void* theParent = 0);
36   /// Destructor
37   CONFIG_EXPORT virtual ~Config_AttributeMessage();
38
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;
51
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);
62
63 };
64
65 #endif // ATTRIBUTE_MESSAGE_H