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 #ifndef _ENABLE_QT_EXPERIMENTAL_
22 #error You should define _ENABLE_QT_EXPERIMENTAL_ in order to use this experimental header file.
23 #endif
24 
25 #include <unity/util/NonCopyable.h>
26 #include <unity/util/DefinesPtrs.h>
27 
28 #include <unity/scopes/Category.h>
29 
30 #include <QtCore/QString>
31 #pragma GCC diagnostic push
32 #pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
33 #include <QtCore/QVariantMap>
34 #pragma GCC diagnostic pop
35 
36 class QCategorisedResult_test;
37 
38 namespace unity
39 {
40 
41 namespace scopes
42 {
43 
44 namespace qt
45 {
46 
47 namespace internal
48 {
49 class QSearchReplyImpl;
50 class QCategoryImpl;
51 class QCategorisedResultImpl;
52 }
53 
60 class QCategory
61 {
62 public:
64  NONCOPYABLE(QCategory);
65  UNITY_DEFINES_PTRS(QCategory);
66 
67  virtual ~QCategory();
69 
74  QString id() const;
75 
80  QString title() const;
81 
86  QString icon() const;
87 
92  CannedQuery::SCPtr query() const;
93 
98  CategoryRenderer const& renderer_template() const;
99 
100  // @cond
101  QVariantMap serialize() const;
102 
103 private:
105  QCategory(unity::scopes::Category::SCPtr category);
106  QCategory(internal::QCategoryImpl* impl);
107  friend class unity::scopes::qt::internal::QSearchReplyImpl;
108 
109  std::unique_ptr<internal::QCategoryImpl> p;
110  friend class internal::QCategoryImpl;
111  friend class internal::QCategorisedResultImpl;
113 };
114 
115 } // namespace qt
116 
117 } // namespace scopes
118 
119 } // namespace unity
CategoryRenderer const & renderer_template() const
Get renderer template of this Category.
A set of related results returned by a scope and displayed within a single pane in the Unity dash...
Definition: QCategory.h:60
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.