on 5b03213 help sign in
unity8/plugins/Unity/ratingsfilter.h
66 lines 1.7 kB history raw
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 */
21#ifndef RATINGSFILTER_H
22#define RATINGSFILTER_H
24// Qt
25#include <QObject>
26#include <QMetaType>
28// libunity-core
29#include <UnityCore/RatingsFilter.h>
31// Local
32#include "filter.h"
34class GenericOptionsModel;
35class AbstractFilterOption;
37class Q_DECL_EXPORT RatingsFilter : public Filter
39 Q_OBJECT
41 Q_PROPERTY(float rating READ rating NOTIFY ratingChanged)
43public:
44 explicit RatingsFilter(QObject *parent = nullptr);
46 /* getters */
47 GenericOptionsModel* options() const override;
48 float rating() const;
50Q_SIGNALS:
51 void ratingChanged(float);
53protected:
54 void setUnityFilter(unity::dash::Filter::Ptr filter) override;
56protected Q_SLOTS:
57 void onActiveChanged(AbstractFilterOption *option);
59private:
60 unity::dash::RatingsFilter::Ptr m_unityRatingsFilter;
61 GenericOptionsModel *m_options;
62};
64Q_DECLARE_METATYPE(RatingsFilter*)
66#endif // RATINGSFILTER_H