KMediaPlayer
player.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef KMEDIAPLAYERPLAYER_H
00025 #define KMEDIAPLAYERPLAYER_H
00026
00027 #include <kparts/part.h>
00028 #include <kmediaplayer/view.h>
00029
00032 namespace KMediaPlayer
00033 {
00034
00045 class KMEDIAPLAYER_EXPORT Player : public KParts::ReadOnlyPart
00046 {
00047 Q_OBJECT
00048 Q_PROPERTY(bool hasLength READ hasLength)
00049 Q_PROPERTY(qlonglong length READ length)
00050 Q_PROPERTY(bool looping READ isLooping WRITE setLooping)
00051 Q_PROPERTY(qlonglong position READ position)
00052 Q_PROPERTY(bool seekable READ isSeekable)
00053 Q_PROPERTY(int state READ state WRITE setState)
00054
00055 public:
00059 Player(QObject *parent);
00060
00064 Player(QWidget *parentWidget, const char *widgetName, QObject *parent );
00065
00066 virtual ~Player(void);
00067
00071 virtual View *view(void) = 0;
00072
00073 public Q_SLOTS:
00075 virtual void pause(void) = 0;
00076
00078 virtual void play(void) = 0;
00079
00081 virtual void stop(void) = 0;
00082
00087 virtual void seek(qlonglong msec) = 0;
00088 public:
00090 virtual bool isSeekable(void) const = 0;
00091
00093 virtual qlonglong position(void) const = 0;
00094
00097 virtual bool hasLength(void) const = 0;
00098
00100 virtual qlonglong length(void) const = 0;
00101
00102 public Q_SLOTS:
00106 void setLooping(bool);
00107 public:
00109 bool isLooping(void) const;
00110 Q_SIGNALS:
00112 void loopingChanged(bool);
00113
00114 public:
00116 enum State
00117 {
00119 Empty,
00121 Stop,
00123 Pause,
00125 Play
00126 };
00128 int state(void) const;
00129 Q_SIGNALS:
00131 void stateChanged(int);
00132
00133 protected Q_SLOTS:
00136 void setState(int);
00137
00138 private:
00139 bool currentLooping;
00140 State currentState;
00141
00142 struct Data;
00143 Data *d;
00144 };
00145
00146 }
00147
00148 #endif