My Project
Loading...
Searching...
No Matches
ApplicationInfoInterface.h
1/*
2 * Copyright 2013,2015,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 Lesser 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 Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef LOMIRI_SHELL_APPLICATION_APPLICATIONINFOINTERFACE_H
18#define LOMIRI_SHELL_APPLICATION_APPLICATIONINFOINTERFACE_H
19
20#include <lomiri/SymbolExport.h>
21
22#include <QtCore/QObject>
23#include <QtCore/QUrl>
24#include <QColor>
25#include <QSize>
26
27#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
28Q_MOC_INCLUDE("MirSurfaceListInterface.h")
29#endif
30
31namespace lomiri
32{
33namespace shell
34{
35namespace application
36{
37
38class MirSurfaceListInterface;
39
47class LOMIRI_API ApplicationInfoInterface: public QObject
48{
49 Q_OBJECT
50
57 Q_PROPERTY(QString appId READ appId CONSTANT)
58
59
64 Q_PROPERTY(QString name READ name NOTIFY nameChanged)
65
72 Q_PROPERTY(QString comment READ comment NOTIFY commentChanged)
73
79 Q_PROPERTY(QUrl icon READ icon NOTIFY iconChanged)
80
86 Q_PROPERTY(State state READ state NOTIFY stateChanged)
87
91 Q_PROPERTY(RequestedState requestedState READ requestedState WRITE setRequestedState NOTIFY requestedStateChanged)
92
98 Q_PROPERTY(bool focused READ focused NOTIFY focusedChanged)
99
106 Q_PROPERTY(bool showSplash READ showSplash CONSTANT)
107
117 Q_PROPERTY(QString splashTitle READ splashTitle CONSTANT)
118
129 Q_PROPERTY(QUrl splashImage READ splashImage CONSTANT)
130
147 Q_PROPERTY(bool splashShowHeader READ splashShowHeader CONSTANT)
148
158 Q_PROPERTY(QColor splashColor READ splashColor CONSTANT)
159
171 Q_PROPERTY(QColor splashColorHeader READ splashColorHeader CONSTANT)
172
184 Q_PROPERTY(QColor splashColorFooter READ splashColorFooter CONSTANT)
185
190 Q_PROPERTY(Qt::ScreenOrientations supportedOrientations READ supportedOrientations CONSTANT)
191
204 Q_PROPERTY(bool rotatesWindowContents READ rotatesWindowContents CONSTANT)
205
209 Q_PROPERTY(bool isTouchApp READ isTouchApp CONSTANT)
210
216 Q_PROPERTY(bool exemptFromLifecycle READ exemptFromLifecycle WRITE setExemptFromLifecycle NOTIFY exemptFromLifecycleChanged)
217
221 Q_PROPERTY(QSize initialSurfaceSize READ initialSurfaceSize WRITE setInitialSurfaceSize NOTIFY initialSurfaceSizeChanged)
222
226 Q_PROPERTY(lomiri::shell::application::MirSurfaceListInterface* surfaceList READ surfaceList CONSTANT)
227
231 Q_PROPERTY(lomiri::shell::application::MirSurfaceListInterface* promptSurfaceList READ promptSurfaceList CONSTANT)
232
241 Q_PROPERTY(int surfaceCount READ surfaceCount NOTIFY surfaceCountChanged)
242
249 Q_PROPERTY(bool serverSideDecoration READ serverSideDecoration NOTIFY serverSideDecorationChanged)
250
251protected:
253 ApplicationInfoInterface(const QString &appId, QObject* parent = 0): QObject(parent) { Q_UNUSED(appId) }
255
256public:
265 enum Stage {
266 MainStage,
267 SideStage
268 };
269 Q_ENUM(Stage)
270
271
283 enum State {
284 Starting,
285 Running,
286 Suspended,
287 Stopped
288 };
289 Q_ENUM(State)
290
291
299 RequestedRunning = Running,
300 RequestedSuspended = Suspended
301 };
302 Q_ENUM(RequestedState)
303
304
307 virtual void close() = 0;
308
310 virtual ~ApplicationInfoInterface() {}
311
312 virtual QString appId() const = 0;
313 virtual QString name() const = 0;
314 virtual QString comment() const = 0;
315 virtual QUrl icon() const = 0;
316 virtual State state() const = 0;
317 virtual RequestedState requestedState() const = 0;
318 virtual void setRequestedState(RequestedState) = 0;
319 virtual bool focused() const = 0;
320 virtual bool showSplash() const = 0;
321 virtual QString splashTitle() const = 0;
322 virtual QUrl splashImage() const = 0;
323 virtual bool splashShowHeader() const = 0;
324 virtual QColor splashColor() const = 0;
325 virtual QColor splashColorHeader() const = 0;
326 virtual QColor splashColorFooter() const = 0;
327 virtual Qt::ScreenOrientations supportedOrientations() const = 0;
328 virtual bool rotatesWindowContents() const = 0;
329 virtual bool isTouchApp() const = 0;
330 virtual bool exemptFromLifecycle() const = 0;
331 virtual void setExemptFromLifecycle(bool) = 0;
332 virtual QSize initialSurfaceSize() const = 0;
333 virtual void setInitialSurfaceSize(const QSize &size) = 0;
334 virtual MirSurfaceListInterface* surfaceList() const = 0;
335 virtual MirSurfaceListInterface* promptSurfaceList() const = 0;
336 virtual int surfaceCount() const = 0;
337 virtual bool serverSideDecoration() const = 0;
339
340Q_SIGNALS:
342 void nameChanged(const QString &name);
343 void commentChanged(const QString &comment);
344 void iconChanged(const QUrl &icon);
345 void stateChanged(State state);
346 void requestedStateChanged(RequestedState value);
347 void focusedChanged(bool focused);
348 void exemptFromLifecycleChanged(bool exemptFromLifecycle);
349 void initialSurfaceSizeChanged(const QSize &size);
350 void surfaceCountChanged(int surfaceCount);
351 void serverSideDecorationChanged(bool ssd);
353
358};
359
360} // namespace application
361} // namespace shell
362} // namespace lomiri
363
365
366#endif // LOMIRI_SHELL_APPLICATIONMANAGER_APPLICATIONINFOINTERFACE_H
A class that holds information about applications.
Definition ApplicationInfoInterface.h:48
Stage
A enum that defines a stage.
Definition ApplicationInfoInterface.h:265
State
An application's state.
Definition ApplicationInfoInterface.h:283
RequestedState
The desired state of an application.
Definition ApplicationInfoInterface.h:298
void focusRequested()
The application is requesting focus.
Interface for a list model of MirSurfaces.
Definition MirSurfaceListInterface.h:36
Top-level namespace for all things Lomiri-related.
Definition Version.h:38