My Project
LauncherItemInterface.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_LAUNCHER_LAUNCHERITEM_H
21 #define UNITY_SHELL_LAUNCHER_LAUNCHERITEM_H
22 
23 #include <unity/SymbolExport.h>
24 
25 #include <QtCore/QObject>
26 
27 namespace unity
28 {
29 namespace shell
30 {
31 namespace launcher
32 {
33 
34 class QuickListModelInterface;
35 
43 class UNITY_API LauncherItemInterface: public QObject
44 {
45  Q_OBJECT
46 
50  Q_PROPERTY(QString appId READ appId CONSTANT)
51 
52 
55  Q_PROPERTY(QString name READ name CONSTANT)
56 
60  Q_PROPERTY(QString icon READ icon CONSTANT)
61 
65  Q_PROPERTY(bool pinned READ pinned NOTIFY pinnedChanged)
66 
70  Q_PROPERTY(bool running READ running NOTIFY runningChanged)
71 
75  Q_PROPERTY(bool recent READ recent NOTIFY recentChanged)
76 
83  Q_PROPERTY(int progress READ progress NOTIFY progressChanged)
84 
91  Q_PROPERTY(int count READ count NOTIFY countChanged)
92 
98  Q_PROPERTY(bool countVisible READ countVisible NOTIFY countVisibleChanged)
99 
105  Q_PROPERTY(bool focused READ focused NOTIFY focusedChanged)
106 
112  Q_PROPERTY(bool alerting READ alerting NOTIFY alertingChanged)
113 
119  Q_PROPERTY(int surfaceCount READ surfaceCount NOTIFY surfaceCountChanged)
120 
128  Q_PROPERTY(unity::shell::launcher::QuickListModelInterface* quickList READ quickList CONSTANT)
129 
130 protected:
132  LauncherItemInterface(QObject *parent = 0): QObject(parent) {}
133 
134 public:
135  virtual ~LauncherItemInterface() {}
136 
137  virtual QString appId() const = 0;
138  virtual QString name() const = 0;
139  virtual QString icon() const = 0;
140  virtual bool pinned() const = 0;
141  virtual bool running() const = 0;
142  virtual bool recent() const = 0;
143  virtual int progress() const = 0;
144  virtual int count() const = 0;
145  virtual bool countVisible() const = 0;
146  virtual bool focused() const = 0;
147  virtual bool alerting() const = 0;
148  virtual int surfaceCount() const = 0;
149  virtual unity::shell::launcher::QuickListModelInterface *quickList() const = 0;
150 
151 Q_SIGNALS:
152  void nameChanged(const QString &name);
153  void iconChanged(const QString &icon);
154  void pinnedChanged(bool pinned);
155  void runningChanged(bool running);
156  void recentChanged(bool running);
157  void progressChanged(int progress);
158  void countChanged(int count);
159  void countVisibleChanged(bool countVisible);
160  void focusedChanged(bool focused);
161  void alertingChanged(bool alerting);
162  void surfaceCountChanged(int surfaceCount);
164 };
165 
166 } // namespace launcher
167 } // namespace shell
168 } // namespace unity
169 
170 #endif // UNITY_SHELL_LAUNCHER_LAUNCHERITEMINTERFACE_H
Top-level namespace for all things Unity-related.
Definition: Version.h:37
An item presented in the launcher.
Definition: LauncherItemInterface.h:43
A model containing QuickList actions for an application in the launcher.
Definition: QuickListModelInterface.h:42