Unity Scopes API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 #ifndef UNITY_SCOPES_LINK_H
20 #define UNITY_SCOPES_LINK_H
21 
22 #include <unity/util/DefinesPtrs.h>
23 #include <unity/scopes/CannedQuery.h>
24 #include <unity/scopes/Variant.h>
25 #include <string>
26 #include <memory>
27 
28 namespace unity
29 {
30 
31 namespace scopes
32 {
33 
34 namespace internal
35 {
36 class LinkImpl;
37 class AnnotationImpl;
38 }
39 
43 class Link final
44 {
45 public:
47  UNITY_DEFINES_PTRS(Link);
48 
52  //{@
53  Link(Link const& other);
54  Link(Link&&);
55  Link& operator=(Link const& other);
56  Link& operator=(Link&&);
58 
60  ~Link();
62 
67  std::string label() const;
68 
73  CannedQuery query() const;
74 
76  VariantMap serialize() const;
78 
79 private:
80  Link(std::string const& label, CannedQuery const& query);
81  Link(VariantMap const& variant_map);
82  std::unique_ptr<internal::LinkImpl> p;
83 
84  friend class internal::AnnotationImpl;
85 };
86 
87 } // namespace scopes
88 
89 } // namespace unity
90 
91 #endif
std::map< std::string, Variant > VariantMap
A dictionary of (string, Variant) pairs.
Definition: Variant.h:39
Parameters of a search query.
Definition: CannedQuery.h:46