summaryrefslogtreecommitdiff
path: root/libopie2/opieui/fileselector/ofileselector.h
Unidiff
Diffstat (limited to 'libopie2/opieui/fileselector/ofileselector.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/fileselector/ofileselector.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/libopie2/opieui/fileselector/ofileselector.h b/libopie2/opieui/fileselector/ofileselector.h
index 7fa657b..2205963 100644
--- a/libopie2/opieui/fileselector/ofileselector.h
+++ b/libopie2/opieui/fileselector/ofileselector.h
@@ -31,71 +31,73 @@
31 L. J. Potter ljp@llornkcor.com 31 L. J. Potter ljp@llornkcor.com
32 Thanks a lot 32 Thanks a lot
33*/ 33*/
34 34
35#ifndef OFILESELECTOR_H 35#ifndef OFILESELECTOR_H
36#define OFILESELECTOR_H 36#define OFILESELECTOR_H
37 37
38/* OPIE */ 38/* OPIE */
39#include <qpe/applnk.h> 39#include <qpe/applnk.h>
40 40
41/* QT */ 41/* QT */
42#include <qlist.h> 42#include <qlist.h>
43#include <qwidget.h> 43#include <qwidget.h>
44#include <qmap.h> 44#include <qmap.h>
45#include <qvaluelist.h> 45#include <qvaluelist.h>
46#include <qstringlist.h> 46#include <qstringlist.h>
47 47
48class QLineEdit; 48class QLineEdit;
49class QComboBox; 49class QComboBox;
50class QWidgetStack; 50class QWidgetStack;
51class QHBox; 51class QHBox;
52 52
53typedef QMap<QString, QStringList> MimeTypes; 53typedef QMap<QString, QStringList> MimeTypes;
54 54
55namespace Opie 55namespace Opie {
56{ 56namespace Ui {
57 57
58namespace Private {
58class OFileViewInterface; 59class OFileViewInterface;
59class OFileViewFileListView; 60class OFileViewFileListView;
61}
60 62
61 63
62/** 64/**
63 * @short a dropin replacement for the FileSelector 65 * @short a dropin replacement for the FileSelector
64 * 66 *
65 * This class is first used insert the OFileDialog. 67 * This class is first used insert the OFileDialog.
66 * It supports multiple view and mimetype filtering for now. 68 * It supports multiple view and mimetype filtering for now.
67 * 69 *
68 * @see OFileDialog 70 * @see OFileDialog
69 * @see FileSelector 71 * @see FileSelector
70 * @author zecke 72 * @author zecke
71 * @version 0.1 73 * @version 0.1
72 */ 74 */
73class OFileSelector : public QWidget 75class OFileSelector : public QWidget
74{ 76{
75 Q_OBJECT 77 Q_OBJECT
76 friend class Opie::OFileViewInterface; 78 friend class Private::OFileViewInterface;
77 friend class Opie::OFileViewFileListView; 79 friend class Private::OFileViewFileListView;
78 80
79public: 81public:
80 /** 82 /**
81 * The Mode of the Fileselector 83 * The Mode of the Fileselector
82 * Open = Open A File 84 * Open = Open A File
83 * Save = Save a File 85 * Save = Save a File
84 * FILESELECTOR = As A GUI in a screen to select a file 86 * FILESELECTOR = As A GUI in a screen to select a file
85 */ 87 */
86 enum Mode { Open=1, Save=2, FileSelector=4, OPEN=1, SAVE=2, FILESELECTOR=4 }; 88 enum Mode { Open=1, Save=2, FileSelector=4, OPEN=1, SAVE=2, FILESELECTOR=4 };
87 // enum OldMode { OPEN=1, SAVE=2, FILESELECTOR = 4 }; 89 // enum OldMode { OPEN=1, SAVE=2, FILESELECTOR = 4 };
88 /** 90 /**
89 * Normal = The old FileSelector 91 * Normal = The old FileSelector
90 * Extended = Dir View 92 * Extended = Dir View
91 * ExtendedAll = Dir View with all hidden files 93 * ExtendedAll = Dir View with all hidden files
92 * Default = What the vendor considers best 94 * Default = What the vendor considers best
93 */ 95 */
94 enum Selector { Normal = 0, Extended=1, ExtendedAll =2, Default=3, NORMAL=0,EXTENDED=1, EXTENDED_ALL =2, DEFAULT=3 }; 96 enum Selector { Normal = 0, Extended=1, ExtendedAll =2, Default=3, NORMAL=0,EXTENDED=1, EXTENDED_ALL =2, DEFAULT=3 };
95 // enum OldSelector { NORMAL = 0, EXTENDED =1, EXTENDED_ALL = 2}; 97 // enum OldSelector { NORMAL = 0, EXTENDED =1, EXTENDED_ALL = 2};
96 98
97 OFileSelector(QWidget* parent, int mode, int selector, 99 OFileSelector(QWidget* parent, int mode, int selector,
98 const QString& dirName, 100 const QString& dirName,
99 const QString& fileName, 101 const QString& fileName,
100 const MimeTypes& mimetypes = MimeTypes(), 102 const MimeTypes& mimetypes = MimeTypes(),
101 bool newVisible = FALSE, bool closeVisible = FALSE ); 103 bool newVisible = FALSE, bool closeVisible = FALSE );
@@ -164,56 +166,57 @@ signals:
164 * in the line edit 166 * in the line edit
165 */ 167 */
166 void ok(); 168 void ok();
167 void cancel(); 169 void cancel();
168 170
169 /* used by the ViewInterface */ 171 /* used by the ViewInterface */
170private: 172private:
171 bool showNew()const; 173 bool showNew()const;
172 bool showClose()const; 174 bool showClose()const;
173 MimeTypes mimeTypes()const; 175 MimeTypes mimeTypes()const;
174 QStringList currentMimeType()const; 176 QStringList currentMimeType()const;
175 177
176private: 178private:
177 /* inits the Widgets */ 179 /* inits the Widgets */
178 void initUI(); 180 void initUI();
179 /* inits the MimeType ComboBox content + connects signals and slots */ 181 /* inits the MimeType ComboBox content + connects signals and slots */
180 void initMime(); 182 void initMime();
181 /* init the Views :) */ 183 /* init the Views :) */
182 void initViews(); 184 void initViews();
183 185
184private: 186private:
185 QLineEdit* m_lneEdit; // the LineEdit for the Name 187 QLineEdit* m_lneEdit; // the LineEdit for the Name
186 QComboBox *m_cmbView, *m_cmbMime; // two ComboBoxes to select the View and MimeType 188 QComboBox *m_cmbView, *m_cmbMime; // two ComboBoxes to select the View and MimeType
187 QWidgetStack* m_stack; // our widget stack which will contain the views 189 QWidgetStack* m_stack; // our widget stack which will contain the views
188 OFileViewInterface* currentView() const; // returns the currentView 190 Private::OFileViewInterface* currentView() const; // returns the currentView
189 OFileViewInterface* m_current; // here is the view saved 191 Private::OFileViewInterface* m_current; // here is the view saved
190 bool m_shNew : 1; // should we show New? 192 bool m_shNew : 1; // should we show New?
191 bool m_shClose : 1; // should we show Close? 193 bool m_shClose : 1; // should we show Close?
192 MimeTypes m_mimeType; // list of mimetypes 194 MimeTypes m_mimeType; // list of mimetypes
193 195
194 QMap<QString, OFileViewInterface*> m_views; // QString translated view name + ViewInterface Ptr 196 QMap<QString, Private::OFileViewInterface*> m_views; // QString translated view name + ViewInterface Ptr
195 QHBox* m_nameBox; // the LineEdit + Label is hold here 197 QHBox* m_nameBox; // the LineEdit + Label is hold here
196 QHBox* m_cmbBox; // this holds the two combo boxes 198 QHBox* m_cmbBox; // this holds the two combo boxes
197 199
198 QString m_startDir; 200 QString m_startDir;
199 int m_mode; 201 int m_mode;
200 int m_selector; 202 int m_selector;
201 203
202 struct Data; // used for future versions 204 struct Data; // used for future versions
203 Data *d; 205 Data *d;
204 206
205private slots: 207private slots:
206 void slotMimeTypeChanged(); 208 void slotMimeTypeChanged();
207 209
208 /* will set the text of the lineedit and emit a fileChanged signal */ 210 /* will set the text of the lineedit and emit a fileChanged signal */
209 void slotDocLnkBridge( const DocLnk& ); 211 void slotDocLnkBridge( const DocLnk& );
210 void slotFileBridge( const QString& ); 212 void slotFileBridge( const QString& );
211 void slotViewChange( const QString& ); 213 void slotViewChange( const QString& );
212 214
213 bool eventFilter (QObject *o, QEvent *e); 215 bool eventFilter (QObject *o, QEvent *e);
214 216
215}; 217};
216 218
217}; 219}
220}
218 221
219#endif 222#endif