1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef FILEBROWSERVIEWH_H_ |
|
19 #define FILEBROWSERVIEWH_H_ |
|
20 |
|
21 #include "menuaction.h" |
|
22 #include "enginewrapper.h" |
|
23 |
|
24 #include <HbView> |
|
25 #include <HbMainWindow> |
|
26 #include <HbApplication> |
|
27 |
|
28 #include <QModelIndexList> |
|
29 |
|
30 // Forward declarations |
|
31 class QFileInfo; |
|
32 class QSignalMapper; |
|
33 class QItemSelection; |
|
34 class QString; |
|
35 class QGraphicsLinearLayout; |
|
36 |
|
37 class HbListView; |
|
38 class HbListWidget; |
|
39 class HbToolBar; |
|
40 class HbLabel; |
|
41 class HbDialog; |
|
42 class HbAbstractViewItem; |
|
43 class HbMenu; |
|
44 |
|
45 class FileBrowserMainWindow; |
|
46 class EditorView; |
|
47 class SearchView; |
|
48 class SettingsView; |
|
49 class EngineWrapper; |
|
50 class FileBrowserModel; |
|
51 |
|
52 class FileBrowserView : public HbView |
|
53 { |
|
54 Q_OBJECT |
|
55 |
|
56 public: |
|
57 explicit FileBrowserView(FileBrowserMainWindow &mainWindow); |
|
58 virtual ~FileBrowserView(); |
|
59 void init(EngineWrapper *engineWrapper); |
|
60 |
|
61 public slots: |
|
62 void refreshList(); |
|
63 |
|
64 private: |
|
65 void fileOverwriteDialog(); |
|
66 void openListDialog(const QStringList &items, const QString &titleText, QObject *receiver, const char *member); |
|
67 |
|
68 void openPropertyDialog(const QStringList &propertyList, const QString &title); |
|
69 |
|
70 QModelIndex currentItemIndex(); |
|
71 void storeSelectedItemsOrCurrentItem(); |
|
72 |
|
73 // Menu related methods |
|
74 void createMenu(); |
|
75 void createFileMenu(); |
|
76 void createEditMenu(); |
|
77 void createViewMenu(); |
|
78 void createToolsMenu(); |
|
79 |
|
80 void createSelectionMenuItem(); |
|
81 void createSettingsMenuItem(); |
|
82 void createAboutMenuItem(); |
|
83 void createExitMenuItem(); |
|
84 |
|
85 void createContextMenu(); |
|
86 void createFileContextMenu(); |
|
87 void createEditContextMenu(); |
|
88 void createViewContextMenu(); |
|
89 void createDiskAdminContextMenu(); |
|
90 void createToolBar(); |
|
91 |
|
92 // void refreshList(); |
|
93 void populateFolderContent(); |
|
94 |
|
95 private slots: |
|
96 // menu action slots |
|
97 // file menu |
|
98 void fileBackMoveUp(); |
|
99 void fileOpenDrive(); |
|
100 void fileOpenDirectory(); |
|
101 void fileSearch(); |
|
102 |
|
103 void fileNewFile(); |
|
104 void doFileNewFile(HbAction *); |
|
105 |
|
106 void fileNewDirectory(); |
|
107 void doFileNewDirectory(HbAction *); |
|
108 |
|
109 void fileDelete(); |
|
110 void doFileDelete(HbAction *); |
|
111 |
|
112 void fileRename(); |
|
113 void doFileRename(HbAction *); |
|
114 void doFileRenameFileExist(HbAction *); |
|
115 |
|
116 void fileTouch(); |
|
117 void doFileTouch(HbAction *); |
|
118 void fileProperties(); |
|
119 |
|
120 void fileChecksumsMD5(); |
|
121 void fileChecksumsMD2(); |
|
122 void fileChecksumsSHA1(); |
|
123 void fileChecksums(TFileBrowserCmdFileChecksums checksumType); |
|
124 |
|
125 void fileSetAttributes(); |
|
126 |
|
127 // edit menu |
|
128 void editSnapShotToE(); |
|
129 void editCut(); |
|
130 void editCopy(); |
|
131 void editPaste(); |
|
132 |
|
133 void editCopyToFolder(); |
|
134 void doEditCopyToFolder(HbAction *); |
|
135 |
|
136 void editMoveToFolder(); |
|
137 void doEditMoveToFolder(HbAction *); |
|
138 |
|
139 void editSelect(); |
|
140 void editUnselect(); |
|
141 void editSelectAll(); |
|
142 void editUnselectAll(); |
|
143 |
|
144 // view menu |
|
145 void viewFilterEntries(); |
|
146 void viewRefresh(); |
|
147 |
|
148 // disk admin menu |
|
149 void diskAdminSetDrivePassword(); |
|
150 void diskAdminSetDrivePasswordNew(HbAction *); |
|
151 void doDiskAdminSetDrivePassword(HbAction *); |
|
152 |
|
153 void diskAdminUnlockDrive(); |
|
154 void doDiskAdminUnlockDrive(HbAction *); |
|
155 |
|
156 void diskAdminClearDrivePassword(); |
|
157 void doDiskAdminClearDrivePassword(HbAction *); |
|
158 |
|
159 void diskAdminEraseDrivePassword(); |
|
160 void doDiskAdminEraseDrivePassword(HbAction *); |
|
161 |
|
162 void diskAdminFormatDrive(); |
|
163 void doDiskAdminFormatDrive(HbAction *); |
|
164 |
|
165 void diskAdminQuickFormatDrive(); |
|
166 void doDiskAdminQuickFormatDrive(HbAction *); |
|
167 |
|
168 void diskAdminCheckDisk(); |
|
169 |
|
170 void diskAdminScanDrive(); |
|
171 void doDiskAdminScanDrive(HbAction *); |
|
172 |
|
173 void diskAdminSetDriveName(); |
|
174 void doDiskAdminSetDriveName(HbAction *); |
|
175 |
|
176 void diskAdminSetDriveVolumeLabel(); |
|
177 void doDiskAdminSetDriveVolumeLabel(HbAction *); |
|
178 |
|
179 void diskAdminEjectDrive(); |
|
180 void diskAdminDismountDrive(); |
|
181 void doDiskAdminDismountDrive(HbAction *); |
|
182 |
|
183 void diskAdminEraseMBR(); |
|
184 void doDiskAdminEraseMBR(HbAction *); |
|
185 void doDiskAdminReallyEraseMBR(HbAction *); |
|
186 void doDiskAdminNotRemovableReallyEraseMBR(HbAction *); |
|
187 |
|
188 void diskAdminPartitionDrive(); |
|
189 void diskAdminPartitionDriveProceed(HbAction *); |
|
190 void diskAdminPartitionDriveReallyProceed(HbAction *); |
|
191 void diskAdminPartitionDriveIsNotRemovable(HbAction *); |
|
192 void diskAdminPartitionDriveEraseMbr(HbAction *); |
|
193 void diskAdminPartitionDriveGetCount(HbAction*); |
|
194 |
|
195 // tools menu |
|
196 void toolsAllAppsToTextFile(); |
|
197 void toolsAllFilesToTextFile(); |
|
198 void toolsAvkonIconCacheEnable(); |
|
199 void toolsAvkonIconCacheDisable(); |
|
200 |
|
201 void toolsDisableExtendedErrors(); |
|
202 void toolsDumpMsgStoreWalk(); |
|
203 void toolsEditDataTypes(); |
|
204 void toolsEnableExtendedErrors(); |
|
205 |
|
206 void toolsErrorSimulateLeave(); |
|
207 void doToolsErrorSimulateLeave(HbAction *); |
|
208 |
|
209 void toolsErrorSimulatePanic(); |
|
210 void doToolsErrorSimulatePanicCode(HbAction *); |
|
211 void doToolsErrorSimulatePanic(HbAction *); |
|
212 |
|
213 void toolsErrorSimulateException(); |
|
214 void doToolsErrorSimulateException(HbAction *); |
|
215 |
|
216 // void toolsLocalConnectivityActivateInfrared(); |
|
217 // void toolsLocalConnectivityLaunchBTUI(); |
|
218 // void toolsLocalConnectivityLaunchUSBUI(); |
|
219 void toolsMessageInbox(); |
|
220 void toolsMessageDrafts(); |
|
221 void toolsMessageSentItems(); |
|
222 void toolsMessageOutbox(); |
|
223 void toolsMemoryInfo(); |
|
224 void toolsSecureBackStart(); |
|
225 void toolsSecureBackRestore(); |
|
226 void toolsSecureBackStop(); |
|
227 void toolsSetDebugMaskQuestion(); |
|
228 void toolsSetDebugMask(HbAction *); |
|
229 void toolsShowOpenFilesHere(); |
|
230 |
|
231 // main menu items |
|
232 void selectionModeChanged(); |
|
233 void about(); |
|
234 |
|
235 signals: |
|
236 void aboutToShowSettingsView(); |
|
237 void aboutToShowEditorView(const QString &, bool); |
|
238 void aboutToShowSearchView(const QString &); |
|
239 void aboutToSimulateLeave(int); |
|
240 |
|
241 private slots: |
|
242 void itemHighlighted(const QModelIndex &index); |
|
243 //void itemSelected(const QModelIndex &index); |
|
244 void updateOptionMenu(); |
|
245 void updateContextMenu(); |
|
246 void selectionChanged(const QItemSelection &, const QItemSelection &); |
|
247 void activated(const QModelIndex& index); |
|
248 void activateSelectionMode(); |
|
249 void deActivateSelectionMode(); |
|
250 void onLongPressed(HbAbstractViewItem *, QPointF); |
|
251 |
|
252 void fileOpen(HbAction *); |
|
253 void fileOverwrite(HbAction *); |
|
254 void fileOverwritePostfix(HbAction *); |
|
255 |
|
256 private: |
|
257 FileBrowserMainWindow &mMainWindow; |
|
258 EngineWrapper *mEngineWrapper; |
|
259 |
|
260 HbListView *mListView; |
|
261 HbToolBar *mToolBar; |
|
262 HbLabel *mNaviPane; |
|
263 QGraphicsLinearLayout *mMainLayout; |
|
264 |
|
265 // file info contains all needed information of selected file from file model |
|
266 QModelIndexList mClipboardIndexes; |
|
267 QModelIndexList mSelectionIndexes; |
|
268 |
|
269 FileBrowserModel *mFileBrowserModel; |
|
270 OptionMenuActions mOptionMenuActions; |
|
271 ContextMenuActions mContextMenuActions; |
|
272 HbMenu *mContextMenu; |
|
273 HbAction *mToolbarBackAction; |
|
274 |
|
275 // flags |
|
276 bool mItemHighlighted; |
|
277 bool mLocationChanged; |
|
278 // flag for removing source file after copied to target file |
|
279 bool mRemoveFileAfterCopied; |
|
280 bool mClipBoardInUse; |
|
281 bool mFolderContentChanged; |
|
282 QModelIndex mCurrentIndex; |
|
283 |
|
284 // temporarily storage |
|
285 QString mOldPassword; |
|
286 QString mPanicCategory; |
|
287 QString mAbsoluteFilePath; |
|
288 OverwriteOptions mOverwriteOptions; |
|
289 QModelIndex mModelIndex; |
|
290 QString mNewFileName; |
|
291 bool mProceed; |
|
292 bool mEraseMBR; |
|
293 }; |
|
294 |
|
295 |
|
296 |
|
297 #endif /* FILEBROWSERVIEWH_H_ */ |
|