2 * Copyright (C) 2013-2014 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/>.
21#include <QQmlComponent>
27#include <unity/shell/application/ApplicationInfoInterface.h>
29using namespace unity::shell::application;
31class ApplicationInfo : public ApplicationInfoInterface {
34 Q_PROPERTY(bool fullscreen READ fullscreen WRITE setFullscreen NOTIFY fullscreenChanged)
35 Q_PROPERTY(MirSurfaceItem* surface READ surface NOTIFY surfaceChanged)
36 Q_PROPERTY(QQmlListProperty<MirSurfaceItem> promptSurfaces READ promptSurfaces NOTIFY promptSurfacesChanged DESIGNABLE false)
38 // Only exists in this fake implementation
40 // whether the test code will explicitly control the creation of the application surface
41 Q_PROPERTY(bool manualSurfaceCreation READ manualSurfaceCreation WRITE setManualSurfaceCreation NOTIFY manualSurfaceCreationChanged)
44 ApplicationInfo(QObject *parent = NULL);
45 ApplicationInfo(const QString &appId, QObject *parent = NULL);
48 void setIconId(const QString &iconId);
49 void setScreenshotId(const QString &screenshotId);
51 void setAppId(const QString &value) { m_appId = value; }
52 QString appId() const override { return m_appId; }
54 void setName(const QString &value);
55 QString name() const override { return m_name; }
57 QString comment() const override { return QString(); }
59 QUrl icon() const override { return m_icon; }
61 void setStage(Stage value);
62 Stage stage() const override { return m_stage; }
64 Q_INVOKABLE void setState(State value);
65 State state() const override { return m_state; }
67 void setFocused(bool value);
68 bool focused() const override { return m_focused; }
70 QString screenshot() const { return m_screenshotFileName; }
72 void setFullscreen(bool value);
73 bool fullscreen() const { return m_fullscreen; }
75 void setSurface(MirSurfaceItem* surface);
76 MirSurfaceItem* surface() const { return m_surface; }
78 void removeSurface(MirSurfaceItem* surface);
80 void addPromptSurface(MirSurfaceItem* surface);
81 QList<MirSurfaceItem*> promptSurfaceList() const;
82 QQmlListProperty<MirSurfaceItem> promptSurfaces();
84 bool manualSurfaceCreation() const { return m_manualSurfaceCreation; }
85 void setManualSurfaceCreation(bool value);
88 void surfaceChanged(MirSurfaceItem*);
89 void promptSurfacesChanged();
90 void fullscreenChanged(bool value);
91 void manualSurfaceCreationChanged(bool value);
94 Q_INVOKABLE void createSurface();
97 static int promptSurfaceCount(QQmlListProperty<MirSurfaceItem> *prop);
98 static MirSurfaceItem* promptSurfaceAt(QQmlListProperty<MirSurfaceItem> *prop, int index);
99 void setIcon(const QUrl &value);
100 void setScreenshot(const QUrl &value);
102 QString m_screenshotFileName;
111 MirSurfaceItem* m_surface;
113 bool m_manualSurfaceCreation;
115 QQuickItem *m_parentItem;
116 QList<MirSurfaceItem*> m_promptSurfaces;
119Q_DECLARE_METATYPE(ApplicationInfo*)
120Q_DECLARE_METATYPE(QQmlListProperty<MirSurfaceItem>)
122#endif // APPLICATION_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