QtGStreamer  0.10.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
graphicsvideowidget.h
00001 /*
00002     Copyright (C) 2012 Collabora Ltd. <info@collabora.com>
00003       @author George Kiagiadakis <george.kiagiadakis@collabora.com>
00004 
00005     This library is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU Lesser General Public License as published
00007     by the Free Software Foundation; either version 2.1 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public License
00016     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 #ifndef QGST_UI_GRAPHICSVIDEOWIDGET_H
00019 #define QGST_UI_GRAPHICSVIDEOWIDGET_H
00020 
00021 #include "graphicsvideosurface.h"
00022 #include <QtGui/QGraphicsWidget>
00023 
00024 namespace QGst {
00025 namespace Ui {
00026 
00037 class QTGSTREAMERUI_EXPORT GraphicsVideoWidget : public QGraphicsWidget
00038 {
00039     Q_OBJECT
00040     Q_DISABLE_COPY(GraphicsVideoWidget)
00041     Q_PROPERTY(QGst::Ui::GraphicsVideoSurface* surface READ surface WRITE setSurface)
00042 public:
00043     explicit GraphicsVideoWidget(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
00044     virtual ~GraphicsVideoWidget();
00045 
00047     virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
00048 
00049     GraphicsVideoSurface *surface() const;
00050     void setSurface(GraphicsVideoSurface *surface);
00051 
00052 private:
00053     QWeakPointer<GraphicsVideoSurface> m_surface;
00054 };
00055 
00056 } // namespace Ui
00057 } // namespace QGst
00058 
00059 #endif // QGST_UI_GRAPHICSVIDEOWIDGET_H