Salome HOME
Join modifications from branch BR_PR_V320b1
[modules/kernel.git] / src / SALOMEDSClient / SALOMEDSClient_IParameters.hxx
1 // Copyright (C) 2006  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA 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.
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/
18 //
19 #ifndef SALOMEDSClient_IParameters_H
20 #define SALOMEDSClient_IParameters_H
21
22 #include <string>
23 #include <vector>
24 #include <map>
25
26 #include "SALOMEDSClient_definitions.hxx"
27 #include "SALOMEDSClient_AttributeParameter.hxx"
28
29 /*! 
30   Class which an interface to store the parameters of the objects
31 */
32 class SALOMEDSClient_IParameters
33 {
34 public:
35   
36    virtual ~SALOMEDSClient_IParameters() {}
37
38   /*!
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
42    */
43   virtual int append(const std::string& listName, const std::string& value) = 0; 
44
45   /*!
46     Returns a number elements in the list
47    */
48   virtual int nbValues(const std::string& listName) = 0;
49
50   /*!
51     Returns a list of values in the list
52    */
53   virtual std::vector<std::string> getValues(const std::string& listName) = 0;
54
55   /*!
56     Returns a value with given %index, where %index is in range [0:nbValues-1]
57    */
58   virtual std::string getValue(const std::string& listName, int index) = 0;
59
60   /*!
61     Returns a list all entries lists
62    */
63   virtual std::vector<std::string> getLists() = 0;
64
65   /*!
66     Sets a new named parameter value for the given entry
67    */
68   virtual void setParameter(const std::string& entry, const std::string& parameterName, const std::string& value) = 0;
69
70   /*!
71     Gets a named parameter value for the given entry
72    */
73   virtual std::string getParameter(const std::string& entry, const std::string& parameterName) = 0;
74
75   /*!
76     Returns all parameter names of the given entry
77    */
78   virtual std::vector<std::string> getAllParameterNames(const std::string& entry) = 0;
79
80   /*!
81     Returns all parameter  values of the given entry
82    */
83   virtual std::vector<std::string> getAllParameterValues(const std::string& entry) = 0;
84
85   /*!
86     Returns a number of parameters of the given entry
87    */
88   virtual int getNbParameters(const std::string& entry) = 0;
89
90   /*!
91     Returns a list all entries 
92    */
93   virtual std::vector<std::string> getEntries() = 0;
94
95   /*!
96     Sets a global named property value
97    */
98   virtual void setProperty(const std::string& name, const std::string& value) = 0;
99
100   /*!
101     Gets a value of global named property
102    */
103   virtual std::string getProperty(const std::string& name) = 0;
104
105   /*!
106     Returns a list all properties 
107    */
108   virtual std::vector<std::string> getProperties() = 0;
109
110   /*!
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
113    */
114   virtual std::vector<std::string> parseValue(const std::string& value, const char separator, bool fromEnd = true) = 0;
115
116
117   /*!
118     Returns encoded entry that is a relative entry for the component
119    */
120   virtual std::string encodeEntry(const std::string& entry, const std::string& compName) = 0;
121
122   /*!
123     Returns decoded entry that is an absolute entry
124    */
125   virtual std::string decodeEntry(const std::string& entry) = 0;
126
127   /*!
128     Enables/Disables the dumping visual parameters, static implementation is supposed
129    */
130   virtual void setDumpPython(_PTR(Study) study, const std::string& theID = "") = 0;
131
132   /*!
133     Returns whether there is the dumping visual parameters, static implementation is supposed
134    */
135   virtual bool isDumpPython(_PTR(Study) study, const std::string& theID = "") = 0;  
136
137   /*!
138     Returns a default name of the component where the visula parameters are stored.
139     Static implementation is supposed
140   */
141   virtual std::string getDefaultVisualComponent() = 0;
142
143 };
144
145
146 #endif