Unity 8
launcheritem.h
1 /*
2  * Copyright 2014-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 
17 #ifndef LAUNCHERITEM_H
18 #define LAUNCHERITEM_H
19 
20 #include "quicklistmodel.h"
21 
22 #include <unity/shell/launcher/LauncherItemInterface.h>
23 
24 class QuickListModel;
25 
26 using namespace unity::shell::launcher;
27 
28 class LauncherItem: public LauncherItemInterface
29 {
30  Q_OBJECT
31 public:
32  LauncherItem(const QString &appId, const QString &name, const QString &icon, QObject *parent = 0);
33 
34  QString appId() const override;
35  QString name() const override;
36  QString icon() const override;
37  QStringList keywords() const override;
38  uint popularity() const override;
39  bool pinned() const override;
40  bool running() const override;
41  bool recent() const override;
42  int progress() const override;
43  int count() const override;
44  bool countVisible() const override;
45  bool focused() const override;
46  bool alerting() const override;
47  int surfaceCount() const override;
48 
49  unity::shell::launcher::QuickListModelInterface *quickList() const override;
50 
51 private:
52  void setName(const QString &name);
53  void setIcon(const QString &icon);
54  void setKeywords(const QStringList &keywords);
55  void setPinned(bool pinned);
56  void setRunning(bool running);
57  void setRecent(bool recent);
58  void setProgress(int progress);
59  void setCount(int count);
60  void setCountVisible(bool countVisible);
61  void setFocused(bool focused);
62  void setAlerting(bool alerting);
63  void setSurfaceCount(int surfaceCount);
64 
65 private:
66  QString m_appId;
67  QString m_name;
68  QString m_icon;
69  QStringList m_keywords;
70  bool m_pinned;
71  bool m_running;
72  bool m_recent;
73  int m_progress;
74  int m_count;
75  bool m_countVisible;
76  bool m_focused;
77  bool m_alerting;
78  int m_surfaceCount;
79  QuickListModel *m_quickList;
80 
81  friend class LauncherModel;
82 };
83 
84 #endif // LAUNCHERITEM_H