Diffstat (limited to 'core/multimedia/opieplayer/videowidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/videowidget.h | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/core/multimedia/opieplayer/videowidget.h b/core/multimedia/opieplayer/videowidget.h new file mode 100644 index 0000000..8b49091 --- a/dev/null +++ b/core/multimedia/opieplayer/videowidget.h | |||
@@ -0,0 +1,88 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | #ifndef VIDEO_WIDGET_H | ||
21 | #define VIDEO_WIDGET_H | ||
22 | |||
23 | |||
24 | #include <qwidget.h> | ||
25 | |||
26 | |||
27 | class QPixmap; | ||
28 | class QSlider; | ||
29 | |||
30 | |||
31 | enum VideoButtons { | ||
32 | VideoPrevious, | ||
33 | VideoStop, | ||
34 | VideoPlay, | ||
35 | VideoPause, | ||
36 | VideoNext, | ||
37 | VideoPlayList, | ||
38 | VideoFullscreen | ||
39 | }; | ||
40 | |||
41 | |||
42 | class VideoWidget : public QWidget { | ||
43 | Q_OBJECT | ||
44 | public: | ||
45 | VideoWidget( QWidget* parent=0, const char* name=0, WFlags f=0 ); | ||
46 | ~VideoWidget(); | ||
47 | |||
48 | bool playVideo(); | ||
49 | |||
50 | public slots: | ||
51 | void updateSlider( long, long ); | ||
52 | void sliderPressed( ); | ||
53 | void sliderReleased( ); | ||
54 | void setPaused( bool b) { setToggleButton( VideoPause, b ); } | ||
55 | void setPlaying( bool b) { setToggleButton( VideoPlay, b ); } | ||
56 | void setFullscreen( bool b ) { setToggleButton( VideoFullscreen, b ); } | ||
57 | void makeVisible(); | ||
58 | void setPosition( long ); | ||
59 | void setLength( long ); | ||
60 | void setView( char ); | ||
61 | |||
62 | signals: | ||
63 | void sliderMoved( long ); | ||
64 | |||
65 | protected: | ||
66 | void paintEvent( QPaintEvent *pe ); | ||
67 | void mouseMoveEvent( QMouseEvent *event ); | ||
68 | void mousePressEvent( QMouseEvent *event ); | ||
69 | void mouseReleaseEvent( QMouseEvent *event ); | ||
70 | void closeEvent( QCloseEvent *event ); | ||
71 | |||
72 | private: | ||
73 | void paintButton( QPainter *p, int i ); | ||
74 | void toggleButton( int ); | ||
75 | void setToggleButton( int, bool ); | ||
76 | |||
77 | QSlider *slider; | ||
78 | QPixmap *pixmaps[3]; | ||
79 | QImage *currentFrame; | ||
80 | intscaledWidth; | ||
81 | int scaledHeight; | ||
82 | }; | ||
83 | |||
84 | |||
85 | #endif // VIDEO_WIDGET_H | ||
86 | |||
87 | |||
88 | |||