1 /****************************************************************************
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
5 **
6 ** This file is part of the Qt Designer of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** information use the contact form at http://www.qt.io/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 or version 3 as published by the Free
20 ** Software Foundation and appearing in the file LICENSE.LGPLv21 and
21 ** LICENSE.LGPLv3 included in the packaging of this file. Please review the
22 ** following information to ensure the GNU Lesser General Public License
23 ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
24 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 **
26 ** As a special exception, The Qt Company gives you certain additional
27 ** rights. These rights are described in The Qt Company LGPL Exception
28 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 **
30 ** GNU General Public License Usage
31 ** Alternatively, this file may be used under the terms of the GNU
32 ** General Public License version 3.0 as published by the Free Software
33 ** Foundation and appearing in the file LICENSE.GPL included in the
34 ** packaging of this file.  Please review the following information to
35 ** ensure the GNU General Public License version 3.0 requirements will be
36 ** met: http://www.gnu.org/copyleft/gpl.html.
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include "abstractdialoggui_p.h"
43 
44 QT_BEGIN_NAMESPACE
45 
46 /*!
47     \class QDesignerDialogGuiInterface
48     \since 4.4
49     \internal
50 
51     \brief The QDesignerDialogGuiInterface allows integrations of \QD to replace the
52            message boxes displayed by \QD by custom dialogs.
53 
54     \inmodule QtDesigner
55 
56     QDesignerDialogGuiInterface provides virtual functions that can be overwritten
57     to display message boxes and file dialogs.
58     \sa QMessageBox, QFileDialog
59 */
60 
61 /*!
62     \enum QDesignerDialogGuiInterface::Message
63 
64     This enum specifies the context from within the message box is called.
65 
66    \value FormLoadFailureMessage      Loading of a form failed
67    \value UiVersionMismatchMessage    Attempt to load a file created with an old version of Designer
68    \value ResourceLoadFailureMessage  Resources specified in a file could not be found
69    \value TopLevelSpacerMessage       Spacer items detected on a container without layout
70    \value PropertyEditorMessage       Messages of the propert yeditor
71    \value SignalSlotEditorMessage     Messages of the signal / slot editor
72    \value FormEditorMessage           Messages of the form editor
73    \value PreviewFailureMessage       A preview could not be created
74    \value PromotionErrorMessage       Messages related to promotion of a widget
75    \value ResourceEditorMessage       Messages of the resource editor
76    \value ScriptDialogMessage         Messages of the script dialog
77    \value SignalSlotDialogMessage     Messages of the signal slot dialog
78    \value OtherMessage                Unspecified context
79 */
80 
81 /*!
82     Constructs a QDesignerDialogGuiInterface object.
83 */
84 
QDesignerDialogGuiInterface()85 QDesignerDialogGuiInterface::QDesignerDialogGuiInterface()
86 {
87 }
88 
89 /*!
90     Destroys the QDesignerDialogGuiInterface object.
91 */
~QDesignerDialogGuiInterface()92 QDesignerDialogGuiInterface::~QDesignerDialogGuiInterface()
93 {
94 }
95 
96 /*!
97     \fn QMessageBox::StandardButton QDesignerDialogGuiInterface::message(QWidget *parent, Message context, QMessageBox::Icon icon, const QString &title, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton)
98 
99      Opens a message box as child of \a parent within the context \a context, using \a icon, \a title, \a text, \a buttons and \a defaultButton
100      and returns the button chosen by the user.
101 */
102 
103 /*!
104     \fn QString QDesignerDialogGuiInterface::getExistingDirectory(QWidget *parent, const QString &caption, const QString &dir, QFileDialog::Options options)
105 
106      Opens a file dialog as child of \a parent using the parameters \a caption, \a dir and \a options that prompts the
107      user for an existing directory. Returns a directory selected by the user.
108 */
109 
110 /*!
111     \fn QString QDesignerDialogGuiInterface::getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options)
112 
113     Opens a file dialog as child of \a parent using the parameters \a caption, \a dir, \a filter, \a selectedFilter and \a options
114     that prompts the user for an existing file. Returns a file selected by the user.
115 */
116 
117 /*!
118     \fn QStringList QDesignerDialogGuiInterface::getOpenFileNames(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options)
119 
120     Opens a file dialog as child of \a parent using the parameters \a caption, \a dir, \a filter, \a selectedFilter and \a options
121     that prompts the user for a set of existing files. Returns one or more existing files selected by the user.
122 */
123 
124 /*!
125     Opens a file dialog with image browsing capabilities as child of \a parent using the parameters \a caption, \a dir, \a filter, \a selectedFilter and \a options
126     that prompts the user for an existing file. Returns a file selected by the user.
127 
128     The default implementation simply calls getOpenFileName(). On platforms that do not support an image preview in the QFileDialog,
129     the function can be reimplemented to provide an image browser.
130 
131     \since 4.5
132 */
133 
getOpenImageFileName(QWidget * parent,const QString & caption,const QString & dir,const QString & filter,QString * selectedFilter,QFileDialog::Options options)134 QString QDesignerDialogGuiInterface::getOpenImageFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options)
135 {
136     return getOpenFileName(parent, caption, dir, filter, selectedFilter, options);
137 }
138 
139 /*!
140     Opens a file dialog with image browsing capabilities as child of \a parent using the parameters \a caption, \a dir, \a filter, \a selectedFilter and \a options
141     that prompts the user for a set of existing files. Returns one or more existing files selected by the user.
142 
143     The default implementation simply calls getOpenFileNames(). On platforms that do not support an image preview in the QFileDialog,
144     the function can be reimplemented to provide an image browser.
145 
146     \since 4.5
147 */
148 
getOpenImageFileNames(QWidget * parent,const QString & caption,const QString & dir,const QString & filter,QString * selectedFilter,QFileDialog::Options options)149 QStringList QDesignerDialogGuiInterface::getOpenImageFileNames(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options options)
150 {
151     return getOpenImageFileNames(parent, caption, dir, filter, selectedFilter, options);
152 }
153 
154 /*!
155     \fn QString QDesignerDialogGuiInterface::getSaveFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFileDialog::Options)
156 
157     Opens a file dialog as child of \a parent using the parameters \a caption, \a dir, \a filter, \a selectedFilter and \a options
158     that prompts the user for a file. Returns a file selected by the user. The file does not have to exist.
159 */
160 
161 QT_END_NAMESPACE
162