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