2 * Copyright (C) 2015 Canonical, Ltd.
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.
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.
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/>.
17#ifndef MOCK_MIR_SURFACE_H
18#define MOCK_MIR_SURFACE_H
24#include <unity/shell/application/MirSurfaceInterface.h>
26class MirSurface : public unity::shell::application::MirSurfaceInterface
31 // for use in qml tests
32 Q_PROPERTY(int width READ width NOTIFY widthChanged)
33 Q_PROPERTY(int height READ height NOTIFY heightChanged)
34 Q_PROPERTY(bool activeFocus READ activeFocus NOTIFY activeFocusChanged)
37 MirSurface(const QString& name,
40 const QUrl& screenshot,
41 const QUrl &qmlFilePath = QUrl());
42 virtual ~MirSurface();
45 // unity.shell.application.MirSurface
47 Mir::Type type() const override;
49 QString name() const override;
51 QSize size() const override { return QSize(width(),height()); }
52 void resize(int width, int height) override;
53 void resize(const QSize &size) override { resize(size.width(), size.height()); }
56 Mir::State state() const override;
57 Q_INVOKABLE void setState(Mir::State) override;
59 bool live() const override;
61 Mir::OrientationAngle orientationAngle() const override;
62 void setOrientationAngle(Mir::OrientationAngle) override;
67 Q_INVOKABLE void setLive(bool live);
69 void incrementViewCount();
70 void decrementViewCount();
71 int viewCount() const;
77 // internal mock stuff
79 QUrl qmlFilePath() const;
81 QUrl screenshotUrl() const;
82 void setScreenshotUrl(QUrl);
84 bool activeFocus() const;
85 void setActiveFocus(bool);
88 void stateChanged(Mir::State);
89 void liveChanged(bool live);
90 void orientationAngleChanged(Mir::OrientationAngle angle);
95 // internal mock stuff
96 void screenshotUrlChanged(QUrl);
97 void activeFocusChanged(bool);
100 const QString m_name;
101 const Mir::Type m_type;
103 Mir::OrientationAngle m_orientationAngle;
104 QUrl m_screenshotUrl;
113#endif // MOCK_MIR_SURFACE_H
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list