Unity Scopes API
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 #pragma once
20 
21 #include <unity/scopes/QueryBase.h>
22 #include <unity/util/DefinesPtrs.h>
23 #include <unity/scopes/ActivationResponse.h>
24 
25 namespace unity
26 {
27 
28 namespace scopes
29 {
30 
31 class Result;
32 class ActionMetadata;
33 
34 namespace internal
35 {
36 class ActivationQueryBaseImpl;
37 }
38 
47 {
48 public:
50  UNITY_DEFINES_PTRS(ActivationQueryBase);
51  virtual ~ActivationQueryBase();
53 
60  ActivationQueryBase(Result const& result, ActionMetadata const& metadata);
61 
70  ActivationQueryBase(Result const& result, ActionMetadata const& metadata, std::string const& widget_id, std::string const& action_id);
71 
79  ActivationQueryBase(Result const& update_result, ActionMetadata const& metadata, std::string const& action_id);
80 
84  virtual void cancelled() override;
85 
93  virtual ActivationResponse activate();
94 
100  Result result() const;
101 
108 
117  std::string widget_id() const;
118 
127  std::string action_id() const;
128 
129 private:
130  internal::ActivationQueryBaseImpl* fwd() const;
131 };
132 
133 } // namespace scopes
134 
135 } // namespace unity
Abstract server-side base interface for a query that is executed inside a scope.
Definition: QueryBase.h:60
Base class for an activation request that is executed inside a scope.
Definition: ActivationQueryBase.h:46
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
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:75
Top-level namespace for all things Unity-related.
Definition: Version.h:49
Definition: ActionMetadata.h:31
std::string widget_id() const
Get the widget identifier for this activation request handler.
Definition: ActivationQueryBase.cpp:70
Result result() const
Get the result for this activation request handler.
Definition: ActivationQueryBase.cpp:60
virtual ActivationResponse activate()
Return response to the activation request.
Definition: ActivationQueryBase.cpp:55
virtual void cancelled() override
Called when the originator of the activation request cancelled it.
Definition: ActivationQueryBase.cpp:50
ActionMetadata action_metadata() const
Get the metadata for this activation request handler.
Definition: ActivationQueryBase.cpp:65
Response to a result activation.
Definition: ActivationResponse.h:41