Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

videowidget.h

Go to the documentation of this file.
00001 /**********************************************************************
00002 ** Copyright (C) 2000-2002 Trolltech AS.  All rights reserved.
00003 **
00004 ** This file is part of the Qtopia Environment.
00005 **
00006 ** This file may be distributed and/or modified under the terms of the
00007 ** GNU General Public License version 2 as published by the Free Software
00008 ** Foundation and appearing in the file LICENSE.GPL included in the
00009 ** packaging of this file.
00010 **
00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 **
00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00015 **
00016 ** Contact info@trolltech.com if any conditions of this licensing are
00017 ** not clear to you.
00018 **
00019 **********************************************************************/
00020 #ifndef VIDEO_WIDGET_H
00021 #define VIDEO_WIDGET_H
00022 
00023 
00024 #include <qwidget.h>
00025 
00026 class QPixmap;
00027 class QSlider;
00028 
00029 
00030 enum VideoButtons {
00031     VideoStop,
00032     VideoPlay,
00033 //    VideoPause,
00034     VideoPrevious,
00035     VideoNext,
00036     VideoVolUp,
00037     VideoVolDown,
00038 //    VideoPlayList,
00039     VideoFullscreen
00040 };
00041 
00042 class VideoWidget : public QWidget {
00043     Q_OBJECT
00044 public:
00045     VideoWidget( QWidget* parent=0, const char* name=0, WFlags f=0 );
00046     ~VideoWidget();
00047 
00048     bool playVideo();
00049 
00050 public slots:
00051     void updateSlider( long, long );
00052     void sliderPressed( );
00053     void sliderReleased( );
00054 //    void setPaused( bool b)      { setToggleButton( VideoPause, b ); }
00055     void setPlaying( bool b)     { setToggleButton( VideoPlay, b ); }
00056     void setFullscreen( bool b ) { setToggleButton( VideoFullscreen, b ); }
00057     void makeVisible();
00058     void setPosition( long );
00059     void setLength( long );
00060     void setView( char );
00061 
00062 signals:
00063     void moreClicked();
00064     void lessClicked();
00065     void moreReleased();
00066     void lessReleased();
00067     void sliderMoved( long );
00068 
00069 protected:
00070     void resizeEvent( QResizeEvent * );
00071     void paintEvent( QPaintEvent *pe );
00072     void mouseMoveEvent( QMouseEvent *event );
00073     void mousePressEvent( QMouseEvent *event );
00074     void mouseReleaseEvent( QMouseEvent *event );
00075     void closeEvent( QCloseEvent *event );
00076     void keyReleaseEvent( QKeyEvent *e);
00077 
00078 private:
00079     QPixmap *pixBg;
00080     QImage  *imgUp;
00081     QImage  *imgDn;
00082     QImage  *imgButtonMask;
00083     QBitmap *masks[7];
00084     QString backgroundPix;
00085     QPixmap *buttonPixUp[7];
00086     QPixmap *buttonPixDown[7];
00087     QString skin;
00088     QSlider *slider;
00089     QPixmap *pixmaps[3];
00090     QImage *currentFrame;
00091     int xoff, yoff;
00092     int scaledWidth;
00093     int scaledHeight;
00094 
00095   void paintButton( QPainter *p, int i );
00096     void toggleButton( int );
00097     void setToggleButton( int, bool );
00098 
00099 };
00100 
00101 
00102 #endif // VIDEO_WIDGET_H
00103 
00104 
00105 

Generated on Sat Nov 5 16:15:43 2005 for OPIE by  doxygen 1.4.2