Unity Scopes API
Link.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/util/DefinesPtrs.h>
22 #include <unity/scopes/CannedQuery.h>
23 #include <unity/scopes/Variant.h>
24 #include <string>
25 #include <memory>
26 
27 namespace unity
28 {
29 
30 namespace scopes
31 {
32 
33 namespace internal
34 {
35 class LinkImpl;
36 class AnnotationImpl;
37 }
38 
42 class Link final
43 {
44 public:
46  UNITY_DEFINES_PTRS(Link);
47 
51  //{@
52  Link(Link const& other);
53  Link(Link&&);
54  Link& operator=(Link const& other);
55  Link& operator=(Link&&);
57 
59  ~Link();
61 
66  std::string label() const;
67 
72  CannedQuery query() const;
73 
75  VariantMap serialize() const;
77 
78 private:
79  Link(std::string const& label, CannedQuery const& query);
80  Link(VariantMap const& variant_map);
81  std::unique_ptr<internal::LinkImpl> p;
82 
83  friend class internal::AnnotationImpl;
84 };
85 
86 } // namespace scopes
87 
88 } // namespace unity
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
Parameters of a search query.
Definition: CannedQuery.h:49