Back to index

scribus-ng  1.3.4.dfsg+svn20071115
customfdialog.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                           customfdialog.h  -  description
00009                              -------------------
00010     begin                : Fri Nov 30 2001
00011     copyright            : (C) 2001 by Franz Schmid
00012     email                : Franz.Schmid@altmuehlnet.de
00013  ***************************************************************************/
00014 
00015 /***************************************************************************
00016  *                                                                         *
00017  *   This program is free software; you can redistribute it and/or modify  *
00018  *   it under the terms of the GNU General Public License as published by  *
00019  *   the Free Software Foundation; either version 2 of the License, or     *
00020  *   (at your option) any later version.                                   *
00021  *                                                                         *
00022  ***************************************************************************/
00023 
00024 #ifndef CUSTOMFDIALOG_H
00025 #define CUSTOMFDIALOG_H
00026 
00027 #include <qfiledialog.h>
00028 #include <qurl.h>
00029 #include <qlabel.h>
00030 #include <qdir.h>
00031 #include <qpixmap.h>
00032 #include <qcheckbox.h>
00033 #include <qlayout.h>
00034 #include <qframe.h>
00035 #include <qtoolbutton.h>
00036 #include <qcombobox.h>
00037 #include <qstring.h>
00038 
00039 #include "scribusapi.h"
00040 
00044 class SCRIBUS_API ImIconProvider : public QFileIconProvider
00045 {
00046     Q_OBJECT
00047     QStringList fmts;
00048     QPixmap imagepm;
00049     QPixmap docpm;
00050     QPixmap pspm;
00051     QPixmap pdfpm;
00052     QPixmap txtpm;
00053     QPixmap oosxdpm;
00054     QPixmap oosxwpm;
00055     QPixmap vectorpm;
00056 public:
00057     ImIconProvider(QWidget *pa);
00058     ~ImIconProvider() {};
00059 
00060     const QPixmap * pixmap(const QFileInfo &fi);
00061 };
00062 
00063 class SCRIBUS_API FDialogPreview : public QLabel, public QFilePreview
00064 {
00065     Q_OBJECT
00066 protected:
00067        QString filePath;
00068 public:
00069        FDialogPreview(QWidget *pa);
00070        ~FDialogPreview() {};
00071        void updtPix();
00072        void GenPreview(QString name);
00073        virtual void previewUrl(const QUrl &url);
00074 };
00075 
00076 typedef enum {
00077        fdNone = 0,
00078        fdShowPreview = 1, // display text/image previewer
00079        fdExistingFiles = 2, // When set, set to the QFileDialog::ExistingFile mode when true, QFileDialog::AnyFile otherwise
00080        fdCompressFile = 4, // Show and handle the "Compress" behaviour and CheckBox (true)
00081        fdShowCodecs = 8, // Show and handle text codecs and ComboBox (true)
00082        fdDirectoriesOnly = 16 // Show only directories
00083 } fdFlags;
00084 
00089 class SCRIBUS_API CustomFDialog : public QFileDialog
00090 {
00091     Q_OBJECT
00092 public:
00100        CustomFDialog(QWidget *parent, QString wDir, QString caption = "",  QString filter = "",
00101                             int flags = fdExistingFiles);
00102        ~CustomFDialog();
00103 
00107        void setExtension(QString e);
00110        QString extension();
00114        void setZipExtension(QString e);
00117        QString zipExtension();
00118 
00119        QDir cDir;
00120        QCheckBox* SaveZip;
00121        QCheckBox* WithFonts;
00122        QCheckBox* WithProfiles;
00123        QFrame* Layout;
00124        QToolButton* HomeB;
00125        QFrame* LayoutC;
00126        QComboBox *TxCodeM;
00127        QLabel *TxCodeT;
00128 private slots:
00130        void slotHome();
00131 public slots:
00133        void handleCompress();
00134 protected:
00135        QHBoxLayout* Layout1;
00136        QHBoxLayout* Layout1C;
00138        QString ext;
00140        QString extZip;
00142        int optionFlags;
00143 };
00144 
00145 #endif