on c2d8627 help sign in
unity8/plugins/Unity/filter.h
77 lines 2.3 kB history raw
1/*
2 * Copyright (C) 2011 Canonical, Ltd.
3 *
4 * Authors:
5 * Florian Boucault <florian.boucault@canonical.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 3.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
20#ifndef FILTER_H
21#define FILTER_H
23// Qt
24#include <QObject>
25#include <QMetaType>
27// libunity-core
28#include <UnityCore/Filter.h>
30class Q_DECL_EXPORT Filter : public QObject
32 Q_OBJECT
34 Q_PROPERTY(QString id READ id NOTIFY idChanged)
35 Q_PROPERTY(QString name READ name NOTIFY nameChanged)
36 Q_PROPERTY(QString iconHint READ iconHint NOTIFY iconHintChanged)
37 Q_PROPERTY(QString rendererName READ rendererName NOTIFY rendererNameChanged)
38 Q_PROPERTY(bool visible READ visible NOTIFY visibleChanged)
39 Q_PROPERTY(bool collapsed READ collapsed NOTIFY collapsedChanged)
40 Q_PROPERTY(bool filtering READ filtering NOTIFY filteringChanged)
42public:
43 explicit Filter(QObject *parent = 0);
45 /* getters */
46 QString id() const;
47 QString name() const;
48 QString iconHint() const;
49 QString rendererName() const;
50 bool visible() const;
51 bool collapsed() const;
52 bool filtering() const;
54 Q_INVOKABLE void clear();
56 static Filter* newFromUnityFilter(unity::dash::Filter::Ptr unityFilter);
57 bool hasUnityFilter(unity::dash::Filter::Ptr unityFilter) const;
59Q_SIGNALS:
60 void idChanged(std::string);
61 void nameChanged(std::string);
62 void iconHintChanged(std::string);
63 void rendererNameChanged(std::string);
64 void visibleChanged(bool);
65 void collapsedChanged(bool);
66 void filteringChanged(bool);
68 void removed();
70protected:
71 unity::dash::Filter::Ptr m_unityFilter;
72 virtual void setUnityFilter(unity::dash::Filter::Ptr unityFilter);
73};
75Q_DECLARE_METATYPE(Filter*)
77#endif // FILTER_H