My Project
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Properties 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 
28 namespace unity
29 {
30 namespace shell
31 {
32 namespace application
33 {
34 
42 class UNITY_API ApplicationInfoInterface: public QObject
43 {
44  Q_OBJECT
45 
46  Q_ENUMS(Stage)
47  Q_ENUMS(State)
48 
49 
55  Q_PROPERTY(QString appId READ appId CONSTANT)
56 
62  Q_PROPERTY(QString name READ name NOTIFY nameChanged)
63 
70  Q_PROPERTY(QString comment READ comment NOTIFY commentChanged)
71 
77  Q_PROPERTY(QUrl icon READ icon NOTIFY iconChanged)
78 
84  Q_PROPERTY(Stage stage READ stage NOTIFY stageChanged)
85 
91  Q_PROPERTY(State state READ state NOTIFY stateChanged)
92 
98  Q_PROPERTY(bool focused READ focused NOTIFY focusedChanged)
99 
105  Q_PROPERTY(QUrl screenshot READ screenshot NOTIFY screenshotChanged)
106 
107 protected:
109  ApplicationInfoInterface(const QString &appId, QObject* parent = 0): QObject(parent) { Q_UNUSED(appId) }
111 
112 public:
121  enum Stage {
122  MainStage,
123  SideStage
124  };
125 
138  enum State {
139  Starting,
140  Running,
141  Suspended,
142  Stopped
143  };
144 
146  virtual ~ApplicationInfoInterface() {}
147 
148  virtual QString appId() const = 0;
149  virtual QString name() const = 0;
150  virtual QString comment() const = 0;
151  virtual QUrl icon() const = 0;
152  virtual Stage stage() const = 0;
153  virtual State state() const = 0;
154  virtual bool focused() const = 0;
155  virtual QUrl screenshot() const = 0;
157 
158 Q_SIGNALS:
160  void nameChanged(const QString &name);
161  void commentChanged(const QString &comment);
162  void iconChanged(const QUrl &icon);
163  void stageChanged(Stage stage);
164  void stateChanged(State state);
165  void focusedChanged(bool focused);
166  void screenshotChanged(const QUrl &screenshot);
168 };
169 
170 } // namespace application
171 } // namespace shell
172 } // namespace unity
173 
174 #endif // UNITY_SHELL_APPLICATIONMANAGER_APPLICATIONINFOINTERFACE_H
Stage
A enum that defines a stage.
Definition: ApplicationInfoInterface.h:121
State
An application's state.
Definition: ApplicationInfoInterface.h:138
A class that holds information about applications.
Definition: ApplicationInfoInterface.h:42