~stolowski/unity-scopes-shell/single-preview

« back to all changes in this revision

Viewing changes to src/filteroption.h

  • Committer: Michal Hruby
  • Date: 2013-11-07 17:48:16 UTC
  • Revision ID: michal.mhr@gmail.com-20131107174816-w1vqq6juarrawx23
Initial commit

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 FILTEROPTION_H
 
22
#define FILTEROPTION_H
 
23
 
 
24
// Local
 
25
#include "abstractfilteroption.h"
 
26
#include "signalslist.h"
 
27
 
 
28
// libunity-core
 
29
#include <UnityCore/Filter.h>
 
30
 
 
31
class Q_DECL_EXPORT FilterOption : public AbstractFilterOption
 
32
{
 
33
    Q_OBJECT
 
34
 
 
35
public:
 
36
    explicit FilterOption(unity::dash::FilterOption::Ptr unityFilterOption, QObject *parent = nullptr);
 
37
 
 
38
    /* getters */
 
39
    QString id() const override;
 
40
    QString name() const override;
 
41
    QString iconHint() const override;
 
42
    bool active() const override;
 
43
 
 
44
    /* setters */
 
45
    void setActive(bool active) override;
 
46
 
 
47
private:
 
48
    void onIdChanged(const std::string &id);
 
49
    void onNameChanged(const std::string &name);
 
50
    void onIconHintChanged(const std::string &iconHint);
 
51
    void onActiveChanged(bool active);
 
52
 
 
53
    void setUnityFilterOption(unity::dash::FilterOption::Ptr unityFilterOption);
 
54
    SignalsList m_signals;
 
55
 
 
56
    unity::dash::FilterOption::Ptr m_unityFilterOption;
 
57
};
 
58
 
 
59
Q_DECLARE_METATYPE(FilterOption*)
 
60
 
 
61
#endif // FILTEROPTION_H