Salome HOME
Initial version
[modules/gui.git] / src / Qtx / QtxListOfOperations.h
1 // File:      QtxListOfOperations.h
2 // Author:    Alexander SOLOVYOV
3
4 #ifndef __QTX_LIST_OF_OPERATIONS_HEADER__
5 #define __QTX_LIST_OF_OPERATIONS_HEADER__
6
7 #include "Qtx.h"
8 #include "QtxOperations.h"
9
10 #ifdef WIN32
11 #pragma warning( disable:4251 )
12 #endif
13
14
15 //================================================================
16 // Class    : 
17 // Purpose  : 
18 //================================================================
19 class QTX_EXPORT QtxListOfOperations : public QtxOperations
20 {
21 public:
22     QtxListOfOperations();
23     virtual ~QtxListOfOperations();
24
25     virtual void  opersList( QStringList& ) const;
26     virtual void  bracketsList( QStringList&, bool open ) const;
27
28     virtual bool  createValue( const QString&, QtxValue& ) const;
29     virtual int   prior    ( const QString&, bool isBin ) const;
30     virtual QtxParser::Error isValid( const QString&,
31                                       const QVariant::Type,
32                                       const QVariant::Type ) const;
33     virtual QtxParser::Error calculate( const QString&, QtxValue&, QtxValue& ) const;
34
35     void clear  ();
36     bool has    ( const QString& ) const;
37     void append ( const QString&, QtxOperations*, int prior );
38     void prepend( const QString&, QtxOperations*, int prior );
39     void insert ( const QString&, QtxOperations*, int prior, int pos = -1 );
40     void remove ( const QString& );
41     int  count  () const;
42     QtxOperations* operations( const QString& ) const;
43
44 private:
45     typedef struct
46     {
47         QString        myName;
48         QtxOperations* myOperations;
49         int            myAddPrior;
50
51     } OperationSet;
52
53     typedef QValueList< OperationSet >     OperationSets;
54     typedef OperationSets::const_iterator  OperationSetsIterator;
55
56     OperationSets mySets;
57 };
58
59 #endif