Salome HOME
no message
[modules/gui.git] / src / Qtx / QtxOperations.h
1 // File:      QtxOperations.h
2 // Author:    Alexander SOLOVYOV
3
4 #ifndef __QTX_OPERATIONS_HEADER__
5 #define __QTX_OPERATIONS_HEADER__
6
7 #include "Qtx.h"
8 #include "QtxParser.h"
9
10 //================================================================
11 // Class    : 
12 // Purpose  : 
13 //================================================================
14 class QTX_EXPORT QtxOperations
15 {
16 public:
17     QtxOperations();
18     virtual ~QtxOperations();
19
20     virtual void  opersList( QStringList& ) const = 0;
21     //list of possible operations
22
23     virtual void  bracketsList( QStringList&, bool open ) const = 0;
24     //list of open/close brackets
25
26     virtual bool  createValue( const QString&, QtxValue& ) const;
27     //by default, the String value will be set, it corresponds to parameter
28     //base method returns false (always parameter)
29     //successor's method returns true if it has created custom value
30     //or call base if it hasn't
31
32     virtual int   prior( const QString&, bool isBin ) const = 0;
33     //returns prioritet of operation;
34     //if operation is impossible, it must return 0 or less
35
36     virtual QtxParser::Error isValid( const QString&,
37                                       const QVariant::Type,
38                                       const QVariant::Type ) const = 0;
39     //return OK if this parameter types is valid for operation
40     //return OperandsNotMatch or InvalidOperation otherwise
41
42     virtual QtxParser::Error calculate( const QString&, QtxValue&, QtxValue& ) const = 0;
43     //process binary operation with values
44     //for unary operation the second QtxValue will be passed as invalid
45 };
46
47 #endif