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.progressbar;
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.core.string;
22 import qt.gui.event;
23 import qt.helpers;
24 import qt.widgets.styleoption;
25 import qt.widgets.widget;
26 
27 /+ QT_REQUIRE_CONFIG(progressbar); +/
28 
29 
30 extern(C++, class) struct QProgressBarPrivate;
31 /+ class QStyleOptionProgressBar; +/
32 
33 class /+ Q_WIDGETS_EXPORT +/ QProgressBar : QWidget
34 {
35     mixin(Q_OBJECT);
36     /+ Q_PROPERTY(int minimum READ minimum WRITE setMinimum)
37     Q_PROPERTY(int maximum READ maximum WRITE setMaximum)
38     Q_PROPERTY(QString text READ text)
39     Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged)
40     Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
41     Q_PROPERTY(bool textVisible READ isTextVisible WRITE setTextVisible)
42     Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
43     Q_PROPERTY(bool invertedAppearance READ invertedAppearance WRITE setInvertedAppearance)
44     Q_PROPERTY(Direction textDirection READ textDirection WRITE setTextDirection)
45     Q_PROPERTY(QString format READ format WRITE setFormat RESET resetFormat) +/
46 
47 public:
48     enum Direction { TopToBottom, BottomToTop }
49     /+ Q_ENUM(Direction) +/
50 
51     /+ explicit +/this(QWidget parent = null);
52     ~this();
53 
54     final int minimum() const;
55     final int maximum() const;
56 
57     final int value() const;
58 
59     /+ virtual +/ QString text() const;
60     final void setTextVisible(bool visible);
61     final bool isTextVisible() const;
62 
63     final /+ Qt:: +/qt.core.namespace.Alignment alignment() const;
64     final void setAlignment(/+ Qt:: +/qt.core.namespace.Alignment alignment);
65 
66     override QSize sizeHint() const;
67     override QSize minimumSizeHint() const;
68 
69     final /+ Qt:: +/qt.core.namespace.Orientation orientation() const;
70 
71     final void setInvertedAppearance(bool invert);
72     final bool invertedAppearance() const;
73     final void setTextDirection(QProgressBar.Direction textDirection);
74     final QProgressBar.Direction textDirection() const;
75 
76     final void setFormat(ref const(QString) format);
77     final void resetFormat();
78     final QString format() const;
79 
80 public /+ Q_SLOTS +/:
81     @QSlot final void reset();
82     @QSlot final void setRange(int minimum, int maximum);
83     @QSlot final void setMinimum(int minimum);
84     @QSlot final void setMaximum(int maximum);
85     @QSlot final void setValue(int value);
86     @QSlot final void setOrientation(/+ Qt:: +/qt.core.namespace.Orientation);
87 
88 /+ Q_SIGNALS +/public:
89     @QSignal final void valueChanged(int value);
90 
91 protected:
92     override bool event(QEvent e);
93     override void paintEvent(QPaintEvent );
94     final void initStyleOption(QStyleOptionProgressBar* option) const;
95 
96 private:
97     /+ Q_DECLARE_PRIVATE(QProgressBar) +/
98     /+ Q_DISABLE_COPY(QProgressBar) +/
99 }
100