Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[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/ or email : webmaster.salome@opencascade.com
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    /*! Enum describes bit flags of the Qt datum view and behaviour */
52   typedef enum
53   {
54     None = 0x00,                   //!< Non specified any flags (Default behaviour)
55     Label = 0x01,                  //!< Create subwidget for datum label
56     Control = 0x02,                //!< Create subwidget for datum input control
57     Units = 0x04,                  //!< Create subwidget for datum units of measure
58     NotFormat = 0x08,              //!< Don't format initial value
59     NotAccel = 0x10,               //!< Not support accelerators in datum label
60     UnitsWithLabel = 0x20,         //!< Display units of measure in label like "<label_text> (<units_text>) instead separate text"
61     All = Label | Control | Units  //!< Create all subwidgets
62   } DatumFlags;
63
64 public:
65   static bool                       load( const QString& );
66
67   static QString                    unitSystemLabel( const QString&,
68                                                      const QString& = QString::null );
69   static QString                    activeUnitSystem( const QString& = QString::null );
70   static void                       setActiveUnitSystem( const QString&,
71                                                          const QString& = QString::null );
72
73   static QString                    toQString( const TCollection_AsciiString& );
74   static QString                    toQString( const TCollection_ExtendedString& );
75   static QString                    toQString( const Handle(TCollection_HAsciiString)& );
76   static QString                    toQString( const Handle(TCollection_HExtendedString)& );
77
78   static TCollection_AsciiString    toAsciiString( const QString& );
79   static TCollection_AsciiString    toAsciiString( const TCollection_ExtendedString& );
80   static TCollection_AsciiString    toAsciiString( const Handle(TCollection_HExtendedString)& );
81
82   static TCollection_ExtendedString toExtString( const QString& );
83   static TCollection_ExtendedString toExtString( const TCollection_AsciiString& );
84
85 protected:
86   static void                       insertDatum( QDS_Datum* );
87   static void                       removeDatum( QDS_Datum* );
88
89 private:
90   static QValueList<QDS_Datum*>     _datumList;
91 };
92
93 #endif