Back to index

salome-gui  6.5.0
QDS.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 #ifndef QDS_H
00024 #define QDS_H
00025 
00026 #ifdef WIN32
00027 #if defined QDS_EXPORTS
00028 #define QDS_EXPORT __declspec(dllexport)
00029 #else
00030 #define QDS_EXPORT __declspec(dllimport)
00031 #endif
00032 #else
00033 #define QDS_EXPORT
00034 #endif
00035 
00036 #if defined WIN32
00037 #pragma warning ( disable:4251 )
00038 #pragma warning ( disable:4786 )
00039 #endif
00040 
00041 #include <QString>
00042 #include <QList>
00043 
00044 #include <TCollection_ExtendedString.hxx>
00045 
00046 class QDS_Datum;
00047 class Handle(TCollection_HAsciiString);
00048 class Handle(TCollection_HExtendedString);
00049 
00050 class QDS_EXPORT QDS
00051 {
00052 public:
00054   typedef enum
00055   {
00056     None           = 0x00,         
00057     Label          = 0x01,         
00058     Control        = 0x02,         
00059     Units          = 0x04,         
00060     NotFormat      = 0x08,         
00061     NotAccel       = 0x10,         
00062     NotConvert     = 0x20,         
00063     UnitsWithLabel = 0x40,         
00064     All = Label | Control | Units  
00065   } DatumFlags;
00066 
00067 public:
00068   static bool                       load( const QString& );
00069 
00070   static QString                    unitSystemLabel( const QString&,
00071                                                      const QString& = QString() );
00072   static QString                    activeUnitSystem( const QString& = QString() );
00073   static void                       setActiveUnitSystem( const QString&,
00074                                                          const QString& = QString() );
00075 
00076   static QString                    toQString( const TCollection_AsciiString& );
00077   static QString                    toQString( const TCollection_ExtendedString& );
00078   static QString                    toQString( const Handle(TCollection_HAsciiString)& );
00079   static QString                    toQString( const Handle(TCollection_HExtendedString)& );
00080 
00081   static TCollection_AsciiString    toAsciiString( const QString& );
00082   static TCollection_AsciiString    toAsciiString( const TCollection_ExtendedString& );
00083   static TCollection_AsciiString    toAsciiString( const Handle(TCollection_HExtendedString)& );
00084 
00085   static TCollection_ExtendedString toExtString( const QString& );
00086   static TCollection_ExtendedString toExtString( const TCollection_AsciiString& );
00087 
00088 protected:
00089   static void                       insertDatum( QDS_Datum* );
00090   static void                       removeDatum( QDS_Datum* );
00091 
00092 private:
00093   static QList<QDS_Datum*>          _datumList;
00094 };
00095 
00096 #endif