1 /*
2  * DQt - D bindings for the Qt Toolkit
3  *
4  * GNU Lesser General Public License Usage
5  * This file may be used under the terms of the GNU Lesser
6  * General Public License version 3 as published by the Free Software
7  * Foundation and appearing in the file LICENSE.LGPL3 included in the
8  * packaging of this file. Please review the following information to
9  * ensure the GNU Lesser General Public License version 3 requirements
10  * will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
11  */
12 module qt.widgets.scrollarea;
13 extern(C++):
14 
15 import qt.config;
16 import qt.core.coreevent;
17 import qt.core.namespace;
18 import qt.core.object;
19 import qt.core.size;
20 import qt.gui.event;
21 import qt.helpers;
22 import qt.widgets.abstractscrollarea;
23 import qt.widgets.widget;
24 
25 /+ QT_REQUIRE_CONFIG(scrollarea); +/
26 
27 
28 extern(C++, class) struct QScrollAreaPrivate;
29 
30 /// Binding for C++ class [QScrollArea](https://doc.qt.io/qt-6/qscrollarea.html).
31 class /+ Q_WIDGETS_EXPORT +/ QScrollArea : QAbstractScrollArea
32 {
33     mixin(Q_OBJECT);
34     /+ Q_PROPERTY(bool widgetResizable READ widgetResizable WRITE setWidgetResizable)
35     Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment) +/
36 
37 public:
38     /+ explicit +/this(QWidget parent = null);
39     ~this();
40 
41     final QWidget widget() const;
42     final void setWidget(QWidget widget);
43     final QWidget takeWidget();
44 
45     final bool widgetResizable() const;
46     final void setWidgetResizable(bool resizable);
47 
48     override QSize sizeHint() const;
49 
50     override bool focusNextPrevChild(bool next);
51 
52     final /+ Qt:: +/qt.core.namespace.Alignment alignment() const;
53     final void setAlignment(/+ Qt:: +/qt.core.namespace.Alignment);
54 
55     final void ensureVisible(int x, int y, int xmargin = 50, int ymargin = 50);
56     final void ensureWidgetVisible(QWidget childWidget, int xmargin = 50, int ymargin = 50);
57 
58 protected:
59     this(ref QScrollAreaPrivate dd, QWidget parent = null);
60     override bool event(QEvent );
61     override bool eventFilter(QObject , QEvent );
62     override void resizeEvent(QResizeEvent );
63     override void scrollContentsBy(int dx, int dy);
64 
65     override QSize viewportSizeHint() const;
66 
67 private:
68     /+ Q_DECLARE_PRIVATE(QScrollArea) +/
69     /+ Q_DISABLE_COPY(QScrollArea) +/
70     mixin(CREATE_CONVENIENCE_WRAPPERS);
71 }
72