~macslow/unity8/shellRotation

« back to all changes in this revision

Viewing changes to tests/mocks/Unity/Application/MirSurfaceItem.h

  • Committer: Mirco Müller
  • Date: 2015-04-10 15:10:51 UTC
  • mfrom: (1544.18.79 origin/shellRotation)
  • Revision ID: mirco.mueller@ubuntu.com-20150410151051-gdw394euztlwuii5
Merged with ~unity-team/unity8/shellRotation and fixed conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
    Q_PROPERTY(bool live READ live NOTIFY liveChanged)
38
38
    Q_PROPERTY(OrientationAngle orientationAngle READ orientationAngle WRITE setOrientationAngle
39
39
               NOTIFY orientationAngleChanged DESIGNABLE false)
 
40
    Q_PROPERTY(int touchPressCount READ touchPressCount WRITE setTouchPressCount
 
41
                                   NOTIFY touchPressCountChanged DESIGNABLE false)
 
42
    Q_PROPERTY(int touchReleaseCount READ touchReleaseCount WRITE setTouchReleaseCount
 
43
                                     NOTIFY touchReleaseCountChanged DESIGNABLE false)
40
44
 
41
45
public:
42
46
    enum Type {
85
89
    Q_INVOKABLE void setState(State newState);
86
90
    Q_INVOKABLE void release();
87
91
 
 
92
    int touchPressCount() const { return m_touchPressCount; }
 
93
    void setTouchPressCount(int count) { m_touchPressCount = count; Q_EMIT touchPressCountChanged(count); }
 
94
 
 
95
    int touchReleaseCount() const { return m_touchReleaseCount; }
 
96
    void setTouchReleaseCount(int count) { m_touchReleaseCount = count; Q_EMIT touchReleaseCountChanged(count); }
 
97
 
88
98
Q_SIGNALS:
89
99
    void typeChanged(Type);
90
100
    void stateChanged(State);
91
101
    void liveChanged(bool live);
92
102
    void orientationAngleChanged(OrientationAngle angle);
 
103
    void touchPressCountChanged(int count);
 
104
    void touchReleaseCountChanged(int count);
93
105
 
94
106
    // internal mock use
95
107
    void deregister();
102
114
                            const QString &qmlFilePath = QString(),
103
115
                            QQuickItem *parent = 0);
104
116
 
 
117
    void touchEvent(QTouchEvent * event) override;
 
118
 
105
119
private Q_SLOTS:
106
120
    void onComponentStatusChanged(QQmlComponent::Status status);
107
121
 
120
134
    QQuickItem *m_qmlItem;
121
135
    QUrl m_screenshotUrl;
122
136
 
 
137
    int m_touchPressCount;
 
138
    int m_touchReleaseCount;
 
139
 
123
140
    friend class SurfaceManager;
124
141
};
125
142