Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[modules/gui.git] / src / QDS / QDS.h
1 // Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, 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 #ifndef QDS_H
20 #define QDS_H
21
22 #ifdef WIN32
23 #ifdef QDS_EXPORTS
24 #define QDS_EXPORT __declspec(dllexport)
25 #else
26 #define QDS_EXPORT __declspec(dllimport)
27 #endif
28 #else
29 #define QDS_EXPORT
30 #endif
31
32 #if defined WIN32
33 #pragma warning ( disable:4251 )
34 #pragma warning ( disable:4786 )
35 #endif
36
37 #include <qstring.h>
38 #include <qvaluelist.h>
39
40 #include <TCollection_AsciiString.hxx>
41
42 #include <TCollection_ExtendedString.hxx>
43
44 class QDS_Datum;
45 class Handle(TCollection_HAsciiString);
46 class Handle(TCollection_HExtendedString);
47
48 class QDS_EXPORT QDS
49 {
50 public:
51   typedef enum { None = 0x00, Label = 0x01, Control = 0x02, Units = 0x04,
52                  NotFormat = 0x08, NotAccel = 0x10, UnitsWithLabel = 0x20,
53                  All = Label | Control | Units } DatumFlags;
54
55 public:
56   static bool                       load( const QString& );
57
58   static QString                    unitSystemLabel( const QString&,
59                                                      const QString& = QString::null );
60   static QString                    activeUnitSystem( const QString& = QString::null );
61   static void                       setActiveUnitSystem( const QString&,
62                                                          const QString& = QString::null );
63
64   static QString                    toQString( const TCollection_AsciiString& );
65   static QString                    toQString( const TCollection_ExtendedString& );
66   static QString                    toQString( const Handle(TCollection_HAsciiString)& );
67   static QString                    toQString( const Handle(TCollection_HExtendedString)& );
68
69   static TCollection_AsciiString    toAsciiString( const QString& );
70   static TCollection_AsciiString    toAsciiString( const TCollection_ExtendedString& );
71   static TCollection_AsciiString    toAsciiString( const Handle(TCollection_HExtendedString)& );
72
73   static TCollection_ExtendedString toExtString( const QString& );
74   static TCollection_ExtendedString toExtString( const TCollection_AsciiString& );
75
76 protected:
77   static void                       insertDatum( QDS_Datum* );
78   static void                       removeDatum( QDS_Datum* );
79
80 private:
81   static QValueList<QDS_Datum*>     _datumList;
82 };
83
84 #endif