]> SALOME platform Git repositories - modules/gui.git/blob - src/Qtx/QtxOperations.h
Salome HOME
a4a8524a910c99645520c807a599a26d5a86ec53
[modules/gui.git] / src / Qtx / QtxOperations.h
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/
18 //
19 // File:      QtxOperations.h
20 // Author:    Alexander SOLOVYOV
21
22 #ifndef __QTX_OPERATIONS_HEADER__
23 #define __QTX_OPERATIONS_HEADER__
24
25 #include "Qtx.h"
26 #include "QtxParser.h"
27
28 class QTX_EXPORT QtxOperations
29 {
30 public:
31     QtxOperations();
32     virtual ~QtxOperations();
33
34     virtual void  opersList( QStringList& ) const = 0;
35     //list of possible operations
36
37     virtual void  bracketsList( QStringList&, bool open ) const = 0;
38     //list of open/close brackets
39
40     virtual bool  createValue( const QString&, QtxValue& ) const;
41     //by default, the String value will be set, it corresponds to parameter
42     //base method returns false (always parameter)
43     //successor's method returns true if it has created custom value
44     //or call base if it hasn't
45
46     virtual int   prior( const QString&, bool isBin ) const = 0;
47     //returns prioritet of operation;
48     //if operation is impossible, it must return 0 or less
49
50     virtual QtxParser::Error isValid( const QString&,
51                                       const QVariant::Type,
52                                       const QVariant::Type ) const = 0;
53     //return OK if this parameter types is valid for operation
54     //return OperandsNotMatch or InvalidOperation otherwise
55
56     virtual QtxParser::Error calculate( const QString&, QtxValue&, QtxValue& ) const = 0;
57     //process binary operation with values
58     //for unary operation the second QtxValue will be passed as invalid
59 };
60
61 #endif