~ubuntu-branches/ubuntu/trusty/unity-scopes-shell/trusty-proposed

« back to all changes in this revision

Viewing changes to src/Unity/filter.h

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release
  • Date: 2013-11-20 12:52:16 UTC
  • Revision ID: package-import@ubuntu.com-20131120125216-8vhqqz0s234c3pg1
Tags: upstream-0.1+14.04.20131120
ImportĀ upstreamĀ versionĀ 0.1+14.04.20131120

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2011, 2013 Canonical, Ltd.
 
3
 *
 
4
 * Authors:
 
5
 *  Florian Boucault <florian.boucault@canonical.com>
 
6
 *  Pawel Stolowski <pawel.stolowski@canonical.com>
 
7
 *
 
8
 * This program is free software; you can redistribute it and/or modify
 
9
 * it under the terms of the GNU General Public License as published by
 
10
 * the Free Software Foundation; version 3.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 * GNU General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
19
 */
 
20
 
 
21
#ifndef FILTER_H
 
22
#define FILTER_H
 
23
 
 
24
// Qt
 
25
#include <QObject>
 
26
#include <QMetaType>
 
27
 
 
28
// libunity-core
 
29
#include <UnityCore/Filter.h>
 
30
 
 
31
class GenericOptionsModel;
 
32
 
 
33
class Q_DECL_EXPORT Filter : public QObject
 
34
{
 
35
    Q_OBJECT
 
36
 
 
37
    Q_PROPERTY(QString id READ id CONSTANT)
 
38
    Q_PROPERTY(QString name READ name CONSTANT)
 
39
    Q_PROPERTY(QString iconHint READ iconHint CONSTANT)
 
40
    Q_PROPERTY(QString rendererName READ rendererName CONSTANT)
 
41
    Q_PROPERTY(bool visible READ visible CONSTANT)
 
42
    Q_PROPERTY(bool collapsed READ collapsed CONSTANT)
 
43
    Q_PROPERTY(bool filtering READ filtering CONSTANT)
 
44
    Q_PROPERTY(GenericOptionsModel* options READ options NOTIFY optionsChanged)
 
45
 
 
46
public:
 
47
    explicit Filter(QObject *parent = nullptr);
 
48
 
 
49
    /* getters */
 
50
    QString id() const;
 
51
    QString name() const;
 
52
    QString iconHint() const;
 
53
    QString rendererName() const;
 
54
    bool visible() const;
 
55
    bool collapsed() const;
 
56
    bool filtering() const;
 
57
    virtual GenericOptionsModel* options() const = 0;
 
58
 
 
59
    static Filter* newFromUnityFilter(unity::dash::Filter::Ptr unityFilter);
 
60
    bool hasUnityFilter(unity::dash::Filter::Ptr unityFilter) const;
 
61
 
 
62
public Q_SLOTS:
 
63
    void clear();
 
64
 
 
65
Q_SIGNALS:
 
66
    void optionsChanged();
 
67
 
 
68
protected:
 
69
    unity::dash::Filter::Ptr m_unityFilter;
 
70
    virtual void setUnityFilter(unity::dash::Filter::Ptr unityFilter);
 
71
};
 
72
 
 
73
Q_DECLARE_METATYPE(Filter*)
 
74
 
 
75
#endif // FILTER_H