on 4f417ff help sign in
unity8/tests/mocks/Unity/fake_rangeinputfilter.h
79 lines 2.4 kB history raw
1/*
2 * Copyright (C) 2015 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
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 General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
17#ifndef FAKE_RANGEINPUTFILTER_H
18#define FAKE_RANGEINPUTFILTER_H
20#include <unity/shell/scopes/RangeInputFilterInterface.h>
22class FakeRangeInputFilter : public unity::shell::scopes::RangeInputFilterInterface
24 Q_OBJECT
26public:
27 FakeRangeInputFilter(const QString &id, const QString &tag, QObject* parent);
29 QString filterId() const override;
30 QString filterTag() const override;
31 QString title() const override;
33 double startValue() const override;
34 double endValue() const override;
35 void setStartValue(double value) override;
36 void setEndValue(double value) override;
37 QString startPrefixLabel() const override;
38 QString startPostfixLabel() const override;
39 QString centralLabel() const override;
40 QString endPrefixLabel() const override;
41 QString endPostfixLabel() const override;
42 bool hasStartValue() const override;
43 bool hasEndValue() const override;
45 void eraseStartValue() override;
46 void eraseEndValue() override;
48 // Not part of the iface, for mock/testing purposes
49 bool isActive() const;
51 void setTitle(const QString &title);
52 void setStartPrefixLabel(const QString &startPrefixLabel);
53 void setStartPostfixLabel(const QString &startPostfixLabel);
54 void setCentralLabel(const QString &centralLabel);
55 void setEndPrefixLabel(const QString &endPrefixLabel);
56 void setEndPostfixLabel(const QString &endPostfixLabel);
58Q_SIGNALS:
59 void isActiveChanged();
61private:
62 QString m_filterId;
63 QString m_filterTag;
64 QString m_title;
66 bool m_hasStartValue;
67 bool m_hasEndValue;
69 double m_startValue;
70 double m_endValue;
72 QString m_startPrefixLabel;
73 QString m_startPostfixLabel;
74 QString m_centralLabel;
75 QString m_endPrefixLabel;
76 QString m_endPostfixLabel;
77};
79#endif