Subversion Repositories Scribus

Rev

Rev 4182 | Rev 4645 | 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
86
        \param preview When true - display text/image previewer. When false do not display.
87
        \param existing Set to the QFileDialog::ExistingFile mode when true. When false QFileDialog::AnyFile
88
        \param compress Show and handle the "Compress" behaviour and CheckBox (true)
89
        \param codec Show and handle text codecs and ComboBox (true)
90
        \param dirOnly Show only directories when true.
91
        */
92
        CustomFDialog(QWidget *parent, QString wDir, QString caption = "",
93
                                  QString filter = "", bool preview = false,
94
                                  bool existing = true, bool compress = false,
95
                                  bool codec = false, bool dirOnly = false);
3 paul 96
        ~CustomFDialog();
4182 subik 97
 
98
        /*! \brief Set the default extension of the resulting file name.
99
        \param e string extension without any "."
100
        */
101
        void setExtension(QString e);
102
        /*! \brief Get the file extension
103
        \retval QString see setExtension(QString e) */
104
        QString extension();
105
        /*! \brief Set the "compress" extension of the resulting file name.
106
        \param e string extension without any "."
107
        */
108
        void setZipExtension(QString e);
109
        /*! \brief Get the zipped file extension
110
        \retval QString see setZipExtension(QString e) */
111
        QString zipExtension();
112
 
3 paul 113
        QDir cDir;
114
        QCheckBox* SaveZip;
310 Franz 115
        QCheckBox* WFonts;
3 paul 116
        QFrame* Layout;
117
        QToolButton* HomeB;
15 Franz 118
        QFrame* LayoutC;
119
        QComboBox *TxCodeM;
120
        QLabel *TxCodeT;
3 paul 121
private slots:
4182 subik 122
        //! \brief Go to the document home dir.
3 paul 123
        void slotHome();
4182 subik 124
        //! \brief Switch the filename extensions by compress checkbox state.
125
        void handleCompress();
3 paul 126
protected:
127
        QHBoxLayout* Layout1;
15 Franz 128
        QHBoxLayout* Layout1C;
4182 subik 129
        //! \brief Property with default extension
130
        QString ext;
131
        //! \brief Property with default compress extension
132
        QString extZip;
3 paul 133
};
134
 
135
#endif