src/multimedia/qvideowidget.h
changeset 0 876b1a06bc25
child 5 603d3f8b6302
equal deleted inserted replaced
-1:000000000000 0:876b1a06bc25
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the Qt Mobility Components.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 #ifndef QVIDEOWIDGET_H
       
    43 #define QVIDEOWIDGET_H
       
    44 
       
    45 #include <QtGui/qwidget.h>
       
    46 
       
    47 #include <qmobilityglobal.h>
       
    48 #include <qmediabindableinterface.h>
       
    49 
       
    50 QT_BEGIN_NAMESPACE
       
    51 
       
    52 class QMediaObject;
       
    53 
       
    54 class QVideoWidgetPrivate;
       
    55 class Q_MULTIMEDIA_EXPORT QVideoWidget : public QWidget, public QMediaBindableInterface
       
    56 {
       
    57     Q_OBJECT
       
    58     Q_INTERFACES(QMediaBindableInterface)
       
    59     Q_PROPERTY(QMediaObject* mediaObject READ mediaObject WRITE setMediaObject)
       
    60     Q_PROPERTY(bool fullScreen READ isFullScreen WRITE setFullScreen NOTIFY fullScreenChanged)
       
    61     Q_PROPERTY(Qt::AspectRatioMode aspectRatioMode READ aspectRatioMode WRITE setAspectRatioMode NOTIFY aspectRatioModeChanged)
       
    62     Q_PROPERTY(int brightness READ brightness WRITE setBrightness NOTIFY brightnessChanged)
       
    63     Q_PROPERTY(int contrast READ contrast WRITE setContrast NOTIFY contrastChanged)
       
    64     Q_PROPERTY(int hue READ hue WRITE setHue NOTIFY hueChanged)
       
    65     Q_PROPERTY(int saturation READ saturation WRITE setSaturation NOTIFY saturationChanged)
       
    66 
       
    67 public:
       
    68     QVideoWidget(QWidget *parent = 0);
       
    69     ~QVideoWidget();   
       
    70 
       
    71     QMediaObject *mediaObject() const;    
       
    72 
       
    73 #ifdef Q_QDOC
       
    74     bool isFullScreen() const;
       
    75 #endif
       
    76 
       
    77     Qt::AspectRatioMode aspectRatioMode() const;
       
    78 
       
    79     int brightness() const;
       
    80     int contrast() const;
       
    81     int hue() const;
       
    82     int saturation() const;
       
    83 
       
    84     QSize sizeHint() const;
       
    85 
       
    86 public Q_SLOTS:
       
    87     void setFullScreen(bool fullScreen);
       
    88     void setAspectRatioMode(Qt::AspectRatioMode mode);
       
    89     void setBrightness(int brightness);
       
    90     void setContrast(int contrast);
       
    91     void setHue(int hue);
       
    92     void setSaturation(int saturation);
       
    93 
       
    94 Q_SIGNALS:
       
    95     void fullScreenChanged(bool fullScreen);
       
    96     void brightnessChanged(int brightness);
       
    97     void contrastChanged(int contrast);
       
    98     void hueChanged(int hue);
       
    99     void saturationChanged(int saturation);
       
   100 
       
   101 protected:
       
   102     bool event(QEvent *event);
       
   103     void showEvent(QShowEvent *event);
       
   104     void hideEvent(QHideEvent *event);
       
   105     void resizeEvent(QResizeEvent *event);
       
   106     void moveEvent(QMoveEvent *event);
       
   107     void paintEvent(QPaintEvent *event);
       
   108 
       
   109     bool setMediaObject(QMediaObject *object);
       
   110 
       
   111 protected:
       
   112     QVideoWidgetPrivate *d_ptr;
       
   113 
       
   114 private:
       
   115     Q_DECLARE_PRIVATE(QVideoWidget)
       
   116     Q_PRIVATE_SLOT(d_func(), void _q_serviceDestroyed())
       
   117     Q_PRIVATE_SLOT(d_func(), void _q_brightnessChanged(int))
       
   118     Q_PRIVATE_SLOT(d_func(), void _q_contrastChanged(int))
       
   119     Q_PRIVATE_SLOT(d_func(), void _q_hueChanged(int))
       
   120     Q_PRIVATE_SLOT(d_func(), void _q_saturationChanged(int))
       
   121     Q_PRIVATE_SLOT(d_func(), void _q_fullScreenChanged(bool))
       
   122     Q_PRIVATE_SLOT(d_func(), void _q_dimensionsChanged())
       
   123 };
       
   124 
       
   125 QT_END_NAMESPACE
       
   126 
       
   127 #endif