Ran qt3to4
[basket4.git] / src / qeffects.h
blob09b53d55ec4c67034f4b41e344a16555aeb909d0
1 //Added by qt3to4:
2 #include <QEvent>
3 #include <QCloseEvent>
4 #include <QPaintEvent>
5 #if 0
7 // Note: this file has been copied from the Qt source.
8 // Those classes are normally used internally in Qt
9 // but we need them for immitate the roll-over effect of QComboBox.
11 // Some class definitions have been moved from qeffects.cpp to this file.
12 // They are framed with the comment "MOVED FROM qeffect.cpp"
14 /****************************************************************************
15 ** $Id: qt/qeffects_p.h 3.3.4 edited May 27 2003 $
17 ** Definition of QEffects functions
19 ** Created : 000621
21 ** Copyright (C) 2000 Trolltech AS. All rights reserved.
23 ** This file is part of the widgets module of the Qt GUI Toolkit.
25 ** This file may be distributed under the terms of the Q Public License
26 ** as defined by Trolltech AS of Norway and appearing in the file
27 ** LICENSE.QPL included in the packaging of this file.
29 ** This file may be distributed and/or modified under the terms of the
30 ** GNU General Public License version 2 as published by the Free Software
31 ** Foundation and appearing in the file LICENSE.GPL included in the
32 ** packaging of this file.
34 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
35 ** licenses may use this file in accordance with the Qt Commercial License
36 ** Agreement provided with the Software.
38 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
39 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
41 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
42 ** information about Qt Commercial License Agreements.
43 ** See http://www.trolltech.com/qpl/ for QPL licensing information.
44 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
46 ** Contact info@trolltech.com if any conditions of this licensing are
47 ** not clear to you.
49 **********************************************************************/
51 #ifndef QEFFECTS_P_H
52 #define QEFFECTS_P_H
56 // W A R N I N G
57 // -------------
59 // This file is not part of the Qt API. It exists for the convenience
60 // of qeffects.cpp, qcombobox.cpp, qpopupmenu.cpp and qtooltip.cpp.
61 // This header file may change from version to version without notice,
62 // or even be removed.
64 // We mean it.
68 #ifndef QT_H
69 #include "qnamespace.h"
70 #endif // QT_H
72 #ifndef QT_NO_EFFECTS
73 class QWidget;
75 struct QEffects
77 enum Direction {
78 LeftScroll = 0x0001,
79 RightScroll = 0x0002,
80 UpScroll = 0x0004,
81 DownScroll = 0x0008
84 typedef uint DirFlags;
87 extern void Q_EXPORT qScrollEffect( QWidget*, QEffects::DirFlags dir = QEffects::DownScroll, int time = -1 );
88 extern void Q_EXPORT qFadeEffect( QWidget*, int time = -1 );
91 /******************* MOVED FROM qeffect.cpp: */
93 #include "qpointer.h"
94 #include "qdatetime.h"
95 #include "qtimer.h"
96 #include "qpixmap.h"
97 #include "qimage.h"
100 Internal class to get access to protected QWidget-members
103 class QAccessWidget : public QWidget
105 friend class QAlphaWidget;
106 friend class QRollEffect;
107 public:
108 QAccessWidget( QWidget* parent=0, const char* name=0, WFlags f = 0 )
109 : QWidget( parent, name, f ) {}
113 Internal class QAlphaWidget.
115 The QAlphaWidget is shown while the animation lasts
116 and displays the pixmap resulting from the alpha blending.
119 class QAlphaWidget: public QWidget, private QEffects
121 Q_OBJECT
122 public:
123 QAlphaWidget( QWidget* w, WFlags f = 0 );
125 void run( int time );
127 protected:
128 void paintEvent( QPaintEvent* e );
129 void closeEvent( QCloseEvent* );
130 bool eventFilter( QObject* o, QEvent* e );
131 void alphaBlend();
133 protected slots:
134 void render();
136 private:
137 QPixmap pm;
138 double alpha;
139 QImage back;
140 QImage front;
141 QImage mixed;
142 QPointer<QAccessWidget> widget;
143 int duration;
144 int elapsed;
145 bool showWidget;
146 QTimer anim;
147 QTime checkTime;
151 Internal class QRollEffect
153 The QRollEffect widget is shown while the animation lasts
154 and displays a scrolling pixmap.
157 class QRollEffect : public QWidget, private QEffects
159 Q_OBJECT
160 public:
161 QRollEffect( QWidget* w, WFlags f, DirFlags orient );
163 void run( int time );
165 protected:
166 void paintEvent( QPaintEvent* );
167 bool eventFilter( QObject*, QEvent* );
168 void closeEvent( QCloseEvent* );
170 private slots:
171 void scroll();
173 private:
174 QPointer<QAccessWidget> widget;
176 int currentHeight;
177 int currentWidth;
178 int totalHeight;
179 int totalWidth;
181 int duration;
182 int elapsed;
183 bool done;
184 bool showWidget;
185 int orientation;
187 QTimer anim;
188 QTime checkTime;
190 QPixmap pm;
193 /******************************/
195 #endif // QT_NO_EFFECTS
197 #endif // QEFFECTS_P_H
199 #endif // #if 0