• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

Plasma

  • sources
  • kde-4.14
  • kdelibs
  • plasma
  • widgets
videowidget.h
Go to the documentation of this file.
1 /*
2  * Copyright 2009 Marco Martin <notmart@gmail.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Library General Public License as
6  * published by the Free Software Foundation; either version 2, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef PLASMA_VIDEOWIDGET_H
21 #define PLASMA_VIDEOWIDGET_H
22 
23 #include <QtGui/QGraphicsProxyWidget>
24 
25 #include <plasma/plasma_export.h>
26 
27 namespace Phonon {
28  class VideoWidget;
29  class MediaObject;
30  class AudioOutput;
31 }
32 
33 class KUrl;
34 
35 namespace Plasma
36 {
37 
38 class VideoWidgetPrivate;
39 
48 class PLASMA_EXPORT VideoWidget : public QGraphicsProxyWidget
49 {
50  Q_OBJECT
51 
52  Q_PROPERTY(QString url READ url WRITE setUrl)
53  Q_PROPERTY(qint64 currentTime READ currentTime)
54  Q_PROPERTY(qint64 totalTime READ totalTime)
55  Q_PROPERTY(qint64 remainingTime READ remainingTime)
56  Q_PROPERTY(Controls usedControls READ usedControls WRITE setUsedControls)
57  Q_PROPERTY(bool controlsVisible READ controlsVisible WRITE setControlsVisible)
58  Q_PROPERTY(qint32 tickInterval READ tickInterval WRITE setTickInterval)
59  Q_PROPERTY(QString styleSheet READ styleSheet WRITE setStyleSheet)
60  Q_ENUMS(Control)
61 
62 public:
63  enum Control {
64  NoControls = 0,
65  Play = 1,
66  Pause = 2,
67  Stop = 4,
68  PlayPause = 8,
69  Previous = 16,
70  Next = 32,
71  Progress = 64,
72  Volume = 128,
73  OpenFile = 128,
74  DefaultControls = PlayPause|Progress|Volume|OpenFile
75  };
76  Q_DECLARE_FLAGS(Controls, Control)
77 
78  explicit VideoWidget(QGraphicsWidget *parent = 0);
79  ~VideoWidget();
80 
85  void setUrl(const QString &url);
86 
90  QString url() const;
91 
96  Q_INVOKABLE Phonon::MediaObject *mediaObject() const;
97 
102  Q_INVOKABLE Phonon::AudioOutput *audioOutput() const;
103 
107  qint64 currentTime() const;
108 
112  qint64 totalTime() const;
113 
117  qint64 remainingTime() const;
118 
125  void setUsedControls(const Controls controls);
126 
131  Controls usedControls() const;
132 
139  void setControlsVisible(bool visible);
140 
144  bool controlsVisible() const;
145 
150  void setTickInterval(qint64 interval);
151 
157  qint64 tickInterval() const;
158 
164  void setStyleSheet(const QString &stylesheet);
165 
169  QString styleSheet();
170 
174  Phonon::VideoWidget *nativeWidget() const;
175 
176 public Q_SLOTS:
177 
181  void play();
182 
186  void pause();
187 
191  void stop();
192 
197  void seek(qint64 time);
198 
199 Q_SIGNALS:
204  void tick(qint64 time);
205 
209  void aboutToFinish();
210 
215  void nextRequested();
216 
221  void previousRequested();
222 
223 protected:
224  void resizeEvent(QGraphicsSceneResizeEvent *event);
225  void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
226  void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
227  void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
228 
229 private:
230  VideoWidgetPrivate * const d;
231 
232  Q_PRIVATE_SLOT(d, void playPause())
233  Q_PRIVATE_SLOT(d, void ticked(qint64 progress))
234  Q_PRIVATE_SLOT(d, void totalTimeChanged(qint64 time))
235  Q_PRIVATE_SLOT(d, void setPosition(int progress))
236  Q_PRIVATE_SLOT(d, void setVolume(int value))
237  Q_PRIVATE_SLOT(d, void volumeChanged(qreal value))
238  Q_PRIVATE_SLOT(d, void showOpenFileDialog())
239  Q_PRIVATE_SLOT(d, void stateChanged(Phonon::State newState, Phonon::State oldState))
240  Q_PRIVATE_SLOT(d, void hideControlWidget())
241  Q_PRIVATE_SLOT(d, void slidingCompleted())
242 };
243 
244 } // namespace Plasma
245 
246 #endif // multiple inclusion guard
Plasma::VideoWidget::Control
Control
Definition: videowidget.h:63
QGraphicsProxyWidget
Plasma::VideoWidget
a Video playing widget via Phonon, it encloses the Phonon::MediaObject and Phonon::AudioOutput too ...
Definition: videowidget.h:48
QGraphicsWidget
QString
QGraphicsSceneResizeEvent
QGraphicsSceneHoverEvent
plasma_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:12 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal