Unity Scopes API
QueryMetadata.h
1 /*
2  * Copyright (C) 2014 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: Marcus Tomlinson <marcus.tomlinson@canonical.com>
17  */
18 
19 #pragma once
20 
21 #include <unity/scopes/Variant.h>
22 #include <string>
23 
24 namespace unity
25 {
26 
27 namespace scopes
28 {
29 
30 namespace internal
31 {
32 
33 class QueryMetadataImpl;
34 class SearchQueryBaseImpl;
35 
36 }
37 
42 {
43 public:
45  virtual ~QueryMetadata();
47 
52  std::string locale() const;
53 
58  std::string form_factor() const;
59 
73  enum ConnectivityStatus { Unknown, Connected, Disconnected };
74 
79  void set_internet_connectivity(ConnectivityStatus connectivity_status);
80 
86 
88  VariantMap serialize() const;
90 
91 protected:
93  QueryMetadata(QueryMetadata const& other);
94  QueryMetadata& operator=(QueryMetadata const& other);
96  QueryMetadata& operator=(QueryMetadata&&);
97 
98  std::unique_ptr<internal::QueryMetadataImpl> p;
99  QueryMetadata(internal::QueryMetadataImpl* impl);
101 };
102 
103 } // namespace scopes
104 
105 } // namespace unity
std::string form_factor() const
Get the form factor string.
Definition: QueryMetadata.cpp:61
std::string locale() const
Get the locale string.
Definition: QueryMetadata.cpp:56
ConnectivityStatus
Indicates the internet connectivity status.
Definition: QueryMetadata.h:73
Top-level namespace for all things Unity-related.
Definition: Version.h:49
std::map< std::string, Variant > VariantMap
A dictionary of (string, Variant) pairs.
Definition: Variant.h:38
Definition: ActionMetadata.h:31
void set_internet_connectivity(ConnectivityStatus connectivity_status)
Set internet connectivity status.
Definition: QueryMetadata.cpp:66
Base class for extra metadata passed to scopes as a part of a request.
Definition: QueryMetadata.h:41
ConnectivityStatus internet_connectivity() const
Get internet connectivity status.
Definition: QueryMetadata.cpp:71