~josharenson/unity8/slim_greeter_real_lightdm

« back to all changes in this revision

Viewing changes to tests/mocks/QtMultimedia/videooutput.h

  • Committer: Josh Arenson
  • Date: 2016-06-29 14:44:41 UTC
  • mfrom: (1789.412.85 unity8)
  • Revision ID: joshua.arenson@canonical.com-20160629144441-du2vd7vu97b2n8pc
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2016 Canonical, Ltd.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License as published by
 
6
 * the Free Software Foundation; version 3.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful,
 
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 * GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
15
 */
 
16
 
 
17
#ifndef VIDEOOUTPUT_H
 
18
#define VIDEOOUTPUT_H
 
19
 
 
20
#include <QQuickItem>
 
21
#include <QPointer>
 
22
class QQmlComponent;
 
23
 
 
24
class VideoOutput : public QQuickItem
 
25
{
 
26
    Q_OBJECT
 
27
    Q_PROPERTY(QObject* source READ source WRITE setSource NOTIFY sourceChanged)
 
28
public:
 
29
    explicit VideoOutput(QQuickItem *parent = 0);
 
30
 
 
31
    QObject *source() const { return m_source.data(); }
 
32
    void setSource(QObject *source);
 
33
 
 
34
    void itemChange(ItemChange change, const ItemChangeData & value);
 
35
 
 
36
Q_SIGNALS:
 
37
    void sourceChanged();
 
38
 
 
39
protected Q_SLOTS:
 
40
    void onComponentStatusChanged(QQmlComponent::Status status);
 
41
    void updateProperties();
 
42
 
 
43
private:
 
44
    void createQmlContentItem();
 
45
    void printComponentErrors();
 
46
 
 
47
    QPointer<QObject> m_source;
 
48
    QQmlComponent* m_qmlContentComponent;
 
49
    QQuickItem* m_qmlItem;
 
50
};
 
51
 
 
52
#endif // VIDEOOUTPUT_H