Unity Scopes API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 #ifndef UNITY_SCOPES_PREVIEWLISTENERBASE_H
20 #define UNITY_SCOPES_PREVIEWLISTENERBASE_H
21 
22 #include <unity/scopes/ListenerBase.h>
23 #include <unity/util/DefinesPtrs.h>
24 #include <unity/util/NonCopyable.h>
25 #include <unity/scopes/PreviewWidget.h>
26 #include <unity/scopes/ColumnLayout.h>
27 #include <unity/scopes/Variant.h>
28 
29 #include <string>
30 
31 namespace unity
32 {
33 
34 namespace scopes
35 {
36 
44 {
45 public:
47  NONCOPYABLE(PreviewListenerBase);
48  UNITY_DEFINES_PTRS(PreviewListenerBase);
49 
50  virtual ~PreviewListenerBase();
52 
56  virtual void push(ColumnLayoutList const& layouts) = 0;
57 
61  virtual void push(PreviewWidgetList const&) = 0;
62 
66  virtual void push(std::string const& key, Variant const& value) = 0;
67 
68 protected:
72 };
73 
74 } // namespace scopes
75 
76 } // namespace unity
77 
78 #endif
Abstract base class for a scope to respond to preview requests.
Definition: PreviewListenerBase.h:43
std::list< ColumnLayout > ColumnLayoutList
List of column layouts (see unity::scopes::ColumnLayout)
Definition: ColumnLayout.h:112
Simple variant class that can hold an integer, boolean, string, double, dictionary, array or null value.
Definition: Variant.h:58
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:140
Abstract base class to be notified of query completion.
Definition: ListenerBase.h:42