]> SALOME platform Git repositories - modules/gui.git/blob - src/Qtx/QtxSplash.h
Salome HOME
cc24f7fce0351bb704839a34d4ac6a3cfbb653e9
[modules/gui.git] / src / Qtx / QtxSplash.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:      QtxSplash.h
20 // Author:    Vadim SANDLER
21
22 #ifndef QTXSPLASH_H
23 #define QTXSPLASH_H
24
25 #include "Qtx.h"
26
27 #include <qpixmap.h>
28 #include <qwidget.h>
29
30 #ifdef WIN32
31 #pragma warning( disable:4251 )
32 #endif
33
34 class QTX_EXPORT QtxSplash : public QWidget
35 {
36     Q_OBJECT
37
38 private:
39     QtxSplash( const QPixmap& = QPixmap() );
40
41 public:
42     enum { Horizontal, Vertical };
43
44     virtual ~QtxSplash();
45
46     static QtxSplash* splash( const QPixmap& = QPixmap() );
47     static void       setStatus( const QString&, const int = 0 );
48     static void       error( const QString&, const QString& = QString::null, const int = -1 );
49
50     void              setPixmap( const QPixmap& );
51     QPixmap           pixmap() const;
52
53     void              setHideOnClick( const bool );
54     bool              hideOnClick() const;
55
56     void              setTotalSteps( const int );
57     int               totalSteps() const;
58     void              setProgress( const int );
59     int               progress() const;
60     void              setProgress( const int, const int );
61     void              setProgressColors( const QColor&, 
62                                          const QColor& = QColor(),
63                                          const int     = Vertical );
64     int               progressColors( QColor&, QColor& );
65
66     void              setTextAlignment( const int );
67     int               textAlignment() const;
68
69     void              setTextColor( const QColor& );
70     QColor            textColor() const;
71     void              setTextColors( const QColor&, const QColor& = QColor() );
72     void              textColors( QColor&, QColor& ) const;
73     
74     QString           message() const;
75
76     int               error() const;
77
78     void              finish( QWidget* );
79     void              repaint();
80
81 public slots:
82     void              message( const QString&, 
83                                const int,
84                                const QColor& = white );
85     void              message( const QString& );
86     void              clear();
87
88 protected:
89     virtual void      mousePressEvent( QMouseEvent* );
90     virtual void      customEvent( QCustomEvent* );
91     virtual void      drawContents( QPainter* );
92
93 private:
94     void              drawContents();
95     void              setError( const int );
96
97 private:
98     static QtxSplash* mySplash;
99
100     QPixmap           myPixmap;
101     QString           myMessage;
102     int               myAlignment;
103     QColor            myColor;
104     QColor            myShadowColor;
105     bool              myHideOnClick;
106     int               myProgress;
107     int               myTotal;
108     QColor            myStartColor;
109     QColor            myEndColor;
110     int               myGradientType;
111     int               myError;
112 };
113
114 #endif