Unity Scopes API
QCategory.h
1 /*
2  * Copyright (C) 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 version 3 as
6  * published by the Free Software Foundation.
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  * Authored by: Xavi Garcia <xavi.garcia.mena@canonical.com>
17  */
18 
19 #pragma once
20 
21 #include <unity/util/NonCopyable.h>
22 #include <unity/util/DefinesPtrs.h>
23 
24 #include <unity/scopes/Category.h>
25 
26 #include <QtCore/QString>
27 #include <QtCore/QVariantMap>
28 
29 class QCategorisedResult_test;
30 
31 namespace unity
32 {
33 
34 namespace scopes
35 {
36 
37 namespace qt
38 {
39 
40 namespace internal
41 {
42 class QSearchReplyImpl;
43 class QCategoryImpl;
44 class QCategorisedResultImpl;
45 }
46 
53 class QCategory
54 {
55 public:
57  NONCOPYABLE(QCategory);
58  UNITY_DEFINES_PTRS(QCategory);
59 
60  virtual ~QCategory();
62 
67  QString id() const;
68 
73  QString title() const;
74 
79  QString icon() const;
80 
85  CannedQuery::SCPtr query() const;
86 
91  CategoryRenderer const& renderer_template() const;
92 
93  // @cond
94  QVariantMap serialize() const;
95 
96 private:
98  QCategory(unity::scopes::Category::SCPtr category);
99  QCategory(internal::QCategoryImpl* impl);
100  friend class unity::scopes::qt::internal::QSearchReplyImpl;
101 
102  std::unique_ptr<internal::QCategoryImpl> p;
103  friend class internal::QCategoryImpl;
104  friend class internal::QCategorisedResultImpl;
106 };
107 
108 } // namespace qt
109 
110 } // namespace scopes
111 
112 } // namespace unity
CategoryRenderer const & renderer_template() const
Get renderer template of this Category.
Definition: HttpAsyncReader.h:45
A set of related results returned by a scope and displayed within a single pane in the Unity dash...
Definition: QCategory.h:53
A category renderer template in JSON format.
Definition: CategoryRenderer.h:83
QString title() const
Get title of this Category.
Top-level namespace for all things Unity-related.
Definition: Version.h:49
Definition: ActionMetadata.h:31
QString icon() const
Get icon of this Category.
QString id() const
Get identifier of this Category.
CannedQuery::SCPtr query() const
Query to perform when this category is expanded.