Subversion Repositories Scribus

Rev

Rev 2969 | Rev 4430 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 paul 1
/***************************************************************************
2
                          customfdialog.h  -  description
3
                             -------------------
4
    begin                : Fri Nov 30 2001
5
    copyright            : (C) 2001 by Franz Schmid
6
    email                : Franz.Schmid@altmuehlnet.de
7
 ***************************************************************************/
8
 
9
/***************************************************************************
10
 *                                                                         *
11
 *   This program is free software; you can redistribute it and/or modify  *
12
 *   it under the terms of the GNU General Public License as published by  *
13
 *   the Free Software Foundation; either version 2 of the License, or     *
14
 *   (at your option) any later version.                                   *
15
 *                                                                         *
16
 ***************************************************************************/
17
 
18
#ifndef CUSTOMFDIALOG_H
19
#define CUSTOMFDIALOG_H
20
 
21
#include <qfiledialog.h>
22
#include <qurl.h>
23
#include <qlabel.h>
24
#include <qdir.h>
25
#include <qpixmap.h>
26
#include <qcheckbox.h>
27
#include <qlayout.h>
28
#include <qframe.h>
29
#include <qtoolbutton.h>
15 Franz 30
#include <qcombobox.h>
415 Franz 31
#include <qstring.h>
2969 craig 32
 
33
#include "scribusapi.h"
34
 
3 paul 35
/**
36
  *@author Franz Schmid
37
  */
2969 craig 38
class SCRIBUS_API ImIconProvider : public QFileIconProvider
3 paul 39
{
40
    Q_OBJECT
41
    QStringList fmts;
42
    QPixmap imagepm;
43
    QPixmap docpm;
44
    QPixmap pspm;
45
    QPixmap pdfpm;
46
    QPixmap txtpm;
867 fschmid 47
    QPixmap oosxdpm;
48
    QPixmap oosxwpm;
49
    QPixmap vectorpm;
3 paul 50
public:
51
    ImIconProvider(QWidget *pa);
52
    ~ImIconProvider() {};
53
 
54
    const QPixmap * pixmap(const QFileInfo &fi);
55
};
56
 
2969 craig 57
class SCRIBUS_API FDialogPreview : public QLabel, public QFilePreview
3 paul 58
{
59
    Q_OBJECT
60
public:
61
        FDialogPreview(QWidget *pa);
62
        ~FDialogPreview() {};
311 Franz 63
        void updtPix();
3 paul 64
        void GenPreview(QString name);
65
        virtual void previewUrl(const QUrl &url);
66
};
67
 
4182 subik 68
/*! \brief A Scribus own file dialog.
69
Used almost everywhere. You can see extension handling
70
in e.g. bool SVGExportPlugin::run(QString filename).
71
*/
2969 craig 72
class SCRIBUS_API CustomFDialog : public QFileDialog
3 paul 73
{
74
    Q_OBJECT
4182 subik 75
public:
76
        /*! \brief Create Scribus file dialog.
77
        \param parent a reference to the QWidget parent.
78
        \param wDir starting working directory
79
        \param caption text caption of the dialog window
80
        \param preview When true - display text/image previewer. When false do not display.
81
        \param existing Set to the QFileDialog::ExistingFile mode when true. When false QFileDialog::AnyFile
82
        \param compress Show and handle the "Compress" behaviour and CheckBox (true)
83
        \param codec Show and handle text codecs and ComboBox (true)
84
        \param dirOnly Show only directories when true.
85
        */
86
        CustomFDialog(QWidget *parent, QString wDir, QString caption = "",
87
                                  QString filter = "", bool preview = false,
88
                                  bool existing = true, bool compress = false,
89
                                  bool codec = false, bool dirOnly = false);
3 paul 90
        ~CustomFDialog();
4182 subik 91
 
92
        /*! \brief Set the default extension of the resulting file name.
93
        \param e string extension without any "."
94
        */
95
        void setExtension(QString e);
96
        /*! \brief Get the file extension
97
        \retval QString see setExtension(QString e) */
98
        QString extension();
99
        /*! \brief Set the "compress" extension of the resulting file name.
100
        \param e string extension without any "."
101
        */
102
        void setZipExtension(QString e);
103
        /*! \brief Get the zipped file extension
104
        \retval QString see setZipExtension(QString e) */
105
        QString zipExtension();
106
 
3 paul 107
        QDir cDir;
108
        QCheckBox* SaveZip;
310 Franz 109
        QCheckBox* WFonts;
3 paul 110
        QFrame* Layout;
111
        QToolButton* HomeB;
15 Franz 112
        QFrame* LayoutC;
113
        QComboBox *TxCodeM;
114
        QLabel *TxCodeT;
3 paul 115
private slots:
4182 subik 116
        //! \brief Go to the document home dir.
3 paul 117
        void slotHome();
4182 subik 118
        //! \brief Switch the filename extensions by compress checkbox state.
119
        void handleCompress();
3 paul 120
protected:
121
        QHBoxLayout* Layout1;
15 Franz 122
        QHBoxLayout* Layout1C;
4182 subik 123
        //! \brief Property with default extension
124
        QString ext;
125
        //! \brief Property with default compress extension
126
        QString extZip;
3 paul 127
};
128
 
129
#endif