Diffstat (limited to 'libslcompat/slfileselector.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libslcompat/slfileselector.h | 413 |
1 files changed, 0 insertions, 413 deletions
diff --git a/libslcompat/slfileselector.h b/libslcompat/slfileselector.h deleted file mode 100644 index 94ed3b7..0000000 --- a/libslcompat/slfileselector.h +++ b/dev/null | |||
@@ -1,413 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 SHARP CORPORATION All rights reserved. | ||
3 | */ | ||
4 | #ifndef _SLFILESELECTOR_H_INCLUDED | ||
5 | #define _SLFILESELECTOR_H_INCLUDED | ||
6 | |||
7 | #include <opie2/ofileselector.h> | ||
8 | #include <qhbox.h> | ||
9 | #include <qvbox.h> | ||
10 | #include <qlistview.h> | ||
11 | #include <qiconview.h> | ||
12 | #include <qtoolbutton.h> | ||
13 | #include <qfileinfo.h> | ||
14 | #include <qtableview.h> | ||
15 | #include <qwidgetstack.h> | ||
16 | #include <qvaluelist.h> | ||
17 | |||
18 | #include <qpe/applnk.h> | ||
19 | #include <qpe/mimetype.h> | ||
20 | #include <sl/slmisc.h> | ||
21 | |||
22 | class QComboBox; | ||
23 | class SlFileItemType; | ||
24 | class QCopChannel; | ||
25 | |||
26 | struct SlFileListItemPrivate; | ||
27 | class SlFileListItem | ||
28 | { | ||
29 | public: | ||
30 | SlFileListItem(const QFileInfo&,const MimeType&); | ||
31 | ~SlFileListItem(); | ||
32 | const QFileInfo &file() const; | ||
33 | const MimeType &mimeType() const; | ||
34 | const QString getItemIconFilePath() const; | ||
35 | const QString name() const; | ||
36 | void setName(const QString&); | ||
37 | const QString sortKey() const; | ||
38 | void setSortKey(const QString&); | ||
39 | QPixmap pixmap() const; | ||
40 | QPixmap bigPixmap() const; | ||
41 | const QString dateString() const; | ||
42 | const QString typeString() const; | ||
43 | const QString bytesString() const; | ||
44 | void setDevice(); | ||
45 | bool isDevice() const; | ||
46 | enum ColumnItem { | ||
47 | Name = 1, | ||
48 | Type, | ||
49 | Date, | ||
50 | Bytes, | ||
51 | Custom = 100 | ||
52 | }; | ||
53 | private: | ||
54 | SlFileListItemPrivate *p; | ||
55 | SlFileListItem(const SlFileListItem&); | ||
56 | }; | ||
57 | |||
58 | typedef QValueList<SlFileListItem*> SlFileList; | ||
59 | typedef QValueList<SlFileListItem::ColumnItem> SlFileListColumnConf; | ||
60 | |||
61 | class SlFileListViewItem; | ||
62 | |||
63 | struct SlFileListViewPrivate; | ||
64 | class SlFileListView : public QListView | ||
65 | { | ||
66 | Q_OBJECT | ||
67 | |||
68 | public: | ||
69 | SlFileListView(QWidget*, const char*); | ||
70 | ~SlFileListView(); | ||
71 | void createFileList(SlFileList&); | ||
72 | int fileCount() const; | ||
73 | void updateItem(SlFileListViewItem*); | ||
74 | void createItem(SlFileListItem*); | ||
75 | void deleteItem(const QString&); | ||
76 | void deleteItem(SlFileListViewItem*); | ||
77 | SlFileListViewItem* searchItem(const QString&); | ||
78 | SlFileListColumnConf columnConf(); | ||
79 | void setColumnConf(SlFileListColumnConf&); | ||
80 | void updateColumn(); | ||
81 | static const QString columnItemName(SlFileListItem::ColumnItem); | ||
82 | static const SlFileListColumnConf columnItemList(); | ||
83 | |||
84 | //virtual void takeItem( SlFileListViewItem * ); | ||
85 | |||
86 | SlMisc::SlListColumnInfos columnWidthInfos(); | ||
87 | |||
88 | protected: | ||
89 | //void keyPressEvent( QKeyEvent *e ); | ||
90 | |||
91 | signals: | ||
92 | void keyPressed(QKeyEvent *e,bool &isAccepted); | ||
93 | |||
94 | protected slots: | ||
95 | |||
96 | private: | ||
97 | friend class SlFileSelector; | ||
98 | SlFileListViewPrivate *p; | ||
99 | SlFileListView(const SlFileListView&); | ||
100 | }; | ||
101 | |||
102 | class SlFileIconViewItem; | ||
103 | |||
104 | struct SlFileIconViewPrivate; | ||
105 | class SlFileIconView : public QIconView | ||
106 | { | ||
107 | Q_OBJECT | ||
108 | |||
109 | public: | ||
110 | SlFileIconView(QWidget*, const char*); | ||
111 | ~SlFileIconView(); | ||
112 | void createFileList(SlFileList&); | ||
113 | int fileCount() const; | ||
114 | void updateItem(SlFileIconViewItem*); | ||
115 | void createItem(SlFileListItem*); | ||
116 | void deleteItem(const QString&); | ||
117 | void deleteItem(SlFileIconViewItem*); | ||
118 | SlFileIconViewItem* searchItem(const QString&); | ||
119 | void setSorting(int column,bool ascending); | ||
120 | int sortColumn() const; | ||
121 | void repaintItemsForce(); | ||
122 | SlFileListColumnConf columnConf(); | ||
123 | void setColumnConf(SlFileListColumnConf&); | ||
124 | |||
125 | //virtual void takeItem( SlFileIconViewItem * ); | ||
126 | |||
127 | protected: | ||
128 | //void keyPressEvent( QKeyEvent *e ); | ||
129 | |||
130 | protected slots: | ||
131 | |||
132 | signals: | ||
133 | void keyPressed(QKeyEvent *e,bool &isAccepted); | ||
134 | |||
135 | private: | ||
136 | friend class SlFileSelector; | ||
137 | SlFileIconViewPrivate *p; | ||
138 | SlFileIconView(const SlFileIconView&); | ||
139 | }; | ||
140 | |||
141 | class SlFileSelectorFilter : public QObject | ||
142 | { | ||
143 | public: | ||
144 | SlFileSelectorFilter(QWidget *parent,const char *name=0); | ||
145 | ~SlFileSelectorFilter(); | ||
146 | |||
147 | virtual bool isAddToList(QFileInfo&) const = 0; | ||
148 | private: | ||
149 | SlFileSelectorFilter(const SlFileSelectorFilter&); | ||
150 | }; | ||
151 | |||
152 | typedef QList<MimeType> SlFileMimeTypeList; | ||
153 | |||
154 | struct SlFileSelectorPrivate; | ||
155 | class SlFileSelector : public Opie::Ui::OFileSelector /*QVBox*/ | ||
156 | { | ||
157 | Q_OBJECT | ||
158 | |||
159 | public: | ||
160 | |||
161 | |||
162 | enum SlFileSelectorViewType { | ||
163 | |||
164 | ListView = 1, | ||
165 | |||
166 | IconView | ||
167 | }; | ||
168 | |||
169 | |||
170 | enum SlFileOverwirteMode { | ||
171 | |||
172 | Overwrite = 1, | ||
173 | |||
174 | NewName, | ||
175 | |||
176 | Error | ||
177 | }; | ||
178 | SlFileSelector(const QString &dirPath, | ||
179 | const QString &mimefilter, | ||
180 | QWidget *parent, | ||
181 | const char *name); | ||
182 | SlFileSelector(const QString ¤tFileName, | ||
183 | SlFileSelectorViewType type, | ||
184 | const QString &mimeFilter, | ||
185 | SlFileListColumnConf &items, | ||
186 | int sortColumn,bool sortAscending, | ||
187 | SlFileSelectorFilter *filter=NULL, | ||
188 | bool isRecursive=FALSE, | ||
189 | QWidget *parent=NULL, | ||
190 | const char *name=NULL, | ||
191 | WFlags f=0); | ||
192 | SlFileSelector(QWidget *parent=NULL,const char *name=NULL,WFlags f=0); | ||
193 | virtual ~SlFileSelector(); | ||
194 | void createFileList(); | ||
195 | void createFileList(QDir&); | ||
196 | int fileCount() const; | ||
197 | const QFileInfo* selected(); | ||
198 | void modifyItem(QFileInfo*,bool); | ||
199 | void createItem(QString&); | ||
200 | void deleteItem(const QString&); | ||
201 | void deleteItem(); | ||
202 | void updateItem(const QString&); | ||
203 | SlFileListItem* searchItem(const QString&); | ||
204 | void setSelected(); | ||
205 | void setSelected(const QString&); | ||
206 | void ensureItemVisible(); | ||
207 | SlFileListItem* selectedItem(); | ||
208 | bool setSelectedNext(bool); | ||
209 | bool setSelectedPrev(bool); | ||
210 | const QString currentDir(); | ||
211 | void setSorting(int,bool); | ||
212 | int sortColumn() const; | ||
213 | bool ascending() const; | ||
214 | SlFileSelectorViewType viewType(); | ||
215 | void setColumnItem(SlFileListColumnConf&); | ||
216 | void setViewType(SlFileSelectorViewType); | ||
217 | void setListView(); | ||
218 | void setIconView(); | ||
219 | int columnWidth(int); | ||
220 | void setColumnWidth(int,int); | ||
221 | static const QString columnItemName(SlFileListItem::ColumnItem); | ||
222 | static const SlFileListColumnConf columnItemList(); | ||
223 | |||
224 | int columns() const; | ||
225 | |||
226 | bool upDir(); | ||
227 | bool isTopDir(); | ||
228 | |||
229 | void setCurrentFile(const QString&); | ||
230 | const QString currentFile(bool isReal=FALSE); | ||
231 | static bool copyFile(const QString&,const QString&, | ||
232 | SlFileOverwirteMode m=Error, | ||
233 | QString *resultName=NULL); | ||
234 | |||
235 | static bool copyFileCreateDir(const QString &srcName, | ||
236 | const QString &dstName, | ||
237 | SlFileOverwirteMode m=Error, | ||
238 | QString *resultName=NULL); | ||
239 | static bool moveFile(const QString&,const QString&, | ||
240 | SlFileOverwirteMode m=Error, | ||
241 | QString *resultName=NULL); | ||
242 | static QString getCopyFileName(const QString&); | ||
243 | |||
244 | const QStringList& recent() const; | ||
245 | void setRecent(const QStringList&); | ||
246 | |||
247 | |||
248 | void setRecent(const QStringList&,bool isReplace); | ||
249 | void setRecentEnabled(bool); | ||
250 | |||
251 | const QStringList& history() const; | ||
252 | void setHistory(const QStringList&); | ||
253 | |||
254 | |||
255 | void setHistory(const QStringList&,bool isReplace); | ||
256 | bool isHistoryBackAvailable() const; | ||
257 | bool isHistoryForwardAvailable() const; | ||
258 | bool historyBack(); | ||
259 | bool historyForward(); | ||
260 | QPopupMenu *backHistoryPopupMenu() const; | ||
261 | QPopupMenu *forwardHistoryPopupMenu() const; | ||
262 | void setColumnConf(SlFileListColumnConf&); | ||
263 | |||
264 | void sendFileUpdateMessage(const QString&); | ||
265 | void updateView(); | ||
266 | void recreateIcon(); | ||
267 | void focusToNext(); | ||
268 | void focusToPrev(); | ||
269 | bool rename(); | ||
270 | bool newfolder(); | ||
271 | bool del(); | ||
272 | bool duplicate(); | ||
273 | bool cut(); | ||
274 | bool copy(); | ||
275 | bool paste(); | ||
276 | void setMimeFilter(const QString &); | ||
277 | void clearTmpFolder(); | ||
278 | |||
279 | void setRecursive(bool,bool); | ||
280 | bool recursive() const; | ||
281 | void setFilter(SlFileSelectorFilter *); | ||
282 | SlFileSelectorFilter *filter(); | ||
283 | bool isEnablePaste(); | ||
284 | |||
285 | static bool deleteFile(const QString&); | ||
286 | static bool deleteDir(const QDir&); | ||
287 | static bool copyDir(const QString &srcName,const QString &dstName, | ||
288 | SlFileOverwirteMode m=Error); | ||
289 | static bool moveDir(const QString&,const QString&, | ||
290 | SlFileOverwirteMode m=Error); | ||
291 | static QString getCopyDirName(const QString &); | ||
292 | static bool makeDir(const QString &path); | ||
293 | |||
294 | static uint size(const QString &fName); | ||
295 | static uint fileFree(const QString &fName); | ||
296 | |||
297 | |||
298 | |||
299 | enum DesktopMode { | ||
300 | |||
301 | HideDesktop = 1, | ||
302 | |||
303 | ShowAll, | ||
304 | |||
305 | FileTab | ||
306 | }; | ||
307 | void setDesktopMode(DesktopMode mode); | ||
308 | void setEnabledSystemChannel(bool); | ||
309 | void showUpDirBtn(bool); | ||
310 | void showWritableFile(bool); | ||
311 | |||
312 | |||
313 | void setEnableSD(bool); | ||
314 | void setEnableCF(bool); | ||
315 | bool getEnableSD(); | ||
316 | bool getEnableCF(); | ||
317 | |||
318 | |||
319 | |||
320 | |||
321 | void sendKeyPressEvent( QKeyEvent *e ); | ||
322 | |||
323 | void setScale(int scale); | ||
324 | int scale() const; | ||
325 | |||
326 | SlMisc::SlListColumnInfos columnWidthInfos(); | ||
327 | |||
328 | |||
329 | |||
330 | enum FocusMode { | ||
331 | |||
332 | Auto = 1, | ||
333 | |||
334 | ByTab, | ||
335 | |||
336 | ByCommand | ||
337 | }; | ||
338 | void setFocusMode(FocusMode mode); | ||
339 | |||
340 | void adjustContentsSize(); | ||
341 | |||
342 | static void updateFile(const QString &filename); | ||
343 | |||
344 | bool delFile(const QString &mymsg); | ||
345 | |||
346 | bool isIncludedFile(const QString &filename); | ||
347 | |||
348 | signals: | ||
349 | |||
350 | |||
351 | void selectionChanged(const QFileInfo &file,bool isDevice); | ||
352 | |||
353 | |||
354 | void fileSelected(const QFileInfo &file); | ||
355 | |||
356 | |||
357 | void dirOpened(const QDir &dir); | ||
358 | |||
359 | |||
360 | void enabledPaste(bool); | ||
361 | |||
362 | |||
363 | void columnWidthChanged(int column,int oldSize,int newSize); | ||
364 | |||
365 | |||
366 | void itemRightPressed(const QFileInfo &file,const QPoint &pos); | ||
367 | |||
368 | |||
369 | void selectionLost(); | ||
370 | |||
371 | |||
372 | //void keyPressed(QKeyEvent *e,bool &isAccepted); | ||
373 | /* | ||
374 | private slots: | ||
375 | void fileClicked(QListViewItem *); | ||
376 | void fileClicked(QIconViewItem *); | ||
377 | void selectionChanged(QListViewItem *); | ||
378 | void selectionChanged(QIconViewItem *); | ||
379 | void dMenuChanged(int); | ||
380 | void changeDirectory(int,bool isImmediate=TRUE); | ||
381 | void hMenuSelected(int); | ||
382 | void cardMessage( const QCString &, const QByteArray &); | ||
383 | void systemMessage( const QCString &, const QByteArray &); | ||
384 | void headerClicked(int); | ||
385 | void asyncHMenuSelected(); | ||
386 | void asyncDMenuChanged(); | ||
387 | void rightPressed(QIconViewItem *,const QPoint&); | ||
388 | void rightPressed(QListViewItem *,const QPoint&,int); | ||
389 | void upDirClicked(); | ||
390 | void slotKeyPressed(QKeyEvent *e,bool &isAccepted); | ||
391 | */ | ||
392 | protected: | ||
393 | void focusInEvent(QFocusEvent*); | ||
394 | void show(); | ||
395 | void keyPressEvent( QKeyEvent *e ); | ||
396 | |||
397 | private: | ||
398 | void openDirInside(QDir&); | ||
399 | void createMyPda(); | ||
400 | void init(); | ||
401 | SlFileSelectorPrivate *p; | ||
402 | SlFileSelector(const SlFileSelector&); | ||
403 | ulong focusWidgets() const; | ||
404 | QWidget* nextFocus(QWidget *,bool) const; | ||
405 | bool focusToTheWidget(QWidget *); | ||
406 | }; | ||
407 | |||
408 | #endif | ||
409 | |||
410 | |||
411 | |||
412 | |||
413 | |||