1 /***************************************************************************
2 * Copyright (C) 2005-2007 by Tarek Saidi *
3 * tarek.saidi@arcor.de *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; version 2 of the License. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20 #ifndef _FILE_DIALOGS_H_
21 #define _FILE_DIALOGS_H_
23 #include "plugins/interfaces/IFileDialog.h"
26 class FileDlgHistory:public QObject{
29 QString getDir(const QString& name);
30 int getFilter(const QString& name);
32 void set(const QString& name,const QString& dir,int filter);
50 QHash<QString,Entry>History;
57 static void setPlugin(IFileDialog* FileDlgPlugin);
58 static QString openExistingFile(QWidget* parent, const QString& Name,
60 const QStringList& Filters,
61 QString Dir=QString(),
62 int SelectedFilter=-1);
63 static QStringList openExistingFiles(QWidget* parent, const QString& Name,
65 const QStringList& Filters,
66 const QString Dir=QString(),
67 int SelectedFilter=-1);
68 static QString saveFile(QWidget* parent, const QString& Name,
70 const QStringList& Filters,
71 bool ShowOverwriteWarning=true,
72 QString Dir=QString(),
73 int SelectedFilter=-1);
75 static IFileDialog* iFileDialog;
79 class QtStandardFileDialogs:public QObject,public IFileDialog{
81 Q_INTERFACES(IFileDialog);
83 QString openExistingFileDialog(QWidget* parent,QString title,QString dir,QStringList Filters,int SelectedFilter);
84 QStringList openExistingFilesDialog(QWidget* parent,QString title,QString dir,QStringList Filters,int SelectedFilter);
85 QString saveFileDialog(QWidget* parent,QString title,QString dir,QStringList Filters,int SelectedFilter,bool ShowOverwriteWarning);
88 static QString toSingleStringFilter(const QStringList& filterList);
92 extern FileDlgHistory fileDlgHistory;