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