Salome HOME
Idents adjusted
[modules/gui.git] / src / Qtx / Qtx.h
1 // File:      Qtx.h
2 // Author:    Sergey TELKOV
3
4 #ifndef QTX_H
5 #define QTX_H
6
7 #if defined QTX_EXPORTS
8 #if defined WIN32
9 #define QTX_EXPORT _declspec( dllexport )
10 #else
11 #define QTX_EXPORT  
12 #endif
13 #else
14 #if defined WIN32
15 #define QTX_EXPORT _declspec( dllimport )
16 #else
17 #define QTX_EXPORT  
18 #endif
19 #endif
20
21 #if defined SOLARIS
22 #define bool  int
23 #define false 0
24 #define true  1
25 #endif
26
27 #ifndef INCLUDE_MENUITEM_DEF
28 #define INCLUDE_MENUITEM_DEF
29 #endif
30
31 #include <qnamespace.h>
32
33 #ifndef QT_VERSION
34 #define QT_VER 0
35 #else
36 #if QT_VERSION >= 0x30000
37 #define QT_VER 3
38 #else
39 #if QT_VERSION >= 300
40 #define QT_VER 3
41 #else
42 #if QT_VERSION >= 200
43 #define QT_VER 2
44 #else
45 #if QT_VERSION >= 100
46 #define QT_VER 1
47 #endif
48 #endif
49 #endif
50 #endif
51 #endif
52
53 class QObject;
54 class QString;
55 class QWidget;
56 class QToolBar;
57 class QGroupBox;
58 class QPopupMenu;
59 class QWidgetList;
60
61 template <class> class QValueList;
62
63 #if QT_VER < 3
64 #define QPtrList QList
65 #define QPtrListIterator QListIterator
66 #endif
67
68 typedef QValueList<int>    QIntList;
69 typedef QValueList<short>  QShortList;
70 typedef QValueList<double> QDoubleList;
71
72 class QTX_EXPORT Qtx : public Qt
73 {
74 public:
75   enum AlignmentFlags
76   {
77     AlignOutLeft   = AlignVCenter  << 2,
78     AlignOutRight  = AlignOutLeft  << 2,
79     AlignOutTop    = AlignOutRight << 2,
80     AlignOutBottom = AlignOutTop   << 2
81   };
82
83   static void    setTabOrder( QWidget*, ... );
84   static void    setTabOrder( const QWidgetList& );
85   static void    alignWidget( QWidget*, const QWidget*, const int );
86
87   static void    simplifySeparators( QToolBar* );
88   static void    simplifySeparators( QPopupMenu*, const bool = true );
89
90   static bool    isParent( QObject*, QObject* );
91
92   static QString extension( const QString& );
93   static QString dir( const QString&, const bool = true );
94   static QString file( const QString&, const bool = true );
95
96   static QString library( const QString& );
97
98   static QString tmpDir();
99   static bool    mkDir( const QString& );
100   static bool    rmDir( const QString& );
101   static bool    dos2unix( const QString& );
102   static QString addSlash( const QString& );
103
104   static int     rgbSet( const QColor& );
105   static int     rgbSet( const int, const int, const int );
106
107   static void    rgbSet( const int, QColor& );
108   static void    rgbSet( const int, int&, int&, int& );
109 };
110
111 #endif