Unity Scopes API
PreviewReply.h
1 /*
2  * Copyright (C) 2013 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: Michi Henning <michi.henning@canonical.com>
17  */
18 
19 #pragma once
20 
21 #include <unity/scopes/ColumnLayout.h>
22 #include <unity/scopes/PreviewReplyProxyFwd.h>
23 #include <unity/scopes/PreviewWidget.h>
24 #include <unity/scopes/Reply.h>
25 
26 #include <string>
27 
28 namespace unity
29 {
30 namespace scopes
31 {
36 class PreviewReply : public virtual Reply
37 {
38 public:
47  virtual bool register_layout(ColumnLayoutList const& layouts) = 0;
48 
55  virtual bool push(PreviewWidgetList const& widget_list) = 0;
56 
61  virtual bool push(std::string const& key, Variant const& value) = 0;
62 
64  virtual ~PreviewReply();
66 
67 protected:
69  PreviewReply();
71 };
72 
73 } // namespace scopes
74 
75 } // namespace unity
std::list< ColumnLayout > ColumnLayoutList
List of column layouts (see unity::scopes::ColumnLayout)
Definition: ColumnLayout.h:111
virtual bool register_layout(ColumnLayoutList const &layouts)=0
Registers a list of column layouts for the current preview.
Simple variant class that can hold an integer, boolean, string, double, dictionary, array or null value.
Definition: Variant.h:57
Allows query termination to be sent to the source of a query.
Definition: Reply.h:37
Allows the results of a preview to be sent to the preview requester.
Definition: PreviewReply.h:36
Top-level namespace for all things Unity-related.
Definition: Version.h:49
virtual bool push(PreviewWidgetList const &widget_list)=0
Sends widget definitions to the sender of the preview query.
std::list< PreviewWidget > PreviewWidgetList
List of preview widgets (see unity::scopes::PreviewWidget)
Definition: PreviewWidget.h:45