Salome HOME
Base implementation of Notebook
[modules/kernel.git] / src / Notebook / SALOME_EvalExpr.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //  File   : SALOME_EvalExpr.hxx
23 //  Author : Peter KURNEV
24 //  Module : SALOME
25
26 #ifndef SALOME_EvalExpr_Header_File
27 #define SALOME_EvalExpr_Header_File
28
29 #include <SALOME_Eval.hxx>
30 #include <SALOME_EvalVariant.hxx>
31 #include <SALOME_EvalParser.hxx>
32 #include <SALOME_EvalSet.hxx>
33
34 class SALOME_EvalExpr
35 {
36 public:
37   SALOME_EvalExpr(const SALOME_String& = SALOME_String());
38   SALOME_EvalExpr( const bool, const SALOME_String& = SALOME_String() );
39   ~SALOME_EvalExpr();
40
41   SALOME_EvalVariant   calculate( const SALOME_String& = SALOME_String() );
42
43   SALOME_String        expression() const;
44   void                 setExpression( const SALOME_String& );
45
46   SALOME_EvalExprError error() const;
47   SALOME_EvalParser*   parser() const;
48
49   bool                 autoDeleteOperationSets() const;
50   void                 setAutoDeleteOperationSets( const bool );
51
52   SALOME_ListOfEvalSet operationSets() const;
53   SALOME_EvalSet*      operationSet( const SALOME_String& ) const;
54   void                 removeOperationSet( SALOME_EvalSet* );
55   void                 insertOperationSet( SALOME_EvalSet*, const int = -1 );
56
57 private:
58   void initialize( const bool, const SALOME_String& );
59
60 private:
61   SALOME_String      myExpr;
62   SALOME_EvalParser* myParser;
63 };
64
65 #endif