source: trunk/doc/html/qfiledialog-h.html

Last change on this file was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 13.1 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/include/qfiledialog.h:1 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>qfiledialog.h Include File</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>qfiledialog.h</h1>
33
34<p>This is the verbatim text of the qfiledialog.h include file. It is provided only for illustration; the copyright remains with Trolltech.
35<hr>
36<pre>
37/****************************************************************************
38** $Id: qfiledialog-h.html 2051 2007-02-21 10:04:20Z chehrlic $
39**
40** Definition of QFileDialog class
41**
42** Created : 950428
43**
44** Copyright (C) 1992-2007 Trolltech ASA. All rights reserved.
45**
46** This file is part of the dialogs module of the Qt GUI Toolkit.
47**
48** This file may be distributed under the terms of the Q Public License
49** as defined by Trolltech ASA of Norway and appearing in the file
50** LICENSE.QPL included in the packaging of this file.
51**
52** This file may be distributed and/or modified under the terms of the
53** GNU General Public License version 2 as published by the Free Software
54** Foundation and appearing in the file LICENSE.GPL included in the
55** packaging of this file.
56**
57** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
58** licenses may use this file in accordance with the Qt Commercial License
59** Agreement provided with the Software.
60**
61** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
62** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
63**
64** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
65** information about Qt Commercial License Agreements.
66** See http://www.trolltech.com/qpl/ for QPL licensing information.
67** See http://www.trolltech.com/gpl/ for GPL licensing information.
68**
69** Contact info@trolltech.com if any conditions of this licensing are
70** not clear to you.
71**
72**********************************************************************/
73
74#ifndef QFILEDIALOG_H
75#define QFILEDIALOG_H
76
77class QPushButton;
78class QButton;
79class QLabel;
80class QWidget;
81class QFileDialog;
82class QTimer;
83class QNetworkOperation;
84class QLineEdit;
85class QListViewItem;
86class QListBoxItem;
87class QFileDialogPrivate;
88class QFileDialogQFileListView;
89
90#ifndef QT_H
91#include "qdir.h"
92#include "qdialog.h"
93#include "qurloperator.h"
94#include "qurlinfo.h"
95#endif // QT_H
96
97#if __GNUC__ - 0 &gt; 3
98#pragma GCC system_header
99#endif
100
101#ifndef QT_NO_FILEDIALOG
102
103class Q_EXPORT QFileIconProvider : public QObject
104{
105 Q_OBJECT
106public:
107 QFileIconProvider( QObject * parent = 0, const char* name = 0 );
108 virtual const QPixmap * pixmap( const QFileInfo &amp; );
109
110private: // Disabled copy constructor and operator=
111#if defined(Q_DISABLE_COPY)
112 QFileIconProvider( const QFileIconProvider &amp; );
113 QFileIconProvider&amp; operator=( const QFileIconProvider &amp; );
114#endif
115};
116
117class Q_EXPORT QFilePreview
118{
119public:
120 QFilePreview();
121 virtual void previewUrl( const QUrl &amp;url ) = 0;
122
123};
124
125class Q_EXPORT QFileDialog : public QDialog
126{
127 Q_OBJECT
128 Q_ENUMS( Mode ViewMode PreviewMode )
129 // ##### Why are this read-only properties ?
130 Q_PROPERTY( QString selectedFile READ selectedFile )
131 Q_PROPERTY( QString selectedFilter READ selectedFilter )
132 Q_PROPERTY( QStringList selectedFiles READ selectedFiles )
133 // #### Should not we be able to set the path ?
134 Q_PROPERTY( QString dirPath READ dirPath )
135 Q_PROPERTY( bool showHiddenFiles READ showHiddenFiles WRITE setShowHiddenFiles )
136 Q_PROPERTY( Mode mode READ mode WRITE setMode )
137 Q_PROPERTY( ViewMode viewMode READ viewMode WRITE setViewMode )
138 Q_PROPERTY( PreviewMode previewMode READ previewMode WRITE setPreviewMode )
139 Q_PROPERTY( bool infoPreview READ isInfoPreviewEnabled WRITE setInfoPreviewEnabled )
140 Q_PROPERTY( bool contentsPreview READ isContentsPreviewEnabled WRITE setContentsPreviewEnabled )
141
142public:
143 QFileDialog( const QString&amp; dirName, const QString&amp; filter = QString::null,
144 QWidget* parent=0, const char* name=0, bool modal = FALSE );
145 QFileDialog( QWidget* parent=0, const char* name=0, bool modal = FALSE );
146 ~QFileDialog();
147
148 // recommended static functions
149
150 static QString getOpenFileName( const QString &amp;initially = QString::null,
151 const QString &amp;filter = QString::null,
152 QWidget *parent = 0, const char* name = 0,
153 const QString &amp;caption = QString::null,
154 QString *selectedFilter = 0,
155 bool resolveSymlinks = TRUE);
156 static QString getSaveFileName( const QString &amp;initially = QString::null,
157 const QString &amp;filter = QString::null,
158 QWidget *parent = 0, const char* name = 0,
159 const QString &amp;caption = QString::null,
160 QString *selectedFilter = 0,
161 bool resolveSymlinks = TRUE);
162 static QString getExistingDirectory( const QString &amp;dir = QString::null,
163 QWidget *parent = 0,
164 const char* name = 0,
165 const QString &amp;caption = QString::null,
166 bool dirOnly = TRUE,
167 bool resolveSymlinks = TRUE);
168 static QStringList getOpenFileNames( const QString &amp;filter= QString::null,
169 const QString &amp;dir = QString::null,
170 QWidget *parent = 0,
171 const char* name = 0,
172 const QString &amp;caption = QString::null,
173 QString *selectedFilter = 0,
174 bool resolveSymlinks = TRUE);
175
176 // other static functions
177
178 static void setIconProvider( QFileIconProvider * );
179 static QFileIconProvider * iconProvider();
180
181 // non-static function for special needs
182
183 QString selectedFile() const;
184 QString selectedFilter() const;
185 virtual void setSelectedFilter( const QString&amp; );
186 virtual void setSelectedFilter( int );
187
188 void setSelection( const QString &amp;);
189
190 void selectAll( bool b );
191
192 QStringList selectedFiles() const;
193
194 QString dirPath() const;
195
196 void setDir( const QDir &amp; );
197 const QDir *dir() const;
198
199 void setShowHiddenFiles( bool s );
200 bool showHiddenFiles() const;
201
202 void rereadDir();
203 void resortDir();
204
205 enum Mode { AnyFile, ExistingFile, Directory, ExistingFiles, DirectoryOnly };
206 void setMode( Mode );
207 Mode mode() const;
208
209 enum ViewMode { Detail, List };
210 enum PreviewMode { NoPreview, Contents, Info };
211 void setViewMode( ViewMode m );
212 ViewMode viewMode() const;
213 void setPreviewMode( PreviewMode m );
214 PreviewMode previewMode() const;
215
216 bool eventFilter( QObject *, QEvent * );
217
218 bool isInfoPreviewEnabled() const;
219 bool isContentsPreviewEnabled() const;
220 void setInfoPreviewEnabled( bool );
221 void setContentsPreviewEnabled( bool );
222
223 void setInfoPreview( QWidget *w, QFilePreview *preview );
224 void setContentsPreview( QWidget *w, QFilePreview *preview );
225
226 QUrl url() const;
227
228 void addFilter( const QString &amp;filter );
229
230public slots:
231 void done( int );
232 void setDir( const QString&amp; );
233 void setUrl( const QUrlOperator &amp;url );
234 void setFilter( const QString&amp; );
235 void setFilters( const QString&amp; );
236 void setFilters( const char ** );
237 void setFilters( const QStringList&amp; );
238
239protected:
240 void resizeEvent( QResizeEvent * );
241 void keyPressEvent( QKeyEvent * );
242
243 void addWidgets( QLabel *, QWidget *, QPushButton * );
244 void addToolButton( QButton *b, bool separator = FALSE );
245 void addLeftWidget( QWidget *w );
246 void addRightWidget( QWidget *w );
247
248signals:
249 void fileHighlighted( const QString&amp; );
250 void fileSelected( const QString&amp; );
251 void filesSelected( const QStringList&amp; );
252 void dirEntered( const QString&amp; );
253 void filterSelected( const QString&amp; );
254
255private slots:
256 void detailViewSelectionChanged();
257 void listBoxSelectionChanged();
258 void changeMode( int );
259 void fileNameEditReturnPressed();
260 void stopCopy();
261 void removeProgressDia();
262
263 void fileSelected( int );
264 void fileHighlighted( int );
265 void dirSelected( int );
266 void pathSelected( int );
267
268 void updateFileNameEdit( QListViewItem *);
269 void selectDirectoryOrFile( QListViewItem * );
270 void popupContextMenu( QListViewItem *, const QPoint &amp;, int );
271 void popupContextMenu( QListBoxItem *, const QPoint &amp; );
272 void updateFileNameEdit( QListBoxItem *);
273 void selectDirectoryOrFile( QListBoxItem * );
274 void fileNameEditDone();
275
276 void okClicked();
277 void filterClicked(); // not used
278 void cancelClicked();
279
280 void cdUpClicked();
281 void newFolderClicked();
282
283 void fixupNameEdit();
284
285 void doMimeTypeLookup();
286
287 void updateGeometries();
288 void modeButtonsDestroyed();
289 void urlStart( QNetworkOperation *op );
290 void urlFinished( QNetworkOperation *op );
291 void dataTransferProgress( int bytesDone, int bytesTotal, QNetworkOperation * );
292 void insertEntry( const QValueList&lt;QUrlInfo&gt; &amp;fi, QNetworkOperation *op );
293 void removeEntry( QNetworkOperation * );
294 void createdDirectory( const QUrlInfo &amp;info, QNetworkOperation * );
295 void itemChanged( QNetworkOperation * );
296 void goBack();
297
298private:
299 enum PopupAction {
300 PA_Open = 0,
301 PA_Delete,
302 PA_Rename,
303 PA_SortName,
304 PA_SortSize,
305 PA_SortType,
306 PA_SortDate,
307 PA_SortUnsorted,
308 PA_Cancel,
309 PA_Reload,
310 PA_Hidden
311 };
312
313 void init();
314 bool trySetSelection( bool isDir, const QUrlOperator &amp;, bool );
315 void deleteFile( const QString &amp;filename );
316 void popupContextMenu( const QString &amp;filename, bool withSort,
317 PopupAction &amp;action, const QPoint &amp;p );
318 void updatePreviews( const QUrl &amp;u );
319
320 QDir reserved; // was cwd
321 QString fileName;
322
323 friend class QFileDialogQFileListView;
324 friend class QFileListBox;
325
326 QFileDialogPrivate *d;
327 QFileDialogQFileListView *files;
328
329 QLineEdit *nameEdit; // also filter
330 QPushButton *okB;
331 QPushButton *cancelB;
332
333#if defined(Q_WS_WIN)
334 static QString winGetOpenFileName( const QString &amp;initialSelection,
335 const QString &amp;filter,
336 QString* workingDirectory,
337 QWidget *parent = 0,
338 const char* name = 0,
339 const QString&amp; caption = QString::null,
340 QString* selectedFilter = 0 );
341 static QString winGetSaveFileName( const QString &amp;initialSelection,
342 const QString &amp;filter,
343 QString* workingDirectory,
344 QWidget *parent = 0,
345 const char* name = 0,
346 const QString&amp; caption = QString::null,
347 QString* selectedFilter = 0 );
348 static QStringList winGetOpenFileNames( const QString &amp;filter,
349 QString* workingDirectory,
350 QWidget *parent = 0,
351 const char* name = 0,
352 const QString&amp; caption = QString::null,
353 QString* selectedFilter = 0 );
354 static QString winGetExistingDirectory( const QString &amp;initialDirectory,
355 QWidget* parent = 0,
356 const char* name = 0,
357 const QString&amp; caption = QString::null);
358 static QString resolveLinkFile( const QString&amp; linkfile );
359#endif
360#if defined(Q_WS_MACX) || defined(Q_WS_MAC9)
361 static QString macGetSaveFileName( const QString &amp;, const QString &amp;,
362 QString *, QWidget *, const char*,
363 const QString&amp;, QString *);
364 static QStringList macGetOpenFileNames( const QString &amp;, QString*,
365 QWidget *, const char *,
366 const QString&amp;, QString *,
367 bool = TRUE, bool = FALSE );
368#endif
369
370
371private: // Disabled copy constructor and operator=
372#if defined(Q_DISABLE_COPY)
373 QFileDialog( const QFileDialog &amp; );
374 QFileDialog &amp;operator=( const QFileDialog &amp; );
375#endif
376};
377
378#endif
379
380#endif // QFILEDIALOG_H
381</pre>
382<!-- eof -->
383<p><address><hr><div align=center>
384<table width=100% cellspacing=0 border=0><tr>
385<td>Copyright &copy; 2007
386<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
387<td align=right><div align=right>Qt 3.3.8</div>
388</table></div></address></body>
389</html>
Note: See TracBrowser for help on using the repository browser.