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.abstractscrollarea;
15 extern(C++):
16 
17 import qt.config;
18 import qt.core.coreevent;
19 import qt.core.margins;
20 import qt.core.namespace;
21 import qt.core.object;
22 import qt.core.size;
23 import qt.gui.event;
24 import qt.helpers;
25 import qt.widgets.frame;
26 import qt.widgets.scrollbar;
27 import qt.widgets.widget;
28 
29 /+ #if QT_CONFIG(scrollarea) +/
30 
31 /+ class QMargins;
32 class QScrollBar; +/
33 extern(C++, class) struct QAbstractScrollAreaPrivate;
34 
35 class /+ Q_WIDGETS_EXPORT +/ QAbstractScrollArea : QFrame
36 {
37     mixin(Q_OBJECT);
38 
39     /+ Q_PROPERTY(Qt::ScrollBarPolicy verticalScrollBarPolicy READ verticalScrollBarPolicy WRITE setVerticalScrollBarPolicy)
40     Q_PROPERTY(Qt::ScrollBarPolicy horizontalScrollBarPolicy READ horizontalScrollBarPolicy WRITE setHorizontalScrollBarPolicy)
41     Q_PROPERTY(SizeAdjustPolicy sizeAdjustPolicy READ sizeAdjustPolicy WRITE setSizeAdjustPolicy) +/
42 
43 public:
44     /+ explicit +/this(QWidget parent = null);
45     ~this();
46 
47     enum SizeAdjustPolicy {
48         AdjustIgnored,
49         AdjustToContentsOnFirstShow,
50         AdjustToContents
51     }
52     /+ Q_ENUM(SizeAdjustPolicy) +/
53 
54     final /+ Qt:: +/qt.core.namespace.ScrollBarPolicy verticalScrollBarPolicy() const;
55     final void setVerticalScrollBarPolicy(/+ Qt:: +/qt.core.namespace.ScrollBarPolicy);
56     final QScrollBar verticalScrollBar() const;
57     final void setVerticalScrollBar(QScrollBar scrollbar);
58 
59     final /+ Qt:: +/qt.core.namespace.ScrollBarPolicy horizontalScrollBarPolicy() const;
60     final void setHorizontalScrollBarPolicy(/+ Qt:: +/qt.core.namespace.ScrollBarPolicy);
61     final QScrollBar horizontalScrollBar() const;
62     final void setHorizontalScrollBar(QScrollBar scrollbar);
63 
64     final QWidget cornerWidget() const;
65     final void setCornerWidget(QWidget widget);
66 
67     final void addScrollBarWidget(QWidget widget, /+ Qt:: +/qt.core.namespace.Alignment alignment);
68     final QWidgetList scrollBarWidgets(/+ Qt:: +/qt.core.namespace.Alignment alignment);
69 
70     final QWidget viewport() const;
71     final void setViewport(QWidget widget);
72     final QSize maximumViewportSize() const;
73 
74     override QSize minimumSizeHint() const;
75 
76     override QSize sizeHint() const;
77 
78     /+ virtual +/ void setupViewport(QWidget viewport);
79 
80     final SizeAdjustPolicy sizeAdjustPolicy() const;
81     final void setSizeAdjustPolicy(SizeAdjustPolicy policy);
82 
83 protected:
84     this(ref QAbstractScrollAreaPrivate dd, QWidget parent = null);
85     final void setViewportMargins(int left, int top, int right, int bottom);
86     final void setViewportMargins(ref const(QMargins) margins);
87     final QMargins viewportMargins() const;
88 
89     override bool eventFilter(QObject , QEvent );
90     override bool event(QEvent );
91     /+ virtual +/ bool viewportEvent(QEvent );
92 
93     override void resizeEvent(QResizeEvent );
94     override void paintEvent(QPaintEvent );
95     override void mousePressEvent(QMouseEvent );
96     override void mouseReleaseEvent(QMouseEvent );
97     override void mouseDoubleClickEvent(QMouseEvent );
98     override void mouseMoveEvent(QMouseEvent );
99 /+ #if QT_CONFIG(wheelevent) +/
100     override void wheelEvent(QWheelEvent );
101 /+ #endif
102 #ifndef QT_NO_CONTEXTMENU +/
103     version(QT_NO_CONTEXTMENU){}else
104     {
105         override void contextMenuEvent(QContextMenuEvent );
106     }
107 /+ #endif
108 #if QT_CONFIG(draganddrop) +/
109     override void dragEnterEvent(QDragEnterEvent );
110     override void dragMoveEvent(QDragMoveEvent );
111     override void dragLeaveEvent(QDragLeaveEvent );
112     override void dropEvent(QDropEvent );
113 /+ #endif +/
114 
115     override void keyPressEvent(QKeyEvent );
116 
117     /+ virtual +/ void scrollContentsBy(int dx, int dy);
118 
119     /+ virtual +/ QSize viewportSizeHint() const;
120 
121 private:
122     /+ Q_DECLARE_PRIVATE(QAbstractScrollArea) +/
123     /+ Q_DISABLE_COPY(QAbstractScrollArea) +/
124     /+ Q_PRIVATE_SLOT(d_func(), void _q_hslide(int))
125     Q_PRIVATE_SLOT(d_func(), void _q_vslide(int))
126     Q_PRIVATE_SLOT(d_func(), void _q_showOrHideScrollBars()) +/
127 
128     /+ friend class QStyleSheetStyle; +/
129     /+ friend class QWidgetPrivate; +/
130 }
131 
132 /+ #endif +/ // QT_CONFIG(scrollarea)
133