Unity Scopes API
PreviewQueryBase.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/PreviewReplyProxyFwd.h>
22 #include <unity/scopes/QueryCtrlProxyFwd.h>
23 #include <unity/scopes/ScopeProxyFwd.h>
24 #include <unity/scopes/Variant.h>
25 #include <unity/scopes/QueryBase.h>
26 
27 #include <unity/util/DefinesPtrs.h>
28 #include <unity/util/NonCopyable.h>
29 
30 namespace unity
31 {
32 
33 namespace scopes
34 {
35 
36 class Result;
37 class ActionMetadata;
38 
39 namespace internal
40 {
41 
42 class PreviewQueryBaseImpl;
43 class QueryBaseImpl;
44 class QueryObject;
45 
46 } // namespace internal
47 
58 {
59 public:
61  NONCOPYABLE(PreviewQueryBase);
62  UNITY_DEFINES_PTRS(PreviewQueryBase);
64 
82  virtual void run(PreviewReplyProxy const& reply) = 0; // Called by the run time to start this preview
83 
89  Result result() const;
90 
97 
98  // TODO: Add a method for subpreview request?
99 
101  virtual ~PreviewQueryBase();
103 
104 protected:
110  PreviewQueryBase(Result const& result, ActionMetadata const& metadata);
111 
112 private:
113  internal::PreviewQueryBaseImpl* fwd() const;
114 };
115 
116 } // namespace scopes
117 
118 } // namespace unity
PreviewQueryBase(Result const &result, ActionMetadata const &metadata)
Instantiates a PreviewQueryBase.
Abstract server-side base interface for a query that is executed inside a scope.
Definition: QueryBase.h:60
virtual void run(PreviewReplyProxy const &reply)=0
Called by scopes run time to start the preview.
Result result() const
Get result for this preview request.
Definition: PreviewQueryBase.cpp:42
Metadata passed to scopes for preview and activation.
Definition: ActionMetadata.h:41
The attributes of a result returned by a Scope.
Definition: Result.h:50
Abstract base class to represent a particular preview.
Definition: PreviewQueryBase.h:57
Top-level namespace for all things Unity-related.
Definition: Version.h:49
Definition: ActionMetadata.h:31
std::shared_ptr< PreviewReply > PreviewReplyProxy
Convenience type definition.
Definition: PreviewReplyProxyFwd.h:34
ActionMetadata action_metadata() const
Get metadata for this preview request.
Definition: PreviewQueryBase.cpp:47