]> SALOME platform Git repositories - modules/gui.git/blob - src/Qtx/QtxListOfOperations.h
Salome HOME
3e1a711f14aa91bce2fc95f4a2c6293c299cf300
[modules/gui.git] / src / Qtx / QtxListOfOperations.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:      QtxListOfOperations.h
20 // Author:    Alexander SOLOVYOV
21
22 #ifndef __QTX_LIST_OF_OPERATIONS_HEADER__
23 #define __QTX_LIST_OF_OPERATIONS_HEADER__
24
25 #include "Qtx.h"
26 #include "QtxOperations.h"
27
28 #ifdef WIN32
29 #pragma warning( disable:4251 )
30 #endif
31
32
33 //================================================================
34 // Class    : 
35 // Purpose  : 
36 //================================================================
37 class QTX_EXPORT QtxListOfOperations : public QtxOperations
38 {
39 public:
40     QtxListOfOperations();
41     virtual ~QtxListOfOperations();
42
43     virtual void  opersList( QStringList& ) const;
44     virtual void  bracketsList( QStringList&, bool open ) const;
45
46     virtual bool  createValue( const QString&, QtxValue& ) const;
47     virtual int   prior    ( const QString&, bool isBin ) const;
48     virtual QtxParser::Error isValid( const QString&,
49                                       const QVariant::Type,
50                                       const QVariant::Type ) const;
51     virtual QtxParser::Error calculate( const QString&, QtxValue&, QtxValue& ) const;
52
53     void clear  ();
54     bool has    ( const QString& ) const;
55     void append ( const QString&, QtxOperations*, int prior );
56     void prepend( const QString&, QtxOperations*, int prior );
57     void insert ( const QString&, QtxOperations*, int prior, int pos = -1 );
58     void remove ( const QString& );
59     int  count  () const;
60     QtxOperations* operations( const QString& ) const;
61
62 private:
63     typedef struct
64     {
65         QString        myName;
66         QtxOperations* myOperations;
67         int            myAddPrior;
68
69     } OperationSet;
70
71     typedef QValueList< OperationSet >     OperationSets;
72     typedef OperationSets::const_iterator  OperationSetsIterator;
73
74     OperationSets mySets;
75 };
76
77 #endif