Phonon  4.7.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
videowidget.h
1 /* This file is part of the KDE project
2  Copyright (C) 2005-2007 Matthias Kretz <kretz@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) version 3, or any
8  later version accepted by the membership of KDE e.V. (or its
9  successor approved by the membership of KDE e.V.), Nokia Corporation
10  (or its successors, if any) and the KDE Free Qt Foundation, which shall
11  act as a proxy defined in Section 6 of version 3 of the license.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public
19  License along with this library. If not, see <http://www.gnu.org/licenses/>.
20 
21 */
22 #ifndef Phonon_VIDEOWIDGET_H
23 #define Phonon_VIDEOWIDGET_H
24 
25 #include "phonon_export.h"
26 #include "phonondefs.h"
27 #include "abstractvideooutput.h"
28 #include <QWidget>
29 
30 
31 class QString;
32 
33 #ifndef QT_NO_PHONON_VIDEO
34 
35 namespace Phonon
36 {
37 class AbstractVideoOutput;
38  class VideoWidgetPrivate;
54  class PHONON_EXPORT VideoWidget : public QWidget, public Phonon::AbstractVideoOutput
55  {
56  P_DECLARE_PRIVATE(VideoWidget)
57  Q_OBJECT
58  Q_ENUMS(AspectRatio ScaleMode)
76  Q_PROPERTY(bool fullScreen READ isFullScreen WRITE setFullScreen)
83  Q_PROPERTY(AspectRatio aspectRatio READ aspectRatio WRITE setAspectRatio)
84 
94  Q_PROPERTY(ScaleMode scaleMode READ scaleMode WRITE setScaleMode)
95 
101  Q_PROPERTY(qreal brightness READ brightness WRITE setBrightness)
107  Q_PROPERTY(qreal contrast READ contrast WRITE setContrast)
113  Q_PROPERTY(qreal hue READ hue WRITE setHue)
119  Q_PROPERTY(qreal saturation READ saturation WRITE setSaturation)
120 
121  public:
126  {
131  AspectRatioAuto = 0,
137  AspectRatioWidget = 1,
142  AspectRatio4_3 = 2,
147  AspectRatio16_9 = 3
148 //X /**
149 //X * Assume that every pixel of the video image needs to be displayed with the same
150 //X * physical width and height. (1:1 image pixels, not imagewidth
151 //X * = imageheight)
152 //X */
153 //X AspectRatioSquare = 4,
154  };
155 
156  enum ScaleMode {
157  FitInView = 0,
158  ScaleAndCrop = 1
159  };
160 
164  VideoWidget(QWidget *parent = 0);
165 
166  AspectRatio aspectRatio() const;
167  ScaleMode scaleMode() const;
168 
169  qreal brightness() const;
170  qreal contrast() const;
171  qreal hue() const;
172  qreal saturation() const;
173  QImage snapshot() const;
174 
175  //TODO: bar colors property
176  public Q_SLOTS:
177  void setFullScreen(bool fullscreen);
178 
182  void exitFullScreen();
183 
187  void enterFullScreen();
188 
189  void setAspectRatio(AspectRatio);
190  void setScaleMode(ScaleMode);
191 
192  void setBrightness(qreal value);
193  void setContrast(qreal value);
194  void setHue(qreal value);
195  void setSaturation(qreal value);
196 
197  protected:
204  VideoWidget(VideoWidgetPrivate &d, QWidget *parent);
205 
206  void mouseMoveEvent(QMouseEvent *);
207  bool event(QEvent *);
208  };
209 
210 } //namespace Phonon
211 
212 #endif //QT_NO_PHONON_VIDEO
213 
214 
215 // vim: sw=4 ts=4 tw=80
216 #endif // Phonon_VIDEOWIDGET_H