My Project
PreviewWidgetModelInterface.h
1 /*
2  * Copyright (C) 2014 Canonical, Ltd.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU 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 General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef UNITY_SHELL_SCOPES_PREVIEWWIDGETMODELINTERFACE_H
18 #define UNITY_SHELL_SCOPES_PREVIEWWIDGETMODELINTERFACE_H
19 
20 #include <unity/SymbolExport.h>
21 
22 #include <QAbstractListModel>
23 
24 namespace unity
25 {
26 namespace shell
27 {
28 namespace scopes
29 {
30 
36 class UNITY_API PreviewWidgetModelInterface : public QAbstractListModel
37 {
38  Q_OBJECT
39 
40 protected:
42  explicit PreviewWidgetModelInterface(QObject* parent = 0) : QAbstractListModel(parent) { }
44 
45 public:
49  enum Roles {
50  RoleWidgetId,
51  RoleType,
52  RoleProperties
53  };
54  Q_ENUM(Roles)
55 
56  // @cond
57  QHash<int, QByteArray> roleNames() const override
58  {
59  QHash<int, QByteArray> roles;
60  roles[RoleWidgetId] = "widgetId";
61  roles[RoleType] = "type";
62  roles[RoleProperties] = "properties";
63  return roles;
64  }
65  // @endcond
66 };
67 
68 }
69 }
70 }
71 
73 
74 #endif
unity::shell::scopes::PreviewWidgetModelInterface::Roles
Roles
The roles supported by this model.
Definition: PreviewWidgetModelInterface.h:49
unity
Top-level namespace for all things Unity-related.
Definition: Version.h:37
unity::shell::scopes::PreviewWidgetModelInterface
A list of widgets in a preview.
Definition: PreviewWidgetModelInterface.h:36