00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef ARTSKDE_KVIDEOWIDGET_H
00012 #define ARTSKDE_KVIDEOWIDGET_H
00013
00014 #include <qevent.h>
00015 #include <qimage.h>
00016 #include <qwidget.h>
00017 #include <kmedia2.h>
00018 #include <kxmlguiclient.h>
00019
00020
00021 class KVideoWidget : public QWidget, virtual public KXMLGUIClient
00022 {
00023 Q_OBJECT
00024
00025 public:
00026 KVideoWidget( KXMLGUIClient *clientParent, QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
00027 KVideoWidget( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
00028 virtual ~KVideoWidget();
00029
00030 void embed( Arts::VideoPlayObject vpo );
00031 static QImage snapshot( Arts::VideoPlayObject vpo );
00032
00033 bool isEmbedded();
00034 bool isFullscreen();
00035 bool isHalfSize();
00036 bool isNormalSize();
00037 bool isDoubleSize();
00038
00039 QSize sizeHint() const;
00040
00041 virtual int heightForWidth ( int w ) const;
00042
00043 protected:
00044 virtual void mousePressEvent( QMouseEvent *event );
00045 virtual void resizeEvent( QResizeEvent *event );
00046 virtual bool x11Event( XEvent *event );
00047
00048 public slots:
00049 void setFullscreen();
00050 void setWindowed();
00051 void setHalfSize();
00052 void setNormalSize();
00053 void setDoubleSize();
00054
00055 void resizeNotify( int width, int height );
00056
00057 protected slots:
00058 void fullscreenActivated();
00059 void halfSizeActivated();
00060 void normalSizeActivated();
00061 void doubleSizeActivated();
00062
00063 signals:
00064 void adaptSize( int width, int height );
00065 void rightButtonPressed( const QPoint & );
00066
00067 private:
00068 void init(void);
00069 QWidget *fullscreenWidget;
00070 int videoWidth;
00071 int videoHeight;
00072 Arts::VideoPlayObject poVideo;
00073 };
00074
00075 #endif