Unity Scopes Qt library
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 #pragma GCC diagnostic push
28 #pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
29 #include <QtCore/QVariantMap>
30 #pragma GCC diagnostic pop
31 
32 class QCategorisedResult_test;
33 
34 namespace unity
35 {
36 
37 namespace scopes
38 {
39 
40 namespace qt
41 {
42 
43 namespace internal
44 {
45 class QSearchReplyImpl;
46 class QCategoryImpl;
47 class QCategorisedResultImpl;
48 }
49 
56 class QCategory
57 {
58 public:
60  NONCOPYABLE(QCategory);
61  UNITY_DEFINES_PTRS(QCategory);
62 
63  virtual ~QCategory();
65 
70  QString id() const;
71 
76  QString title() const;
77 
82  QString icon() const;
83 
88  CannedQuery::SCPtr query() const;
89 
94  CategoryRenderer const& renderer_template() const;
95 
96  // @cond
97  QVariantMap serialize() const;
98 
99 private:
101  QCategory(unity::scopes::Category::SCPtr category);
102  QCategory(internal::QCategoryImpl* impl);
103  friend class unity::scopes::qt::internal::QSearchReplyImpl;
104 
105  std::unique_ptr<internal::QCategoryImpl> p;
106  friend class internal::QCategoryImpl;
107  friend class internal::QCategorisedResultImpl;
109 };
110 
111 } // namespace qt
112 
113 } // namespace scopes
114 
115 } // 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:56
QString title() const
Get title of this Category.
Definition: HttpAsyncReader.h:39
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.