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.dialog;
15 extern(C++):
16 
17 import qt.config;
18 import qt.core.coreevent;
19 import qt.core.namespace;
20 import qt.core.object;
21 import qt.core.size;
22 import qt.gui.event;
23 import qt.helpers;
24 import qt.widgets.widget;
25 
26 /+ QT_REQUIRE_CONFIG(dialog);
27 
28 
29 
30 class QPushButton; +/
31 extern(C++, class) struct QDialogPrivate;
32 
33 class /+ Q_WIDGETS_EXPORT +/ QDialog : QWidget
34 {
35     mixin(Q_OBJECT);
36     /+ friend class QPushButton; +/
37 
38     /+ Q_PROPERTY(bool sizeGripEnabled READ isSizeGripEnabled WRITE setSizeGripEnabled)
39     Q_PROPERTY(bool modal READ isModal WRITE setModal) +/
40 
41 public:
42     /+ explicit +/this(QWidget parent = null, /+ Qt:: +/qt.core.namespace.WindowFlags f = /+ Qt:: +/qt.core.namespace.WindowFlags());
43     ~this();
44 
45     enum DialogCode { Rejected, Accepted }
46 
47     final int result() const;
48 
49     override void setVisible(bool visible);
50 
51 /+ #if QT_DEPRECATED_SINCE(5, 13) +/
52     /+ QT_DEPRECATED_X("Use show/hide on the affected widget instead") +/ final void setOrientation(/+ Qt:: +/qt.core.namespace.Orientation orientation);
53     /+ QT_DEPRECATED_X("Use show/hide on the affected widget instead") +/ final /+ Qt:: +/qt.core.namespace.Orientation orientation() const;
54     /+ QT_DEPRECATED_X("Use show/hide on the affected widget instead") +/ final void setExtension(QWidget extension);
55     /+ QT_DEPRECATED_X("Use show/hide on the affected widget instead") +/ final QWidget extension() const;
56 /+ #endif +/
57 
58     override QSize sizeHint() const;
59     override QSize minimumSizeHint() const;
60 
61     final void setSizeGripEnabled(bool);
62     final bool isSizeGripEnabled() const;
63 
64     final void setModal(bool modal);
65     final void setResult(int r);
66 
67 /+ Q_SIGNALS +/public:
68     @QSignal final void finished(int result);
69     @QSignal final void accepted();
70     @QSignal final void rejected();
71 
72 public /+ Q_SLOTS +/:
73     /+ virtual +/ @QSlot void open();
74     /+ virtual +/ @QSlot int exec();
75     /+ virtual +/ @QSlot void done(int);
76     /+ virtual +/ @QSlot void accept();
77     /+ virtual +/ @QSlot void reject();
78 
79 /+ #if QT_DEPRECATED_SINCE(5, 13) +/
80     /+ QT_DEPRECATED_X("Use show/hide on the affected widget instead") +/ @QSlot final void showExtension(bool);
81 /+ #endif +/
82 
83 protected:
84     this(ref QDialogPrivate , QWidget parent, /+ Qt:: +/qt.core.namespace.WindowFlags f = /+ Qt:: +/qt.core.namespace.WindowFlags());
85 
86     override void keyPressEvent(QKeyEvent );
87     override void closeEvent(QCloseEvent );
88     override void showEvent(QShowEvent );
89     override void resizeEvent(QResizeEvent );
90     version(QT_NO_CONTEXTMENU){}else
91     {
92         override void contextMenuEvent(QContextMenuEvent );
93     }
94     override bool eventFilter(QObject , QEvent );
95     final void adjustPosition(QWidget);
96 private:
97     /+ Q_DECLARE_PRIVATE(QDialog) +/
98     /+ Q_DISABLE_COPY(QDialog) +/
99 }
100