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