My Project
QuickListModelInterface.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_QUICKLISTMODELINTERFACE_H
21 #define UNITY_SHELL_LAUNCHER_QUICKLISTMODELINTERFACE_H
22 
23 #include <unity/SymbolExport.h>
24 
25 #include <QtCore/QAbstractListModel>
26 
27 namespace unity
28 {
29 namespace shell
30 {
31 namespace launcher
32 {
33 
42 class UNITY_API QuickListModelInterface: public QAbstractListModel
43 {
44  Q_OBJECT
45 
46 protected:
48  explicit QuickListModelInterface(QObject *parent = 0) : QAbstractListModel(parent) {
49  m_roleNames.insert(RoleLabel, "label");
50  m_roleNames.insert(RoleIcon, "icon");
51  m_roleNames.insert(RoleClickable, "clickable");
52  }
54 public:
60  enum Roles {
61  RoleLabel,
62  RoleIcon,
63  RoleClickable
64  };
65 
67  virtual ~QuickListModelInterface() {}
69 
71  QHash<int, QByteArray> roleNames() const {
72  return m_roleNames;
73  }
75 
76 protected:
78  QHash<int, QByteArray> m_roleNames;
80 
81 };
82 
83 } // launcher
84 } // shell
85 } // unity
86 
87 #endif // UNITY_SHELL_LAUNCHER_QUICKLISTMODELINTERFACE_H
Top-level namespace for all things Unity-related.
Definition: Version.h:37
Roles
The Roles supported by the model.
Definition: QuickListModelInterface.h:60
A model containing QuickList actions for an application in the launcher.
Definition: QuickListModelInterface.h:42