2 * Copyright (C) 2013-2016 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/>.
26#include <unity/shell/application/ApplicationInfoInterface.h>
27#include <unity/shell/application/Mir.h>
29using namespace unity::shell::application;
31class ApplicationInfo : public ApplicationInfoInterface {
34 Q_PROPERTY(bool fullscreen READ fullscreen WRITE setFullscreen NOTIFY fullscreenChanged)
35 Q_PROPERTY(Session* session READ session NOTIFY sessionChanged)
37 // Only exists in this fake implementation
39 // whether the test code will explicitly control the creation of the application surface
40 Q_PROPERTY(bool manualSurfaceCreation READ manualSurfaceCreation WRITE setManualSurfaceCreation NOTIFY manualSurfaceCreationChanged)
43 ApplicationInfo(QObject *parent = nullptr);
44 ApplicationInfo(const QString &appId, QObject *parent = nullptr);
47 RequestedState requestedState() const override;
48 void setRequestedState(RequestedState) override;
50 void setIconId(const QString &iconId);
51 void setScreenshotId(const QString &screenshotId);
53 void setAppId(const QString &value) { m_appId = value; }
54 QString appId() const override { return m_appId; }
56 void setName(const QString &value);
57 QString name() const override { return m_name; }
59 QString comment() const override { return QString(); }
61 QUrl icon() const override { return m_icon; }
63 Q_INVOKABLE void setStage(Stage value); // invokable only for mock
64 Stage stage() const override { return m_stage; }
66 Q_INVOKABLE void setState(State value);
67 State state() const override { return m_state; }
69 void setFocused(bool value);
70 bool focused() const override { return m_focused; }
72 QString splashTitle() const override { return QString(); }
73 QUrl splashImage() const override { return QUrl(); }
74 bool splashShowHeader() const override { return false; }
75 QColor splashColor() const override { return QColor(0,0,0,0); }
76 QColor splashColorHeader() const override { return QColor(0,0,0,0); }
77 QColor splashColorFooter() const override { return QColor(0,0,0,0); }
79 QString screenshot() const { return m_screenshotFileName; }
81 void setFullscreen(bool value);
82 bool fullscreen() const;
84 Qt::ScreenOrientations supportedOrientations() const override;
85 void setSupportedOrientations(Qt::ScreenOrientations orientations);
87 bool rotatesWindowContents() const override;
88 void setRotatesWindowContents(bool value);
90 bool manualSurfaceCreation() const { return m_manualSurfaceCreation; }
91 void setManualSurfaceCreation(bool value);
93 bool isTouchApp() const override;
94 void setIsTouchApp(bool isTouchApp); // only in mock
96 bool exemptFromLifecycle() const override;
97 void setExemptFromLifecycle(bool) override;
99 QSize initialSurfaceSize() const override;
100 void setInitialSurfaceSize(const QSize &size) override;
102 Q_INVOKABLE void setShellChrome(Mir::ShellChrome shellChrome);
104 void setSession(Session* session);
105 Session* session() const { return m_session; }
108 void sessionChanged(Session*);
109 void fullscreenChanged(bool value);
110 void manualSurfaceCreationChanged(bool value);
113 Q_INVOKABLE void createSession();
114 Q_INVOKABLE void destroySession();
117 void onSessionSurfaceAdded(MirSurface*);
120 void setIcon(const QUrl &value);
122 QString m_screenshotFileName;
132 Qt::ScreenOrientations m_supportedOrientations;
133 bool m_rotatesWindowContents;
134 RequestedState m_requestedState;
136 bool m_exemptFromLifecycle;
137 QSize m_initialSurfaceSize;
139 bool m_manualSurfaceCreation;
140 Mir::ShellChrome m_shellChrome;
143Q_DECLARE_METATYPE(ApplicationInfo*)
145#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