Unity Scopes API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ActivationQueryBase.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: Pawel Stolowski <pawel.stolowski@canonical.com>
17  */
18 
19 #ifndef UNITY_SCOPES_ACTIVATIONQUERYBASE_H
20 #define UNITY_SCOPES_ACTIVATIONQUERYBASE_H
21 
22 #include <unity/scopes/QueryBase.h>
23 #include <unity/util/DefinesPtrs.h>
24 #include <unity/scopes/ActivationResponse.h>
25 
26 namespace unity
27 {
28 
29 namespace scopes
30 {
31 
32 class Result;
33 class ActionMetadata;
34 
35 namespace internal
36 {
37 class ActivationQueryBaseImpl;
38 }
39 
48 {
49 public:
51  UNITY_DEFINES_PTRS(ActivationQueryBase);
52  virtual ~ActivationQueryBase();
54 
61  ActivationQueryBase(Result const& result, ActionMetadata const& metadata);
62 
71  ActivationQueryBase(Result const& result, ActionMetadata const& metadata, std::string const& widget_id, std::string const& action_id);
72 
76  virtual void cancelled() override;
77 
85  virtual ActivationResponse activate();
86 
92  Result result() const;
93 
100 
109  std::string widget_id() const;
110 
119  std::string action_id() const;
120 
121 private:
122  internal::ActivationQueryBaseImpl* fwd() const;
123 };
124 
125 } // namespace scopes
126 
127 } // namespace unity
128 
129 #endif
Abstract server-side base interface for a query that is executed inside a scope.
Definition: QueryBase.h:61
Base class for an activation request that is executed inside a scope.
Definition: ActivationQueryBase.h:47
Metadata passed to scopes for preview and activation.
Definition: ActionMetadata.h:42
The attributes of a result returned by a Scope.
Definition: Result.h:51
ActivationQueryBase(Result const &result, ActionMetadata const &metadata)
Create ActivationQueryBase.
std::string action_id() const
Get the action identifier for this activation request handler.
Definition: ActivationQueryBase.cpp:70
std::string widget_id() const
Get the widget identifier for this activation request handler.
Definition: ActivationQueryBase.cpp:65
Result result() const
Get the result for this activation request handler.
Definition: ActivationQueryBase.cpp:55
virtual ActivationResponse activate()
Return response to the activation request.
Definition: ActivationQueryBase.cpp:50
virtual void cancelled() override
Called when the originator of the activation request cancelled it.
Definition: ActivationQueryBase.cpp:45
ActionMetadata action_metadata() const
Get the metadata for this activation request handler.
Definition: ActivationQueryBase.cpp:60
Response to a result activation.
Definition: ActivationResponse.h:41