My Project
RangeInputFilterInterface.h
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  */
16 
17 #ifndef UNITY_SHELL_SCOPES_RANGEINPUTFILTERINTERFACE_H
18 #define UNITY_SHELL_SCOPES_RANGEINPUTFILTERINTERFACE_H
19 
20 #include <unity/SymbolExport.h>
21 
22 #include "FilterBaseInterface.h"
23 
24 namespace unity
25 {
26 namespace shell
27 {
28 namespace scopes
29 {
30 
32 {
33  Q_OBJECT
34 
35 public:
36  Q_PROPERTY(double startValue READ startValue WRITE setStartValue NOTIFY startValueChanged)
37  Q_PROPERTY(double endValue READ endValue WRITE setEndValue NOTIFY endValueChanged)
38  Q_PROPERTY(QString startPrefixLabel READ startPrefixLabel NOTIFY startPrefixLabelChanged)
39  Q_PROPERTY(QString startPostfixLabel READ startPostfixLabel NOTIFY startPostfixLabelChanged)
40  Q_PROPERTY(QString centralLabel READ centralLabel NOTIFY centralLabelChanged)
41  Q_PROPERTY(QString endPrefixLabel READ endPrefixLabel NOTIFY endPrefixLabelChanged)
42  Q_PROPERTY(QString endPostfixLabel READ endPostfixLabel NOTIFY endPostfixLabelChanged)
43  Q_PROPERTY(bool hasStartValue READ hasStartValue NOTIFY hasStartValueChanged)
44  Q_PROPERTY(bool hasEndValue READ hasEndValue NOTIFY hasEndValueChanged)
45 
46  FiltersInterface::FilterType filterType() const override
47  {
48  return FiltersInterface::RangeInputFilter;
49  }
50 
51  virtual double startValue() const = 0;
52  virtual double endValue() const = 0;
53  virtual void setStartValue(double value) = 0;
54  virtual void setEndValue(double value) = 0;
55  virtual QString startPrefixLabel() const = 0;
56  virtual QString startPostfixLabel() const = 0;
57  virtual QString centralLabel() const = 0;
58  virtual QString endPrefixLabel() const = 0;
59  virtual QString endPostfixLabel() const = 0;
60  virtual bool hasStartValue() const = 0;
61  virtual bool hasEndValue() const = 0;
62 
63  Q_INVOKABLE virtual void eraseStartValue() = 0;
64  Q_INVOKABLE virtual void eraseEndValue() = 0;
65 
66 Q_SIGNALS:
67  void startValueChanged();
68  void endValueChanged();
69  void hasStartValueChanged();
70  void hasEndValueChanged();
71  void startPrefixLabelChanged();
72  void startPostfixLabelChanged();
73  void centralLabelChanged();
74  void endPrefixLabelChanged();
75  void endPostfixLabelChanged();
76 
77 protected:
79  explicit RangeInputFilterInterface(QObject* parent = 0) : FilterBaseInterface(parent) {}
81 };
82 
83 }
84 
85 }
86 }
87 
89 
90 #endif
unity::shell::scopes::RangeInputFilterInterface
Definition: RangeInputFilterInterface.h:31
unity::shell::scopes::FilterBaseInterface
Definition: FilterBaseInterface.h:30
unity
Top-level namespace for all things Unity-related.
Definition: Version.h:37