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 
121  Q_PROPERTY(unity::shell::launcher::QuickListModelInterface* quickList READ quickList CONSTANT)
122 
123 protected:
125  LauncherItemInterface(QObject *parent = 0): QObject(parent) {}
126 
127 public:
128  virtual ~LauncherItemInterface() {}
129 
130  virtual QString appId() const = 0;
131  virtual QString name() const = 0;
132  virtual QString icon() const = 0;
133  virtual bool pinned() const = 0;
134  virtual bool running() const = 0;
135  virtual bool recent() const = 0;
136  virtual int progress() const = 0;
137  virtual int count() const = 0;
138  virtual bool countVisible() const = 0;
139  virtual bool focused() const = 0;
140  virtual bool alerting() const = 0;
141  virtual unity::shell::launcher::QuickListModelInterface *quickList() const = 0;
142 
143 Q_SIGNALS:
144  void nameChanged(const QString &name);
145  void iconChanged(const QString &icon);
146  void pinnedChanged(bool pinned);
147  void runningChanged(bool running);
148  void recentChanged(bool running);
149  void progressChanged(int progress);
150  void countChanged(int count);
151  void countVisibleChanged(bool countVisible);
152  void focusedChanged(bool focused);
153  void alertingChanged(bool alerting);
155 };
156 
157 } // namespace launcher
158 } // namespace shell
159 } // namespace unity
160 
161 #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