Scribus
Open source desktop publishing at your fingertips
customfdialog.h
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 */
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 <QDialog>
28 #include <QFileIconProvider>
29 #include <QLabel>
30 class QPushButton;
31 class QComboBox;
32 class QCheckBox;
33 class QHBoxLayout;
34 class QVBoxLayout;
35 class QFrame;
36 class ScFileWidget;
37 class QIcon;
38 
39 #include "scribusapi.h"
40 
44 class SCRIBUS_API ImIconProvider : public QFileIconProvider
45 {
46 public:
48  ~ImIconProvider() {};
49  QIcon icon(const QFileInfo &fi) const;
50  QStringList fmts;
51  QIcon imagepm;
52  QIcon docpm;
53  QIcon pspm;
54  QIcon pdfpm;
55  QIcon txtpm;
56  QIcon oosxdpm;
57  QIcon oosxwpm;
58  QIcon vectorpm;
59 };
60 
61 class SCRIBUS_API FDialogPreview : public QLabel
62 {
63  Q_OBJECT
64 public:
65  FDialogPreview(QWidget *pa);
66  ~FDialogPreview() {};
67  void updtPix();
68  void GenPreview(QString name);
69 };
70 
71 typedef enum {
72  fdNone = 0,
73  fdShowPreview = 1, // display text/image previewer
74  fdExistingFiles = 2, // When set, set to the QFileDialog::ExistingFile mode when true, QFileDialog::AnyFile otherwise
75  fdCompressFile = 4, // Show and handle the "Compress" behaviour and CheckBox (true)
76  fdShowCodecs = 8, // Show and handle text codecs and ComboBox (true)
77  fdDirectoriesOnly = 16, // Show only directories
78  fdHidePreviewCheckBox = 32, // Hide preview Checkbox
79  fdExistingFilesI = 64, // For multiple files
80  fdShowImportOptions = 128 // Show Vector Images Import Options
81 } fdFlags;
82 
87 class SCRIBUS_API CustomFDialog : public QDialog
88 {
89  Q_OBJECT
90 public:
98  CustomFDialog(QWidget *parent, QString wDir, QString caption = "", QString filter = "", int flags = fdExistingFiles);
99  ~CustomFDialog();
100 
104  void setExtension(QString e);
107  QString extension();
111  void setZipExtension(QString e);
114  QString zipExtension();
115 
116  QCheckBox* SaveZip;
117  QCheckBox* WithFonts;
118  QCheckBox* WithProfiles;
119  QFrame* Layout;
120  QFrame* LayoutC;
121  QComboBox *TxCodeM;
122  QLabel *TxCodeT;
123  ScFileWidget *fileDialog;
124  FDialogPreview *pw;
125  QCheckBox *showPreview;
126  QPushButton* OKButton;
127  QPushButton* CancelB;
128  void setSelection(QString );
129  QString selectedFile();
130  void addWidgets(QWidget *widgets);
131 private slots:
133  void fileClicked(const QString &path);
134  void togglePreview();
135 public slots:
137  void handleCompress();
138 protected:
139  QVBoxLayout *vboxLayout;
140  QVBoxLayout *vboxLayout1;
141  QHBoxLayout *hboxLayout;
142  QHBoxLayout* Layout1;
143  QHBoxLayout* Layout1C;
145  QString ext;
147  QString extZip;
150  bool previewIsShown;
151 };
152 
153 #endif
QString extZip
Property with default compress extension.
Definition: customfdialog.h:147
A Scribus own file dialog. Used almost everywhere. You can see extension handling in e...
Definition: customfdialog.h:87
Simple wrapper simulating the QFileDialog as a common widget. Usage is simple - everything is like in...
Definition: scfilewidget.h:25
Definition: customfdialog.h:61
int optionFlags
Option flags given by user in ctore.
Definition: customfdialog.h:149
QString ext
Property with default extension.
Definition: customfdialog.h:145
Definition: customfdialog.h:44