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.frame;
15 extern(C++):
16 
17 import qt.config;
18 import qt.core.coreevent;
19 import qt.core.namespace;
20 import qt.core.rect;
21 import qt.core.size;
22 import qt.gui.event;
23 import qt.gui.painter;
24 import qt.helpers;
25 import qt.widgets.styleoption;
26 import qt.widgets.widget;
27 
28 extern(C++, class) struct QFramePrivate;
29 /+ class QStyleOptionFrame; +/
30 
31 class /+ Q_WIDGETS_EXPORT +/ QFrame : QWidget
32 {
33     mixin(Q_OBJECT);
34 
35     /+ Q_PROPERTY(Shape frameShape READ frameShape WRITE setFrameShape)
36     Q_PROPERTY(Shadow frameShadow READ frameShadow WRITE setFrameShadow)
37     Q_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth)
38     Q_PROPERTY(int midLineWidth READ midLineWidth WRITE setMidLineWidth)
39     Q_PROPERTY(int frameWidth READ frameWidth)
40     Q_PROPERTY(QRect frameRect READ frameRect WRITE setFrameRect DESIGNABLE false) +/
41 
42 public:
43     /+ explicit +/this(QWidget parent = null, /+ Qt:: +/qt.core.namespace.WindowFlags f = /+ Qt:: +/qt.core.namespace.WindowFlags());
44     ~this();
45 
46     final int frameStyle() const;
47     final void setFrameStyle(int);
48 
49     final int frameWidth() const;
50 
51     override QSize sizeHint() const;
52 
53     enum Shape {
54         NoFrame  = 0, // no frame
55         Box = 0x0001, // rectangular box
56         Panel = 0x0002, // rectangular panel
57         WinPanel = 0x0003, // rectangular panel (Windows)
58         HLine = 0x0004, // horizontal line
59         VLine = 0x0005, // vertical line
60         StyledPanel = 0x0006 // rectangular panel depending on the GUI style
61     }
62     /+ Q_ENUM(Shape) +/
63     enum Shadow {
64         Plain = 0x0010, // plain line
65         Raised = 0x0020, // raised shadow effect
66         Sunken = 0x0030 // sunken shadow effect
67     }
68     /+ Q_ENUM(Shadow) +/
69 
70     enum StyleMask {
71         Shadow_Mask = 0x00f0, // mask for the shadow
72         Shape_Mask = 0x000f // mask for the shape
73     }
74 
75     final Shape frameShape() const;
76     final void setFrameShape(Shape);
77     final Shadow frameShadow() const;
78     final void setFrameShadow(Shadow);
79 
80     final int lineWidth() const;
81     final void setLineWidth(int);
82 
83     final int midLineWidth() const;
84     final void setMidLineWidth(int);
85 
86     final QRect frameRect() const;
87     final void setFrameRect(ref const(QRect) );
88 
89 protected:
90     override bool event(QEvent e);
91     override void paintEvent(QPaintEvent );
92     override void changeEvent(QEvent );
93     final void drawFrame(QPainter* );
94 
95 
96 protected:
97     this(ref QFramePrivate dd, QWidget parent = null, /+ Qt:: +/qt.core.namespace.WindowFlags f = /+ Qt:: +/qt.core.namespace.WindowFlags());
98     final void initStyleOption(QStyleOptionFrame* option) const;
99 
100 private:
101     /+ Q_DISABLE_COPY(QFrame) +/
102     /+ Q_DECLARE_PRIVATE(QFrame) +/
103 }
104