Unity Scopes API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
FilterBase.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_FILTERBASE_H
20 #define UNITY_SCOPES_FILTERBASE_H
21 
22 #include <unity/util/NonCopyable.h>
23 #include <unity/scopes/Variant.h>
24 #include <unity/util/DefinesPtrs.h>
25 #include <memory>
26 #include <list>
27 
28 namespace unity
29 {
30 
31 namespace scopes
32 {
33 
34 namespace internal
35 {
36 class FilterBaseImpl;
37 }
38 
48 {
49 public:
51  UNITY_DEFINES_PTRS(FilterBase);
52  NONCOPYABLE(FilterBase);
54 
59  {
60  Default = 0,
61  Primary = 1
62  };
63 
69  void set_display_hints(int hints);
70 
76  int display_hints() const;
77 
82  std::string id() const;
83 
85  VariantMap serialize() const;
87 
92  std::string filter_type() const;
93 
95  virtual ~FilterBase();
96 
97 protected:
98  FilterBase(internal::FilterBaseImpl *pimpl);
99  std::unique_ptr<internal::FilterBaseImpl> p;
101 };
102 
106 typedef std::list<FilterBase::SCPtr> Filters;
107 
108 } // namespace scopes
109 
110 } // namespace unity
111 
112 #endif
std::string filter_type() const
Get the type name of this filter.
Definition: FilterBase.cpp:57
std::list< FilterBase::SCPtr > Filters
List of filters.
Definition: FilterBase.h:106
void set_display_hints(int hints)
Sets display hints for the Shell UI.
Definition: FilterBase.cpp:42
Definition: FilterBase.h:61
std::string id() const
Get the identifier of this filter.
Definition: FilterBase.cpp:47
Base class for all implementations of filters.
Definition: FilterBase.h:47
DisplayHints
Display hints for the Shell UI.
Definition: FilterBase.h:58
int display_hints() const
Get display hints of this filter.
Definition: FilterBase.cpp:52
std::map< std::string, Variant > VariantMap
A dictionary of (string, Variant) pairs.
Definition: Variant.h:39
Definition: FilterBase.h:60