Unity Scopes API
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 #pragma once
20 
21 #include <unity/util/NonCopyable.h>
22 #include <unity/scopes/Variant.h>
23 #include <unity/util/DefinesPtrs.h>
24 #include <memory>
25 #include <list>
26 
27 namespace unity
28 {
29 
30 namespace scopes
31 {
32 
33 namespace internal
34 {
35 class FilterBaseImpl;
36 }
37 
47 {
48 public:
50  UNITY_DEFINES_PTRS(FilterBase);
51  NONCOPYABLE(FilterBase);
53 
58  {
59  Default = 0,
60  Primary = 1
61  };
62 
68  void set_display_hints(int hints);
69 
75  int display_hints() const;
76 
81  std::string id() const;
82 
84  VariantMap serialize() const;
85  static FilterBase::SCPtr deserialize(VariantMap const& var);
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
std::string filter_type() const
Get the type name of this filter.
Definition: FilterBase.cpp:61
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:46
Definition: FilterBase.h:60
std::string id() const
Get the identifier of this filter.
Definition: FilterBase.cpp:51
Base class for all implementations of filters.
Definition: FilterBase.h:46
DisplayHints
Display hints for the Shell UI.
Definition: FilterBase.h:57
int display_hints() const
Get display hints of this filter.
Definition: FilterBase.cpp:56
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
Definition: FilterBase.h:59