31
|
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 FBFILEVIEWH_H_
|
|
19 |
#define FBFILEVIEWH_H_
|
|
20 |
|
|
21 |
#include "menuaction.h"
|
|
22 |
#include "enginewrapper.h"
|
|
23 |
|
|
24 |
#include <HbView>
|
|
25 |
#include <HbApplication>
|
|
26 |
|
|
27 |
#include <QModelIndexList>
|
|
28 |
|
|
29 |
// Forward declarations
|
|
30 |
class QFileInfo;
|
|
31 |
class QSignalMapper;
|
|
32 |
class QItemSelection;
|
|
33 |
class QString;
|
|
34 |
class QGraphicsLinearLayout;
|
|
35 |
|
|
36 |
class HbListView;
|
|
37 |
class HbListWidget;
|
|
38 |
class HbToolBar;
|
|
39 |
class HbLabel;
|
|
40 |
class HbDialog;
|
|
41 |
class HbAbstractViewItem;
|
|
42 |
class HbMenu;
|
|
43 |
class HbSearchPanel;
|
|
44 |
|
|
45 |
class EditorView;
|
|
46 |
class SearchView;
|
|
47 |
class SettingsView;
|
|
48 |
class EngineWrapper;
|
|
49 |
class FbFileModel;
|
|
50 |
class FileBrowserSortFilterProxyModel;
|
|
51 |
|
|
52 |
class FbFileView : public HbView
|
|
53 |
{
|
|
54 |
Q_OBJECT
|
|
55 |
|
|
56 |
public:
|
|
57 |
explicit FbFileView();
|
|
58 |
virtual ~FbFileView();
|
|
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 createToolBar();
|
|
90 |
|
|
91 |
private slots:
|
|
92 |
// menu action slots
|
|
93 |
// file menu
|
|
94 |
void fileBackMoveUp();
|
|
95 |
void fileOpenDirectory();
|
|
96 |
void fileSearch();
|
|
97 |
|
|
98 |
void fileNewFile();
|
|
99 |
void doFileNewFile(HbAction *);
|
|
100 |
|
|
101 |
void fileNewDirectory();
|
|
102 |
void doFileNewDirectory(HbAction *);
|
|
103 |
|
|
104 |
void fileDelete();
|
|
105 |
void doFileDelete(HbAction *);
|
|
106 |
|
|
107 |
void fileRename();
|
|
108 |
void doFileRename(HbAction *);
|
|
109 |
void doFileRenameFileExist(HbAction *);
|
|
110 |
|
|
111 |
void fileTouch();
|
|
112 |
void doFileTouch(HbAction *);
|
|
113 |
void fileProperties();
|
|
114 |
|
|
115 |
void fileChecksumsMD5();
|
|
116 |
void fileChecksumsMD2();
|
|
117 |
void fileChecksumsSHA1();
|
|
118 |
void fileChecksums(TFileBrowserCmdFileChecksums checksumType);
|
|
119 |
|
|
120 |
void fileSetAttributes();
|
|
121 |
|
|
122 |
// edit menu
|
|
123 |
void editSnapShotToE();
|
|
124 |
void editCut();
|
|
125 |
void editCopy();
|
|
126 |
void editPaste();
|
|
127 |
|
|
128 |
void editCopyToFolder();
|
|
129 |
void doEditCopyToFolder(HbAction *);
|
|
130 |
|
|
131 |
void editMoveToFolder();
|
|
132 |
void doEditMoveToFolder(HbAction *);
|
|
133 |
|
|
134 |
void editSelect();
|
|
135 |
void editUnselect();
|
|
136 |
void editSelectAll();
|
|
137 |
void editUnselectAll();
|
|
138 |
|
|
139 |
// view menu
|
|
140 |
void viewFilterEntries();
|
|
141 |
void filterCriteriaChanged(const QString &);
|
|
142 |
void clearFilterCriteria();
|
|
143 |
void viewRefresh();
|
|
144 |
|
|
145 |
// tools menu
|
|
146 |
void toolsAllAppsToTextFile();
|
|
147 |
void toolsAllFilesToTextFile();
|
|
148 |
// void toolsAvkonIconCacheEnable();
|
|
149 |
// void toolsAvkonIconCacheDisable();
|
|
150 |
|
|
151 |
void toolsDisableExtendedErrors();
|
|
152 |
void toolsDumpMsgStoreWalk();
|
|
153 |
void toolsEditDataTypes();
|
|
154 |
void toolsEnableExtendedErrors();
|
|
155 |
|
|
156 |
void toolsErrorSimulateLeave();
|
|
157 |
void doToolsErrorSimulateLeave(HbAction *);
|
|
158 |
|
|
159 |
void toolsErrorSimulatePanic();
|
|
160 |
void doToolsErrorSimulatePanicCode(HbAction *);
|
|
161 |
void doToolsErrorSimulatePanic(HbAction *);
|
|
162 |
|
|
163 |
void toolsErrorSimulateException();
|
|
164 |
void doToolsErrorSimulateException(HbAction *);
|
|
165 |
|
|
166 |
// void toolsLocalConnectivityActivateInfrared();
|
|
167 |
// void toolsLocalConnectivityLaunchBTUI();
|
|
168 |
// void toolsLocalConnectivityLaunchUSBUI();
|
|
169 |
void toolsMessageInbox();
|
|
170 |
void toolsMessageDrafts();
|
|
171 |
void toolsMessageSentItems();
|
|
172 |
void toolsMessageOutbox();
|
|
173 |
void toolsMemoryInfo();
|
|
174 |
void toolsSecureBackStart();
|
|
175 |
void toolsSecureBackRestore();
|
|
176 |
void toolsSecureBackStop();
|
|
177 |
void toolsSetDebugMaskQuestion();
|
|
178 |
void toolsSetDebugMask(HbAction *);
|
|
179 |
void toolsShowOpenFilesHere();
|
|
180 |
|
|
181 |
// main menu items
|
|
182 |
void selectionModeChanged();
|
|
183 |
void about();
|
|
184 |
|
|
185 |
signals:
|
|
186 |
void aboutToShowDriveView();
|
|
187 |
void aboutToShowSettingsView();
|
|
188 |
void aboutToShowEditorView(const QString &, bool);
|
|
189 |
void aboutToShowSearchView(const QString &);
|
|
190 |
void aboutToSimulateLeave(int);
|
|
191 |
|
|
192 |
private slots:
|
|
193 |
void updateOptionMenu();
|
|
194 |
void updateContextMenu();
|
|
195 |
void selectionChanged(const QItemSelection &, const QItemSelection &);
|
|
196 |
void activated(const QModelIndex& index);
|
|
197 |
void activateSelectionMode();
|
|
198 |
void deActivateSelectionMode();
|
|
199 |
void onLongPressed(HbAbstractViewItem *, QPointF);
|
|
200 |
|
|
201 |
void fileOpen(HbAction *);
|
|
202 |
void fileOverwrite(HbAction *);
|
|
203 |
void fileOverwritePostfix(HbAction *);
|
|
204 |
|
|
205 |
private:
|
|
206 |
EngineWrapper *mEngineWrapper;
|
|
207 |
|
|
208 |
HbListView *mListView;
|
|
209 |
HbToolBar *mToolBar;
|
|
210 |
HbLabel *mNaviPane;
|
|
211 |
HbSearchPanel *mSearchPanel;
|
|
212 |
|
|
213 |
QGraphicsLinearLayout *mMainLayout;
|
|
214 |
|
|
215 |
// file info contains all needed information of selected file from file model
|
|
216 |
QModelIndexList mClipboardIndexes;
|
|
217 |
QModelIndexList mSelectionIndexes;
|
|
218 |
|
|
219 |
FbFileModel *mFbFileModel;
|
|
220 |
FileBrowserSortFilterProxyModel *mSortFilterProxyModel;
|
|
221 |
OptionMenuActions mOptionMenuActions;
|
|
222 |
ContextMenuActions mContextMenuActions;
|
|
223 |
HbMenu *mContextMenu;
|
|
224 |
HbAction *mToolbarBackAction;
|
|
225 |
|
|
226 |
// flags
|
|
227 |
bool mItemHighlighted;
|
|
228 |
bool mLocationChanged;
|
|
229 |
// flag for removing source file after copied to target file
|
|
230 |
bool mRemoveFileAfterCopied;
|
|
231 |
bool mClipBoardInUse;
|
|
232 |
bool mFolderContentChanged;
|
|
233 |
QModelIndex mCurrentIndex;
|
|
234 |
|
|
235 |
// temporarily storage
|
|
236 |
QString mOldPassword;
|
|
237 |
QString mPanicCategory;
|
|
238 |
QString mAbsoluteFilePath;
|
|
239 |
OverwriteOptions mOverwriteOptions;
|
|
240 |
QModelIndex mModelIndex;
|
|
241 |
QString mNewFileName;
|
|
242 |
bool mProceed;
|
|
243 |
bool mEraseMBR;
|
|
244 |
};
|
|
245 |
|
|
246 |
|
|
247 |
|
|
248 |
#endif /* FBFILEVIEWH_H_ */
|