My Project
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Macros
ApplicationInfoInterface.h
1 /*
2  * Copyright 2013 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  */
19 
20 #ifndef UNITY_SHELL_APPLICATION_APPLICATIONINFOINTERFACE_H
21 #define UNITY_SHELL_APPLICATION_APPLICATIONINFOINTERFACE_H
22 
23 #include <unity/SymbolExport.h>
24 
25 #include <QtCore/QObject>
26 #include <QtCore/QUrl>
27 #include <QColor>
28 
29 namespace unity
30 {
31 namespace shell
32 {
33 namespace application
34 {
35 
43 class UNITY_API ApplicationInfoInterface: public QObject
44 {
45  Q_OBJECT
46 
47  Q_ENUMS(Stage)
48  Q_ENUMS(State)
49 
50 
56  Q_PROPERTY(QString appId READ appId CONSTANT)
57 
58 
63  Q_PROPERTY(QString name READ name NOTIFY nameChanged)
64 
65 
71  Q_PROPERTY(QString comment READ comment NOTIFY commentChanged)
72 
73 
78  Q_PROPERTY(QUrl icon READ icon NOTIFY iconChanged)
79 
80 
85  Q_PROPERTY(Stage stage READ stage NOTIFY stageChanged)
86 
87 
92  Q_PROPERTY(State state READ state NOTIFY stateChanged)
93 
94 
99  Q_PROPERTY(bool focused READ focused NOTIFY focusedChanged)
100 
101 
110  Q_PROPERTY(QString splashTitle READ splashTitle CONSTANT)
111 
112 
122  Q_PROPERTY(QUrl splashImage READ splashImage CONSTANT)
123 
124 
140  Q_PROPERTY(bool splashShowHeader READ splashShowHeader CONSTANT)
141 
142 
151  Q_PROPERTY(QColor splashColor READ splashColor CONSTANT)
152 
153 
164  Q_PROPERTY(QColor splashColorHeader READ splashColorHeader CONSTANT)
165 
166 
177  Q_PROPERTY(QColor splashColorFooter READ splashColorFooter CONSTANT)
178 
179 protected:
181  ApplicationInfoInterface(const QString &appId, QObject* parent = 0): QObject(parent) { Q_UNUSED(appId) }
183 
184 public:
193  enum Stage {
194  MainStage,
195  SideStage
196  };
197 
210  enum State {
211  Starting,
212  Running,
213  Suspended,
214  Stopped
215  };
216 
218  virtual ~ApplicationInfoInterface() {}
219 
220  virtual QString appId() const = 0;
221  virtual QString name() const = 0;
222  virtual QString comment() const = 0;
223  virtual QUrl icon() const = 0;
224  virtual Stage stage() const = 0;
225  virtual State state() const = 0;
226  virtual bool focused() const = 0;
227  virtual QString splashTitle() const = 0;
228  virtual QUrl splashImage() const = 0;
229  virtual bool splashShowHeader() const = 0;
230  virtual QColor splashColor() const = 0;
231  virtual QColor splashColorHeader() const = 0;
232  virtual QColor splashColorFooter() const = 0;
234 
235 Q_SIGNALS:
237  void nameChanged(const QString &name);
238  void commentChanged(const QString &comment);
239  void iconChanged(const QUrl &icon);
240  void stageChanged(Stage stage);
241  void stateChanged(State state);
242  void focusedChanged(bool focused);
244 };
245 
246 } // namespace application
247 } // namespace shell
248 } // namespace unity
249 
250 #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:193
State
An application's state.
Definition: ApplicationInfoInterface.h:210
A class that holds information about applications.
Definition: ApplicationInfoInterface.h:43