1 /****************************************************************************
2 **
3 ** DQt - D bindings for the Qt Toolkit
4 **
5 ** GNU Lesser General Public License Usage
6 ** This file may be used under the terms of the GNU Lesser
7 ** General Public License version 3 as published by the Free Software
8 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
9 ** packaging of this file. Please review the following information to
10 ** ensure the GNU Lesser General Public License version 3 requirements
11 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
12 **
13 ****************************************************************************/
14 module qt.widgets.slider;
15 extern(C++):
16 
17 import qt.config;
18 import qt.core.coreevent;
19 import qt.core.namespace;
20 import qt.core.size;
21 import qt.gui.event;
22 import qt.helpers;
23 import qt.widgets.abstractslider;
24 import qt.widgets.styleoption;
25 import qt.widgets.widget;
26 
27 /+ QT_REQUIRE_CONFIG(slider); +/
28 
29 
30 extern(C++, class) struct QSliderPrivate;
31 /+ class QStyleOptionSlider; +/
32 class /+ Q_WIDGETS_EXPORT +/ QSlider : QAbstractSlider
33 {
34     mixin(Q_OBJECT);
35 
36     /+ Q_PROPERTY(TickPosition tickPosition READ tickPosition WRITE setTickPosition)
37     Q_PROPERTY(int tickInterval READ tickInterval WRITE setTickInterval) +/
38 
39 public:
40     enum TickPosition {
41         NoTicks = 0,
42         TicksAbove = 1,
43         TicksLeft = TickPosition.TicksAbove,
44         TicksBelow = 2,
45         TicksRight = TickPosition.TicksBelow,
46         TicksBothSides = 3
47     }
48     /+ Q_ENUM(TickPosition) +/
49 
50     /+ explicit +/this(QWidget parent = null);
51     /+ explicit +/this(/+ Qt:: +/qt.core.namespace.Orientation orientation, QWidget parent = null);
52 
53     ~this();
54 
55     override QSize sizeHint() const;
56     override QSize minimumSizeHint() const;
57 
58     final void setTickPosition(TickPosition position);
59     final TickPosition tickPosition() const;
60 
61     final void setTickInterval(int ti);
62     final int tickInterval() const;
63 
64     override bool event(QEvent event);
65 
66 protected:
67     override void paintEvent(QPaintEvent ev);
68     override void mousePressEvent(QMouseEvent ev);
69     override void mouseReleaseEvent(QMouseEvent ev);
70     override void mouseMoveEvent(QMouseEvent ev);
71     final void initStyleOption(QStyleOptionSlider* option) const;
72 
73 
74 private:
75     /+ friend Q_WIDGETS_EXPORT QStyleOptionSlider qt_qsliderStyleOption(QSlider *slider); +/
76 
77     /+ Q_DISABLE_COPY(QSlider) +/
78     /+ Q_DECLARE_PRIVATE(QSlider) +/
79 }
80