Unity Scopes API
QCategorisedResult.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/scopes/qt/QResult.h>
26 #include <unity/scopes/qt/QCategory.h>
27 
28 namespace unity
29 {
30 
31 namespace scopes
32 {
33 
34 namespace qt
35 {
36 
37 namespace internal
38 {
39 class QSearchReplyImpl;
40 class QCategorisedResultImpl;
41 }
42 
47 class QCategorisedResult final : public QResult
48 {
49 public:
51  UNITY_DEFINES_PTRS(QCategorisedResult);
53 
59  explicit QCategorisedResult(QCategory::SCPtr category);
60 
64  //{@
66  QCategorisedResult& operator=(QCategorisedResult const& other);
70 
75  void set_category(QCategory::SCPtr category);
76 
82  QCategory::SCPtr category() const;
83 
84 private:
86  internal::QCategorisedResultImpl* fwd() const;
88 
89  friend class internal::QSearchReplyImpl;
90 };
91 
92 } // namespace qt
93 
94 } // namespace scopes
95 
96 } // namespace unity
A result, including the category it belongs to.
Definition: QCategorisedResult.h:47
QCategory::SCPtr category() const
Return category of this result. Get the category instance this result belongs to. ...
QCategorisedResult(QCategory::SCPtr category)
Creates a CategorisedResult with given category, with all base attributes initially empty...
Top-level namespace for all things Unity-related.
Definition: Version.h:49
The attributes of a result returned by a Scope.
Definition: QResult.h:63
Definition: ActionMetadata.h:31
void set_category(QCategory::SCPtr category)
Updates the category of this result.