1 // Copyright (C) 2014-2017 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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef PARAMETERSPLUGIN_VARIABLEVALIDATOR_H_
22 #define PARAMETERSPLUGIN_VARIABLEVALIDATOR_H_
24 #include <ParametersPlugin.h>
25 #include <ParametersPlugin_Validators.h>
27 #include <ModelAPI_AttributeValidator.h>
32 * \class ParametersPlugin_VariableValidator
34 * \brief Validator for the variable name of parameter.
36 class ParametersPlugin_VariableValidator : public ModelAPI_AttributeValidator
39 PARAMETERSPLUGIN_EXPORT ParametersPlugin_VariableValidator();
40 PARAMETERSPLUGIN_EXPORT virtual ~ParametersPlugin_VariableValidator();
43 * \brief Returns true if attribute has a valid parameter name.
44 * \param theAttribute the checked attribute
45 * \param theArguments arguments of the attribute
46 * \param theError the error string message if validation fails
48 PARAMETERSPLUGIN_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
49 const std::list<std::string>& theArguments,
50 Events_InfoMessage& theError) const;
53 /// Returns true if theString is unique parameter name in the document of theAttribute.
54 PARAMETERSPLUGIN_EXPORT bool isUnique(const AttributePtr& theAttribute,
55 const std::string& theString) const;
59 * \class ParametersPlugin_ExpressionValidator
61 * \brief Validator for the expression of parameter.
63 class ParametersPlugin_ExpressionValidator: public ModelAPI_AttributeValidator
66 PARAMETERSPLUGIN_EXPORT ParametersPlugin_ExpressionValidator();
67 PARAMETERSPLUGIN_EXPORT virtual ~ParametersPlugin_ExpressionValidator();
70 * \brief Returns true if attribute has a valid parameter expression.
71 * \param theAttribute the checked attribute
72 * \param theArguments arguments of the attribute
73 * \param theError the error string message if validation fails
75 PARAMETERSPLUGIN_EXPORT virtual bool isValid(const AttributePtr& theAttribute,
76 const std::list<std::string>& theArguments,
77 Events_InfoMessage& theError) const;
81 #endif /* PARAMETERSPLUGIN_VARIABLEVALIDATOR_H_ */