summaryrefslogtreecommitdiff
path: root/noncore/apps/zsafe/scqtfileedit.h
Unidiff
Diffstat (limited to 'noncore/apps/zsafe/scqtfileedit.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/zsafe/scqtfileedit.h106
1 files changed, 106 insertions, 0 deletions
diff --git a/noncore/apps/zsafe/scqtfileedit.h b/noncore/apps/zsafe/scqtfileedit.h
new file mode 100644
index 0000000..7b22bb7
--- a/dev/null
+++ b/noncore/apps/zsafe/scqtfileedit.h
@@ -0,0 +1,106 @@
1/***************************************************************************
2 scqtfileedit.h - description
3 -------------------
4 begin : Mon Sep 3 2001
5 copyright : (C) 2001 by Werner Schulte
6 email : sc@schulte-ac.de
7 ***************************************************************************/
8
9/* $Id$ */
10
11/***************************************************************************
12 * *
13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. *
17 * *
18 ***************************************************************************/
19
20#ifndef SCQTFILEEDIT_H
21#define SCQTFILEEDIT_H
22
23#include <qdir.h>
24#include <qobject.h>
25#include <qpixmap.h>
26#include <qstring.h>
27#include <qlistview.h>
28#include <qcombobox.h>
29#include <qtimer.h>
30
31#include <scqtfiledlg.h>
32
33#define MAXDIRCOMBOCOUNT 8
34#define MAXTYPECOMBOCOUNT 8
35
36/**
37 *@author Werner Schulte
38 */
39
40class ScQtFileEditDlg : public ScQtFileDlg, QDir
41{
42 Q_OBJECT
43public:
44 ScQtFileEditDlg( QWidget *parent=0, const char *name=0,
45 const QString &path="/", const QString &filter="*" );
46 ~ScQtFileEditDlg();
47 QString getResult( );
48 QString getFileName( );
49 void readIt( );
50 void setAutoExtension( bool ex=false );
51 void allowMkDir( bool mkdir=false );
52 void setNFilter( bool ff=false );
53 void setFSorting( bool ff=false );
54 void setMode( int mode=QDir::All );
55
56private slots:
57 void slotOK( );
58 void slotCancel( );
59 void slotDoubleClicked( QListViewItem *item=0 );
60 void slotSelectionChanged( QListViewItem *item=0 );
61 void slotDirComboBoxChanged( int item );
62 void slotTypeComboBoxChanged( int item );
63 void slotFileTextChanged( const QString &txt="" );
64 void slotShowDir();
65 void slotMkDir();
66
67protected:
68 QTimer showTimer;
69 bool mkdirflag, fsorting, fnfilter;
70 int fmode;
71 const QFileInfoList *qfil;
72 bool rFlag, exflag; // recursionFlag,extensionflag
73 QString bpath, bfilter, filename;
74 QString dirstr,linkstr, filestr;
75 QPixmap *fileIcon, *dirIcon, *linkIcon, *cdToParentIcon;
76 const QFileInfoList *readDir( const QString &path="/", const QString &filter="*" );
77 int checkComboEntryExists( QComboBox *com=0, const QString &str="" );
78 void insDirCombo( const QString &str="" );
79 void insTypeCombo( const QString &str="" );
80 void initDirCombo( const QString &str="" );
81 void initTypeCombo( const QString &str="" );
82 void autoExtension( );
83
84};
85
86class ScQtFileEdit : public QObject
87{
88 Q_OBJECT
89public:
90 ScQtFileEdit( QWidget *parent=0, const char *name=0 );
91 ~ScQtFileEdit();
92 static void resize( int width, int height );
93 static QString getOpenFileName( QWidget *parent=0, const char *name=0,
94 const QString &path="/", const QString &filter="*" );
95 static QString getSaveAsFileName( QWidget *parent=0, const char *name=0,
96 const QString &path="/", const QString &filter="*" );
97 static QString getDirName( QWidget *parent=0, const char *name=0,
98 const QString &path="/" );
99 static QString mkDir( QWidget *parent=0, const char *name=0,
100 const QString &path="/", const QString &filter="*" );
101
102protected:
103
104};
105
106#endif