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