Back to index

scribus-ng  1.3.4.dfsg+svn20071115
gtdialogs.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 /***************************************************************************
00008  *   Copyright (C) 2004 by Riku Leino                                      *
00009  *   tsoots@gmail.com                                                      *
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  *   This program is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00019  *   GNU General Public License for more details.                          *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU General Public License     *
00022  *   along with this program; if not, write to the                         *
00023  *   Free Software Foundation, Inc.,                                       *
00024  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00025  ***************************************************************************/
00026 
00027 #ifndef GTDIALOGS_H
00028 #define GTDIALOGS_H
00029 
00030 #include <qcheckbox.h>
00031 #include <qcombobox.h>
00032 #include <qdialog.h>
00033 #include <qdir.h>
00034 #include <qfiledialog.h>
00035 #include <qframe.h>
00036 #include <qinputdialog.h>
00037 #include <qlabel.h>
00038 #include <qlayout.h>
00039 #include <qobject.h>
00040 #include <qpushbutton.h>
00041 #include <qstring.h>
00042 #include <qstringlist.h>
00043 #include <qtextcodec.h>
00044 #include <qtoolbutton.h>
00045 #include <qtooltip.h>
00046 
00047 #include "scribusapi.h"
00048 
00049 class PrefsContext;
00050 
00051 class SCRIBUS_API gtFileDialog : public QFileDialog
00052 {
00053        Q_OBJECT
00054 private:
00055        QDir dir;
00056        QFrame* importerFrame;
00057        QFrame* encodingFrame;
00058        QHBoxLayout* importerLayout;
00059        QHBoxLayout* encodingLayout;
00060        QToolButton* HomeB;
00061        void createWidgets(const QStringList& importers);
00062 public:
00063        gtFileDialog(const QString& filters, const QStringList& importers, const QString& wdir);
00064        ~gtFileDialog();
00065        QCheckBox* textOnlyCheckBox;
00066        QComboBox* importerCombo;
00067        QComboBox* encodingCombo;
00068 private slots:
00069        void slotHome();
00070 };
00071 
00072 class SCRIBUS_API gtImporterDialog : public QDialog
00073 {
00074        Q_OBJECT
00075 private:
00076        QComboBox*   importerCombo;
00077        QCheckBox*   rememberCheck;
00078        QPushButton* okButton;
00079 public:
00080        gtImporterDialog(const QStringList& importers, int currentSelection);
00081        ~gtImporterDialog();
00082        bool shouldRemember();
00083        QString getImporter();
00084 };
00085 
00086 class SCRIBUS_API gtDialogs
00087 {
00088 private:
00089        gtFileDialog* fdia;
00090        QString fileName;
00091        QString encoding;
00092        int importer;
00093        PrefsContext* prefs;
00094        QString pwd;
00095 public:
00096        gtDialogs();
00097        ~gtDialogs();
00098        const QString& getFileName();
00099        const QString& getEncoding();
00100        int getImporter();
00101        bool importTextOnly();
00102        bool runFileDialog(const QString& filters, const QStringList& importers);
00103        bool runImporterDialog(const QStringList& importers);
00104 };
00105 
00106 #endif // GTDIALOGS_H