Unity Scopes API
QPreviewReply.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/DefinesPtrs.h>
22 #include <unity/util/NonCopyable.h>
23 
24 #include <unity/scopes/PreviewReplyProxyFwd.h>
25 
26 #include <unity/scopes/qt/QColumnLayout.h>
27 #include <unity/scopes/qt/QPreviewWidget.h>
28 
29 #include <QtCore/QVariant>
30 #include <QtCore/QObject>
31 
32 namespace unity
33 {
34 
35 namespace scopes
36 {
37 
38 namespace qt
39 {
40 
41 class QPreviewQueryBaseAPI;
42 
43 namespace internal
44 {
45 class QPreviewReplyImpl;
46 }
47 
52 class QPreviewReply : public QObject
53 {
54  Q_OBJECT
55 public:
57  NONCOPYABLE(QPreviewReply);
58  UNITY_DEFINES_PTRS(QPreviewReply);
60 
68  bool register_layout(QColumnLayoutList const& layouts);
69 
76  bool push(QPreviewWidgetList const& widget_list);
77 
82  bool push(QString const& key, QVariant const& value);
83 
85  virtual ~QPreviewReply();
87 
88 protected:
90  QPreviewReply(unity::scopes::PreviewReplyProxy& reply, QObject* parent = 0);
91 
92 private:
93  std::unique_ptr<internal::QPreviewReplyImpl> p;
94  friend class internal::QPreviewReplyImpl;
95  friend class QPreviewQueryBaseAPI;
97 };
98 
99 } // namespace qt
100 
101 } // namespace scopes
102 
103 } // namespace unity
Definition: HttpAsyncReader.h:45
Top-level namespace for all things Unity-related.
Definition: Version.h:49
Definition: ActionMetadata.h:31
bool push(QPreviewWidgetList const &widget_list)
Sends widget definitions to the sender of the preview query.
bool register_layout(QColumnLayoutList const &layouts)
Registers a list of column layouts for the current preview.
std::shared_ptr< PreviewReply > PreviewReplyProxy
Convenience type definition.
Definition: PreviewReplyProxyFwd.h:34
Abstract base class to represent a particular preview.
Definition: QPreviewQueryBaseAPI.h:63
Allows the results of a preview to be sent to the preview requester.
Definition: QPreviewReply.h:52