Unity Scopes API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ScopeMetadata.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 Lesser GNU 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: Michi Henning <michi.henning@canonical.com>
17  */
18 
19 #ifndef UNITY_SCOPES_SCOPEMETADATA_H
20 #define UNITY_SCOPES_SCOPEMETADATA_H
21 
22 #include <unity/scopes/Scope.h>
23 
24 namespace unity
25 {
26 
27 namespace scopes
28 {
29 
30 namespace internal
31 {
32 class ScopeMetadataImpl;
33 } // namespace internal
34 
35 namespace testing
36 {
37 class ScopeMetadataBuilder;
38 } // namespace testing
39 
48 class ScopeMetadata final
49 {
50 public:
52  UNITY_DEFINES_PTRS(ScopeMetadata);
53  ~ScopeMetadata();
55 
59  //{@
60  ScopeMetadata(ScopeMetadata const& other);
62 
63  ScopeMetadata& operator=(ScopeMetadata const& other);
64  ScopeMetadata& operator=(ScopeMetadata&&);
66 
71  std::string scope_id() const;
72 
77  ScopeProxy proxy() const;
78 
83  std::string display_name() const; // localized
84 
89  std::string description() const; // localized
90 
95  std::string author() const;
96 
101  std::string art() const; // optional
102 
107  std::string icon() const; // optional
108 
113  std::string search_hint() const; // localized, optional
114 
119  std::string hot_key() const; // localized, optional
120 
125  bool invisible() const; // optional (default = false)
126 
134 
143  std::string scope_directory() const;
144 
149  VariantMap serialize() const;
150 
151 private:
152  ScopeMetadata(std::unique_ptr<internal::ScopeMetadataImpl>); // Instantiable only by ScopeMetadataImpl
153  std::unique_ptr<internal::ScopeMetadataImpl> p;
154 
155  friend class internal::ScopeMetadataImpl;
156 };
157 
158 } // namespace scopes
159 
160 } // namespace unity
161 
162 #endif
std::shared_ptr< Scope > ScopeProxy
Convenience type definition.
Definition: ScopeProxyFwd.h:35
std::string scope_id() const
Get the scope identifier.
std::string display_name() const
Get the display name for this scope.
std::string hot_key() const
Get the hot key for this scope.
std::string description() const
Get the description for this scope.
VariantMap appearance_attributes() const
Get optional display attributes.
Holds scope attributes such as name, description, icon etc.
Definition: ScopeMetadata.h:48
std::string art() const
Get the art for this scope.
std::string search_hint() const
Get the search hint for this scope.
bool invisible() const
Check if this scope should be hidden in the Dash.
std::string author() const
Get the author for this scope.
VariantMap serialize() const
Return a dictionary of all metadata attributes.
ScopeProxy proxy() const
Get the proxy object for this scope.
std::map< std::string, Variant > VariantMap
A dictionary of (string, Variant) pairs.
Definition: Variant.h:39
std::string scope_directory() const
Get directory where scope config files and .so file lives.
std::string icon() const
Get the icon for this scope.