Unity Scopes API
PreviewListenerBase.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/ListenerBase.h>
22 #include <unity/util/DefinesPtrs.h>
23 #include <unity/util/NonCopyable.h>
24 #include <unity/scopes/PreviewWidget.h>
25 #include <unity/scopes/ColumnLayout.h>
26 #include <unity/scopes/Variant.h>
27 
28 #include <string>
29 
30 namespace unity
31 {
32 
33 namespace scopes
34 {
35 
45 {
46 public:
48  NONCOPYABLE(PreviewListenerBase);
49  UNITY_DEFINES_PTRS(PreviewListenerBase);
50 
51  virtual ~PreviewListenerBase();
53 
57  virtual void push(ColumnLayoutList const& layouts) = 0;
58 
62  virtual void push(PreviewWidgetList const&) = 0;
63 
67  virtual void push(std::string const& key, Variant const& value) = 0;
68 
69 protected:
73 };
74 
75 } // namespace scopes
76 
77 } // namespace unity
Abstract base class for a scope to respond to preview requests.
Definition: PreviewListenerBase.h:44
std::list< ColumnLayout > ColumnLayoutList
List of column layouts (see unity::scopes::ColumnLayout)
Definition: ColumnLayout.h:111
Simple variant class that can hold an integer, boolean, string, double, dictionary, array or null value.
Definition: Variant.h:57
Top-level namespace for all things Unity-related.
Definition: Version.h:49
virtual void push(ColumnLayoutList const &layouts)=0
Called by the scopes runtime for each column layout definition returned by preview().
std::list< PreviewWidget > PreviewWidgetList
List of preview widgets (see unity::scopes::PreviewWidget)
Definition: PreviewWidget.h:45
Abstract base class to be notified of request completion (such as a query or activation request)...
Definition: ListenerBase.h:43