1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA 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.
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/
19 #ifndef SALOMEDS_IParameters_H
20 #define SALOMEDS_IParameters_H
26 #include "SALOMEDSClient.hxx"
29 Class which an interface to store the parameters of the objects
31 class SALOMEDS_IParameters
34 SALOMEDS_IParameters(const _PTR(AttributeParameter)& ap);
36 virtual ~SALOMEDS_IParameters();
39 Appends a string value to a named list.
40 Returns a number of the added value.
41 Note: the name of the list MUST be unique
43 virtual int append(const std::string& listName, const std::string& value);
46 Returns a number elements in the list
48 virtual int nbValues(const std::string& listName);
51 Returns a list of values in the list
53 virtual std::vector<std::string> getValues(const std::string& listName);
56 Returns a value with given %index, where %index is in range [0:nbValues-1]
58 virtual std::string getValue(const std::string& listName, int index);
61 Returns a list all entries lists
63 virtual std::vector<std::string> getLists();
66 Sets a new named parameter value for the given entry
68 virtual void setParameter(const std::string& entry, const std::string& parameterName, const std::string& value);
71 Gets a named parameter value for the given entry
73 virtual std::string getParameter(const std::string& entry, const std::string& parameterName);
76 Returns all parameter names of the given entry
78 virtual std::vector<std::string> getAllParameterNames(const std::string& entry);
81 Returns all parameter values of the given entry
83 virtual std::vector<std::string> getAllParameterValues(const std::string& entry);
86 Returns a number of parameters of the given entry
88 virtual int getNbParameters(const std::string& entry);
91 Returns a list all entries
93 virtual std::vector<std::string> getEntries();
96 Sets a global named property value
98 virtual void setProperty(const std::string& name, const std::string& value);
101 Gets a value of global named property
103 virtual std::string getProperty(const std::string& name);
106 Returns a list all properties
108 virtual std::vector<std::string> getProperties();
111 Breaks a value string in two parts which is divided by %separator.
112 If fromEnd is True the search of separator starts from the end of the string
114 virtual std::vector<std::string> parseValue(const std::string& value, const char separator, bool fromEnd = true);
118 Returns encoded entry that is a relative entry for the component
120 virtual std::string encodeEntry(const std::string& entry, const std::string& compName);
123 Returns decoded entry that is an absolute entry
125 virtual std::string decodeEntry(const std::string& entry);
128 Enables/Disables the dumping visual parameters
130 static void setDumpPython(_PTR(Study) study, const std::string& theID = "");
133 Returns whether there is the dumping visual parameters
135 static bool isDumpPython(_PTR(Study) study, const std::string& theID = "");
138 Returns a default name of the component where the visula parameters are stored.
140 static std::string getDefaultVisualComponent();
143 _PTR(AttributeParameter) _ap;
145 std::map<std::string, std::string> _compNames;