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.boxlayout; 15 extern(C++): 16 17 import qt.config; 18 import qt.core.namespace; 19 import qt.core.rect; 20 import qt.core.size; 21 import qt.helpers; 22 import qt.widgets.layout; 23 import qt.widgets.layoutitem; 24 import qt.widgets.widget; 25 26 /+ #ifdef QT_INCLUDE_COMPAT 27 #endif +/ 28 29 30 31 extern(C++, class) struct QBoxLayoutPrivate; 32 33 class /+ Q_WIDGETS_EXPORT +/ QBoxLayout : QLayout 34 { 35 mixin(Q_OBJECT); 36 /+ Q_DECLARE_PRIVATE(QBoxLayout) +/ 37 public: 38 enum Direction { LeftToRight, RightToLeft, TopToBottom, BottomToTop, 39 Down = Direction.TopToBottom, Up = Direction.BottomToTop } 40 41 /+ explicit +/this(Direction, QWidget parent = null); 42 43 ~this(); 44 45 final Direction direction() const; 46 final void setDirection(Direction); 47 48 final void addSpacing(int size); 49 final void addStretch(int stretch = 0); 50 final void addSpacerItem(QSpacerItem spacerItem); 51 final void addWidget(QWidget , int stretch = 0, /+ Qt:: +/qt.core.namespace.Alignment alignment = /+ Qt:: +/qt.core.namespace.Alignment()); 52 final void addLayout(QLayout layout, int stretch = 0); 53 final void addStrut(int); 54 override void addItem(QLayoutItem ); 55 56 final void insertSpacing(int index, int size); 57 final void insertStretch(int index, int stretch = 0); 58 final void insertSpacerItem(int index, QSpacerItem spacerItem); 59 final void insertWidget(int index, QWidget widget, int stretch = 0, /+ Qt:: +/qt.core.namespace.Alignment alignment = /+ Qt:: +/qt.core.namespace.Alignment()); 60 final void insertLayout(int index, QLayout layout, int stretch = 0); 61 final void insertItem(int index, QLayoutItem ); 62 63 // final int spacing() const; 64 // final void setSpacing(int spacing); 65 66 final bool setStretchFactor(QWidget w, int stretch); 67 final bool setStretchFactor(QLayout l, int stretch); 68 final void setStretch(int index, int stretch); 69 final int stretch(int index) const; 70 71 override QSize sizeHint() const; 72 override QSize minimumSize() const; 73 override QSize maximumSize() const; 74 75 override bool hasHeightForWidth() const; 76 override int heightForWidth(int) const; 77 override int minimumHeightForWidth(int) const; 78 79 override /+ Qt:: +/qt.core.namespace.Orientations expandingDirections() const; 80 override void invalidate(); 81 override QLayoutItem itemAt(int) const; 82 override QLayoutItem takeAt(int); 83 override int count() const; 84 override void setGeometry(ref const(QRect)); 85 86 private: 87 /+ Q_DISABLE_COPY(QBoxLayout) +/ 88 } 89 90 class /+ Q_WIDGETS_EXPORT +/ QHBoxLayout : QBoxLayout 91 { 92 mixin(Q_OBJECT); 93 public: 94 this(); 95 /+ explicit +/this(QWidget parent); 96 ~this(); 97 98 99 private: 100 /+ Q_DISABLE_COPY(QHBoxLayout) +/ 101 } 102 103 class /+ Q_WIDGETS_EXPORT +/ QVBoxLayout : QBoxLayout 104 { 105 mixin(Q_OBJECT); 106 public: 107 this(); 108 /+ explicit +/this(QWidget parent); 109 ~this(); 110 111 112 private: 113 /+ Q_DISABLE_COPY(QVBoxLayout) +/ 114 } 115