Unity Scopes Qt library
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 #pragma GCC diagnostic push
30 #pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
31 #include <QtCore/QVariant>
32 #pragma GCC diagnostic pop
33 #include <QtCore/QObject>
34 
35 namespace unity
36 {
37 
38 namespace scopes
39 {
40 
41 namespace qt
42 {
43 
44 class QPreviewQueryBaseAPI;
45 
46 namespace internal
47 {
48 class QPreviewReplyImpl;
49 }
50 
55 class QPreviewReply : public QObject
56 {
57  Q_OBJECT
58 public:
60  NONCOPYABLE(QPreviewReply);
61  UNITY_DEFINES_PTRS(QPreviewReply);
63 
71  bool register_layout(QColumnLayoutList const& layouts);
72 
79  bool push(QPreviewWidgetList const& widget_list);
80 
85  bool push(QString const& key, QVariant const& value);
86 
88  virtual ~QPreviewReply();
90 
91 protected:
93  QPreviewReply(unity::scopes::PreviewReplyProxy& reply, QObject* parent = 0);
94 
95 private:
96  std::unique_ptr<internal::QPreviewReplyImpl> p;
97  friend class internal::QPreviewReplyImpl;
98  friend class QPreviewQueryBaseAPI;
100 };
101 
102 } // namespace qt
103 
104 } // namespace scopes
105 
106 } // namespace unity
Definition: HttpAsyncReader.h:39
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.
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:55