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 
69  void set_display_hints(int hints);
70 
76  int display_hints() const;
77 
82  std::string id() const;
83 
85  VariantMap serialize() const;
86  static FilterBase::SCPtr deserialize(VariantMap const& var);
88 
93  std::string filter_type() const;
94 
96  virtual ~FilterBase();
97 
98 protected:
99  FilterBase(internal::FilterBaseImpl *pimpl);
100  std::unique_ptr<internal::FilterBaseImpl> p;
102 };
103 
107 typedef std::list<FilterBase::SCPtr> Filters;
108 
109 } // namespace scopes
110 
111 } // namespace unity
std::string filter_type() const
Get the type name of this filter.
Definition: FilterBase.cpp:62
std::list< FilterBase::SCPtr > Filters
List of filters.
Definition: FilterBase.h:107
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:52
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:57
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