My Project
ApplicationInfoInterface.h
1 /*
2  * Copyright 2013,2015 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  * Authors:
17  * Michael Zanetti <michael.zanetti@canonical.com>
18  * Daniel d'Andrada <daniel.dandrada@canonical.com>
19  */
20 
21 #ifndef UNITY_SHELL_APPLICATION_APPLICATIONINFOINTERFACE_H
22 #define UNITY_SHELL_APPLICATION_APPLICATIONINFOINTERFACE_H
23 
24 #include <unity/SymbolExport.h>
25 
26 #include <QtCore/QObject>
27 #include <QtCore/QUrl>
28 #include <QColor>
29 
30 namespace unity
31 {
32 namespace shell
33 {
34 namespace application
35 {
36 
44 class UNITY_API ApplicationInfoInterface: public QObject
45 {
46  Q_OBJECT
47 
48  Q_ENUMS(Stage)
49  Q_ENUMS(State)
50 
51 
57  Q_PROPERTY(QString appId READ appId CONSTANT)
58 
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(Stage stage READ stage NOTIFY stageChanged)
87 
93  Q_PROPERTY(State state READ state NOTIFY stateChanged)
94 
100  Q_PROPERTY(bool focused READ focused NOTIFY focusedChanged)
101 
111  Q_PROPERTY(QString splashTitle READ splashTitle CONSTANT)
112 
123  Q_PROPERTY(QUrl splashImage READ splashImage CONSTANT)
124 
141  Q_PROPERTY(bool splashShowHeader READ splashShowHeader CONSTANT)
142 
152  Q_PROPERTY(QColor splashColor READ splashColor CONSTANT)
153 
165  Q_PROPERTY(QColor splashColorHeader READ splashColorHeader CONSTANT)
166 
178  Q_PROPERTY(QColor splashColorFooter READ splashColorFooter CONSTANT)
179 
184  Q_PROPERTY(Qt::ScreenOrientations supportedOrientations READ supportedOrientations CONSTANT)
185 
198  Q_PROPERTY(bool rotatesWindowContents READ rotatesWindowContents CONSTANT)
199 
200 protected:
202  ApplicationInfoInterface(const QString &appId, QObject* parent = 0): QObject(parent) { Q_UNUSED(appId) }
204 
205 public:
214  enum Stage {
215  MainStage,
216  SideStage
217  };
218 
231  enum State {
232  Starting,
233  Running,
234  Suspended,
235  Stopped
236  };
237 
239  virtual ~ApplicationInfoInterface() {}
240 
241  virtual QString appId() const = 0;
242  virtual QString name() const = 0;
243  virtual QString comment() const = 0;
244  virtual QUrl icon() const = 0;
245  virtual Stage stage() const = 0;
246  virtual State state() const = 0;
247  virtual bool focused() const = 0;
248  virtual QString splashTitle() const = 0;
249  virtual QUrl splashImage() const = 0;
250  virtual bool splashShowHeader() const = 0;
251  virtual QColor splashColor() const = 0;
252  virtual QColor splashColorHeader() const = 0;
253  virtual QColor splashColorFooter() const = 0;
254  virtual Qt::ScreenOrientations supportedOrientations() const = 0;
255  virtual bool rotatesWindowContents() const = 0;
257 
258 Q_SIGNALS:
260  void nameChanged(const QString &name);
261  void commentChanged(const QString &comment);
262  void iconChanged(const QUrl &icon);
263  void stageChanged(Stage stage);
264  void stateChanged(State state);
265  void focusedChanged(bool focused);
267 };
268 
269 } // namespace application
270 } // namespace shell
271 } // namespace unity
272 
273 #endif // UNITY_SHELL_APPLICATIONMANAGER_APPLICATIONINFOINTERFACE_H
Top-level namespace for all things Unity-related.
Definition: Version.h:37
Stage
A enum that defines a stage.
Definition: ApplicationInfoInterface.h:214
State
An application's state.
Definition: ApplicationInfoInterface.h:231
A class that holds information about applications.
Definition: ApplicationInfoInterface.h:44