Subversion Repositories Scribus

Rev

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

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