Salome HOME
Add copyright header according to request of CEA from 06.06.2017
[modules/shaper.git] / src / Config / Config_ValidatorMessage.h
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef CONFIG_VALIDATORMESSAGE_H_
22 #define CONFIG_VALIDATORMESSAGE_H_
23
24 #include <Events_Message.h>
25 #include <Config_def.h>
26
27 #include <list>
28 #include <string>
29
30 /// Event ID that Validator is loaded (comes with Config_ValidatorMessage)
31 static const char * EVENT_VALIDATOR_LOADED = "ValidatorLoaded";
32
33 /*!
34  * \class Config_ValidatorMessage
35  * \ingroup Config
36  * \brief Transmits info about created validator on "ValidatorLoaded" event
37  */
38 class Config_ValidatorMessage : public Events_Message
39 {
40   std::string myValidatorId;
41   std::string myFeatureId;
42   std::string myAttributeId;
43   std::list<std::string> myVaidatorParameters;
44
45  public:
46   /*!
47    * Constructor.
48    * \param theId - Events_ID of the message
49    * \param theParent - pointer to the sender
50    */
51   CONFIG_EXPORT Config_ValidatorMessage(const Events_ID theId, const void* theParent = 0);
52   CONFIG_EXPORT virtual ~Config_ValidatorMessage();
53
54   //! Get id of the filter
55   CONFIG_EXPORT const std::string& validatorId() const;
56   //! Get id of a feature to which the filter belongs to
57   CONFIG_EXPORT const std::string& featureId() const;
58   //! Get id of an attribute to which the filter belongs to
59   CONFIG_EXPORT const std::string& attributeId() const;
60   //! Get filter parameters
61   CONFIG_EXPORT const std::list<std::string>& parameters() const;
62   //! Returns true if validator id is not empty
63   CONFIG_EXPORT bool isValid() const;
64
65   //! Set id of the filter
66   CONFIG_EXPORT void setValidatorId(const std::string& theId);
67   //! Set id of a feature to which the filter belongs to
68   CONFIG_EXPORT void setFeatureId(const std::string& theId);
69   //! Set id of an attribute to which the filter belongs to
70   CONFIG_EXPORT void setAttributeId(const std::string& theId);
71   //! Get filter parameters
72   CONFIG_EXPORT void setValidatorParameters(const std::list<std::string>& parameters);
73 };
74
75 #endif /* Config_ValidatorMessage_H_ */