1 // Copyright (C) 2014-2019 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef PARAMETERSPLUGIN_VARIABLEVALIDATOR_H_
21 #define PARAMETERSPLUGIN_VARIABLEVALIDATOR_H_
23 #include <ParametersPlugin.h>
24 #include <ParametersPlugin_Validators.h>
26 #include <ModelAPI_AttributeValidator.h>
31 * \class ParametersPlugin_VariableValidator
33 * \brief Validator for the variable name of parameter.
35 class ParametersPlugin_VariableValidator : public ModelAPI_AttributeValidator
38 PARAMETERSPLUGIN_EXPORT ParametersPlugin_VariableValidator();
39 PARAMETERSPLUGIN_EXPORT virtual ~ParametersPlugin_VariableValidator();
42 * \brief Returns true if attribute has a valid parameter name.
43 * \param theAttribute the checked attribute
44 * \param theArguments arguments of the attribute
45 * \param theError the error string message if validation fails
47 PARAMETERSPLUGIN_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
48 const std::list<std::string>& theArguments,
49 Events_InfoMessage& theError) const;
52 /// Returns true if theString is unique parameter name in the document of theAttribute.
53 PARAMETERSPLUGIN_EXPORT bool isUnique(const AttributePtr& theAttribute,
54 const std::string& theString) const;
58 * \class ParametersPlugin_ExpressionValidator
60 * \brief Validator for the expression of parameter.
62 class ParametersPlugin_ExpressionValidator: public ModelAPI_AttributeValidator
65 PARAMETERSPLUGIN_EXPORT ParametersPlugin_ExpressionValidator();
66 PARAMETERSPLUGIN_EXPORT virtual ~ParametersPlugin_ExpressionValidator();
69 * \brief Returns true if attribute has a valid parameter expression.
70 * \param theAttribute the checked attribute
71 * \param theArguments arguments of the attribute
72 * \param theError the error string message if validation fails
74 PARAMETERSPLUGIN_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
75 const std::list<std::string>& theArguments,
76 Events_InfoMessage& theError) const;
80 #endif /* PARAMETERSPLUGIN_VARIABLEVALIDATOR_H_ */