SHAPER  9.12.0
Config_AttributeMessage.h
1 // Copyright (C) 2014-2023 CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef ATTRIBUTE_MESSAGE_H
21 #define ATTRIBUTE_MESSAGE_H
22 
23 #include <Config_def.h>
24 #include <Config_FeatureMessage.h>
25 #include <Events_Message.h>
26 
27 #include <string>
28 #include <list>
29 
38 {
39  std::string myAttributeId;
40  std::string myFeatureId;
41  bool myIsObligatory;
42  bool myIsConcealment;
43  bool myIsMainArgument;
44  bool myIsGeometricalSelection;
46  std::list<std::pair<std::string, std::string> > myCases;
47 
48 public:
50  inline static const char* MODEL_EVENT()
51  {
53  }
54 
56  CONFIG_EXPORT Config_AttributeMessage(const Events_ID theId, const void* theParent = 0);
58  CONFIG_EXPORT virtual ~Config_AttributeMessage();
59 
60  //Auto-generated getters/setters
62  CONFIG_EXPORT const std::string& attributeId() const;
64  CONFIG_EXPORT const std::string& featureId() const;
67  CONFIG_EXPORT bool isObligatory() const;
69  CONFIG_EXPORT bool isConcealment() const;
71  CONFIG_EXPORT bool isMainArgument() const;
73  CONFIG_EXPORT bool isGeometricalSelection() const;
75  CONFIG_EXPORT const std::list<std::pair<std::string, std::string> >& getCases() const;
77  CONFIG_EXPORT void setCases(const std::list<std::pair<std::string, std::string> >& theCases);
78 
80  CONFIG_EXPORT void setAttributeId(const std::string& theId);
82  CONFIG_EXPORT void setFeatureId(const std::string& id);
84  CONFIG_EXPORT void setConcealment(bool isConcealment);
86  CONFIG_EXPORT void setObligatory(bool isObligatory);
88  CONFIG_EXPORT void setMainArgument(bool isMainArg);
90  CONFIG_EXPORT void setGeometricalSelection(bool isGeometricalSelection);
91 };
92 
93 #endif // ATTRIBUTE_MESSAGE_H
Class to pass an attribute's (widget's) entry info extracted from xml file.
Definition: Config_AttributeMessage.h:38
CONFIG_EXPORT void setConcealment(bool isConcealment)
Set attribute's concealment state.
Definition: Config_AttributeMessage.cpp:62
CONFIG_EXPORT bool isObligatory() const
Returns true if attribute is obligatory: Required to be set by user, else it's feature is invalid.
Definition: Config_AttributeMessage.cpp:67
CONFIG_EXPORT bool isMainArgument() const
Returns true if attribute is a main argument of the feature.
Definition: Config_AttributeMessage.cpp:88
CONFIG_EXPORT bool isGeometricalSelection() const
Returns true if attribute selects geometry instead of shape;.
Definition: Config_AttributeMessage.cpp:98
CONFIG_EXPORT const std::string & featureId() const
Returns attribute's feature's unique id.
Definition: Config_AttributeMessage.cpp:37
CONFIG_EXPORT const std::string & attributeId() const
Returns attribute's unique id.
Definition: Config_AttributeMessage.cpp:47
CONFIG_EXPORT void setObligatory(bool isObligatory)
Set attribute's obligatory state.
Definition: Config_AttributeMessage.cpp:72
virtual CONFIG_EXPORT ~Config_AttributeMessage()
Destructor.
Definition: Config_AttributeMessage.cpp:32
CONFIG_EXPORT void setFeatureId(const std::string &id)
Set attribute's feature's unique id.
Definition: Config_AttributeMessage.cpp:42
static const char * MODEL_EVENT()
Same event as Config_FeatureMessage::MODEL_EVENT()
Definition: Config_AttributeMessage.h:50
CONFIG_EXPORT void setAttributeId(const std::string &theId)
Set attribute's unique id.
Definition: Config_AttributeMessage.cpp:52
CONFIG_EXPORT bool isConcealment() const
Returns true if attribute should conceal input features.
Definition: Config_AttributeMessage.cpp:57
CONFIG_EXPORT const std::list< std::pair< std::string, std::string > > & getCases() const
Returns container of ids of pair of a case and switches.
Definition: Config_AttributeMessage.cpp:77
CONFIG_EXPORT Config_AttributeMessage(const Events_ID theId, const void *theParent=0)
Constructor.
Definition: Config_AttributeMessage.cpp:22
CONFIG_EXPORT void setGeometricalSelection(bool isGeometricalSelection)
Set attribute's geometrical selection state.
Definition: Config_AttributeMessage.cpp:103
CONFIG_EXPORT void setMainArgument(bool isMainArg)
Set a state that the attribute is a main argument of the feature.
Definition: Config_AttributeMessage.cpp:93
CONFIG_EXPORT void setCases(const std::list< std::pair< std::string, std::string > > &theCases)
Sets ids of pair of a case and switches.
Definition: Config_AttributeMessage.cpp:82
static const char * MODEL_EVENT()
Event ID that feature is loaded in workbench (Model)
Definition: Config_FeatureMessage.h:75
Identifier of the event kind.
Definition: Events_Message.h:36
Message for communication between sender and listener of event.
Definition: Events_Message.h:65