summaryrefslogtreecommitdiffabout
path: root/microkde/ofileselector_p.h
Unidiff
Diffstat (limited to 'microkde/ofileselector_p.h') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/ofileselector_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/microkde/ofileselector_p.h b/microkde/ofileselector_p.h
index 834fd70..a7d97fe 100644
--- a/microkde/ofileselector_p.h
+++ b/microkde/ofileselector_p.h
@@ -44,193 +44,193 @@ public:
44 virtual void activate( const QString& ); 44 virtual void activate( const QString& );
45 QString name()const; 45 QString name()const;
46protected: 46protected:
47 OFileSelector* selector()const; 47 OFileSelector* selector()const;
48 void setName( const QString& ); 48 void setName( const QString& );
49 bool showNew()const; 49 bool showNew()const;
50 bool showClose()const; 50 bool showClose()const;
51 MimeTypes mimeTypes()const; 51 MimeTypes mimeTypes()const;
52 QStringList currentMimeType()const; 52 QStringList currentMimeType()const;
53 QString startDirectory()const; 53 QString startDirectory()const;
54protected: 54protected:
55 void ok(); 55 void ok();
56 void cancel(); 56 void cancel();
57 void closeMe(); 57 void closeMe();
58 void fileSelected( const QString& ); 58 void fileSelected( const QString& );
59 void fileSelected( const DocLnk& ); 59 void fileSelected( const DocLnk& );
60 void setCurrentFileName( const QString& ); 60 void setCurrentFileName( const QString& );
61 QString currentFileName()const; 61 QString currentFileName()const;
62 62
63private: 63private:
64 QString m_name; 64 QString m_name;
65 OFileSelector* m_selector; 65 OFileSelector* m_selector;
66}; 66};
67 67
68 68
69/* THE Document View hosting a FileSelector*/ 69/* THE Document View hosting a FileSelector*/
70class ODocumentFileView : public OFileViewInterface { 70class ODocumentFileView : public OFileViewInterface {
71public: 71public:
72 ODocumentFileView( OFileSelector* selector ); 72 ODocumentFileView( OFileSelector* selector );
73 ~ODocumentFileView(); 73 ~ODocumentFileView();
74 74
75 QString selectedName() const; 75 QString selectedName() const;
76 QString selectedPath() const; 76 QString selectedPath() const;
77 77
78 QString directory() const; 78 QString directory() const;
79 void reread(); 79 void reread();
80 int fileCount()const; 80 int fileCount()const;
81 DocLnk selectedDocument()const; 81 DocLnk selectedDocument()const;
82 82
83 QWidget* widget( QWidget* parent ); 83 QWidget* widget( QWidget* parent );
84 84
85private: 85private:
86 mutable FileSelector* m_selector; 86 mutable FileSelector* m_selector;
87 87
88}; 88};
89 89
90class OFileSelectorItem : public QListViewItem { 90class OFileSelectorItem : public QListViewItem {
91public: 91public:
92 OFileSelectorItem( QListView* view, const QPixmap& pixmap, 92 OFileSelectorItem( QListView* view, const QPixmap& pixmap,
93 const QString& path, const QString& date, 93 const QString& path, const QString& date,
94 const QString& size, const QString& mDir, 94 const QString& size, const QString& mDir,
95 bool isLocked = false, bool isDir = false ); 95 bool isLocked = false, bool isDir = false );
96 ~OFileSelectorItem(); 96 ~OFileSelectorItem();
97 bool isLocked()const; 97 bool isLocked()const;
98 bool isDir()const; 98 bool isDir()const;
99 QString directory()const; 99 QString directory()const;
100 QString path()const; 100 QString path()const;
101 QString key(int id, bool )const; 101 QString key(int id, bool )const;
102 102
103private: 103private:
104 bool m_locked : 1; 104 bool m_locked : 1;
105 bool m_isDir : 1; 105 bool m_isDir : 1;
106 QString m_dir; 106 QString m_dir;
107}; 107};
108 108
109class OFileViewFileListView : public QWidget { 109class OFileViewFileListView : public QWidget {
110 Q_OBJECT 110 Q_OBJECT
111public: 111public:
112 OFileViewFileListView( QWidget* parent, const QString& dir, OFileSelector* selector ); 112 OFileViewFileListView( QWidget* parent, const QString& dir, OFileSelector* selector );
113 ~OFileViewFileListView(); 113 ~OFileViewFileListView();
114 114
115 OFileSelectorItem* currentItem()const; 115 OFileSelectorItem* currentItem()const;
116 void reread( bool all = false ); 116 void reread( bool all = false );
117 int fileCount()const; 117 int fileCount()const;
118 QString currentDir()const; 118 QString currentDir()const;
119protected: 119protected:
120 bool eventFilter (QObject *o, QEvent *e); 120 bool eventFilter (QObject *o, QEvent *e);
121private slots: 121private slots:
122 void slotNew(); // will emit newSelected 122 void slotNew(); // will emit newSelected
123 void cdUP(); 123 void cdUP();
124 void cdHome(); 124 void cdHome();
125 void cdDoc(); 125 void cdDoc();
126 void changeDir( const QString& ); 126 void changeDir( const QString& );
127 void slotCurrentChanged( QListViewItem* ); 127 void slotCurrentChanged( QListViewItem* );
128 void slotClicked(int, QListViewItem*, const QPoint&, int ); 128 void slotClicked(int, QListViewItem*, const QPoint&, int );
129 void slotDoubleClicked(QListViewItem*); 129 void slotDoubleClicked(QListViewItem*);
130 void slotFSActivated(int); 130 void slotFSActivated(int);
131 131
132protected: 132protected:
133 133
134 OFileSelector* selector(); 134 OFileSelector* selector();
135 135
136private: 136private:
137 QMap<QString, QString> m_dev; 137 QMap<QString, QString> m_dev;
138 bool m_all : 1; 138 bool m_all : 1;
139 OFileSelector* m_sel; 139 OFileSelector* m_sel;
140 QPopupMenu* m_fsPop; 140 Q3PopupMenu* m_fsPop;
141 bool compliesMime( const QString& ); 141 bool compliesMime( const QString& );
142 QStringList m_mimes; // used in compy mime 142 QStringList m_mimes; // used in compy mime
143 QString m_currentDir; 143 QString m_currentDir;
144 QToolButton *m_btnNew, *m_btnClose; 144 QToolButton *m_btnNew, *m_btnClose;
145 void connectSlots(); 145 void connectSlots();
146 void addFile( QFileInfo* info, bool symlink = FALSE ); 146 void addFile( QFileInfo* info, bool symlink = FALSE );
147 void addDir ( QFileInfo* info, bool symlink = FALSE ); 147 void addDir ( QFileInfo* info, bool symlink = FALSE );
148 void addSymlink( QFileInfo* info, bool = FALSE ); 148 void addSymlink( QFileInfo* info, bool = FALSE );
149 149
150 150
151private: 151private:
152 QListView* m_view; 152 QListView* m_view;
153}; 153};
154 154
155typedef QMap<QString, QStringList> MimeTypes; 155typedef QMap<QString, QStringList> MimeTypes;
156 156
157class OFileViewInterface; 157class OFileViewInterface;
158class OFileViewFileListView; 158class OFileViewFileListView;
159class QLineEdit; 159class QLineEdit;
160class QComboBox; 160class QComboBox;
161class QWidgetStack; 161class QWidgetStack;
162class QHBox; 162class QHBox;
163class OFileSelector : public QWidget { 163class OFileSelector : public QWidget {
164 Q_OBJECT 164 Q_OBJECT
165 friend class OFileViewInterface; 165 friend class OFileViewInterface;
166 friend class OFileViewFileListView; 166 friend class OFileViewFileListView;
167public: 167public:
168 enum Mode { Open=1, Save=2, FileSelector=4, OPEN=1, SAVE=2, FILESELECTOR=4 }; 168 enum Mode { Open=1, Save=2, FileSelector=4, OPEN=1, SAVE=2, FILESELECTOR=4 };
169// enum OldMode { OPEN=1, SAVE=2, FILESELECTOR = 4 }; 169// enum OldMode { OPEN=1, SAVE=2, FILESELECTOR = 4 };
170 enum Selector { Normal = 0, Extended=1, ExtendedAll =2, Default=3, NORMAL=0,EXTENDED=1, EXTENDED_ALL =2, DEFAULT=3 }; 170 enum Selector { Normal = 0, Extended=1, ExtendedAll =2, Default=3, NORMAL=0,EXTENDED=1, EXTENDED_ALL =2, DEFAULT=3 };
171// enum OldSelector { NORMAL = 0, EXTENDED =1, EXTENDED_ALL = 2}; 171// enum OldSelector { NORMAL = 0, EXTENDED =1, EXTENDED_ALL = 2};
172 172
173 OFileSelector(QWidget* parent, int mode, int selector, 173 OFileSelector(QWidget* parent, int mode, int selector,
174 const QString& dirName, 174 const QString& dirName,
175 const QString& fileName, 175 const QString& fileName,
176 const MimeTypes& mimetypes = MimeTypes(), 176 const MimeTypes& mimetypes = MimeTypes(),
177 bool newVisible = FALSE, bool closeVisible = FALSE ); 177 bool newVisible = FALSE, bool closeVisible = FALSE );
178 178
179 OFileSelector(const QString& mimeFilter, QWidget* parent, 179 OFileSelector(const QString& mimeFilter, QWidget* parent,
180 const char* name = 0, bool newVisible = TRUE, bool closeVisible = FALSE ); 180 const char* name = 0, bool newVisible = TRUE, bool closeVisible = FALSE );
181 ~OFileSelector(); 181 ~OFileSelector();
182 182
183 const DocLnk* selected(); 183 const DocLnk* selected();
184 184
185 QString selectedName()const; 185 QString selectedName()const;
186 QString selectedPath()const; 186 QString selectedPath()const;
187 QString directory()const; 187 QString directory()const;
188 188
189 DocLnk selectedDocument()const; 189 DocLnk selectedDocument()const;
190 190
191 int fileCount()const; 191 int fileCount()const;
192 void reread(); 192 void reread();
193 193
194 int mode()const; 194 int mode()const;
195 int selector()const; 195 int selector()const;
196 196
197 197
198 void setNewVisible( bool b ); 198 void setNewVisible( bool b );
199 void setCloseVisible( bool b ); 199 void setCloseVisible( bool b );
200 void setNameVisible( bool b ); 200 void setNameVisible( bool b );
201 201
202signals: 202signals:
203 void dirSelected( const QString& ); 203 void dirSelected( const QString& );
204 void fileSelected( const DocLnk& ); 204 void fileSelected( const DocLnk& );
205 void fileSelected( const QString& ); 205 void fileSelected( const QString& );
206 void newSelected( const DocLnk& ); 206 void newSelected( const DocLnk& );
207 void closeMe(); 207 void closeMe();
208 void ok(); 208 void ok();
209 void cancel(); 209 void cancel();
210 210
211/* used by the ViewInterface */ 211/* used by the ViewInterface */
212private: 212private:
213 bool showNew()const; 213 bool showNew()const;
214 bool showClose()const; 214 bool showClose()const;
215 MimeTypes mimeTypes()const; 215 MimeTypes mimeTypes()const;
216 QStringList currentMimeType()const; 216 QStringList currentMimeType()const;
217 217
218private: 218private:
219 /* inits the Widgets */ 219 /* inits the Widgets */
220 void initUI(); 220 void initUI();
221 /* inits the MimeType ComboBox content + connects signals and slots */ 221 /* inits the MimeType ComboBox content + connects signals and slots */
222 void initMime(); 222 void initMime();
223 /* init the Views :) */ 223 /* init the Views :) */
224 void initViews(); 224 void initViews();
225 225
226private: 226private:
227 QLineEdit* m_lneEdit; // the LineEdit for the Name 227 QLineEdit* m_lneEdit; // the LineEdit for the Name
228 QComboBox *m_cmbView, *m_cmbMime; // two ComboBoxes to select the View and MimeType 228 QComboBox *m_cmbView, *m_cmbMime; // two ComboBoxes to select the View and MimeType
229 QWidgetStack* m_stack; // our widget stack which will contain the views 229 QWidgetStack* m_stack; // our widget stack which will contain the views
230 OFileViewInterface* currentView()const; // returns the currentView 230 OFileViewInterface* currentView()const; // returns the currentView
231 OFileViewInterface* m_current; // here is the view saved 231 OFileViewInterface* m_current; // here is the view saved
232 bool m_shNew : 1; // should we show New? 232 bool m_shNew : 1; // should we show New?
233 bool m_shClose : 1; // should we show Close? 233 bool m_shClose : 1; // should we show Close?
234 MimeTypes m_mimeType; // list of mimetypes 234 MimeTypes m_mimeType; // list of mimetypes
235 235
236 QMap<QString, OFileViewInterface*> m_views; // QString translated view name + ViewInterface Ptr 236 QMap<QString, OFileViewInterface*> m_views; // QString translated view name + ViewInterface Ptr