55
|
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 __ENGINE_H__
|
|
19 |
#define __ENGINE_H__
|
|
20 |
|
|
21 |
// INCLUDES
|
|
22 |
#include <e32std.h>
|
|
23 |
#include <e32base.h>
|
|
24 |
#include <apgcli.h>
|
|
25 |
|
|
26 |
#include "FBFileUtils.h"
|
|
27 |
|
|
28 |
// setting keys (do not change uids of existing keys to maintain compatibility to older versions!)
|
|
29 |
const TUid KFBSettingDisplayMode = { 0x00 };
|
|
30 |
const TUid KFBSettingFileViewMode = { 0x01 };
|
|
31 |
const TUid KFBSettingShowSubDirectoryInfo = { 0x02 };
|
|
32 |
const TUid KFBSettingShowAssociatedIcons = { 0x03 };
|
|
33 |
const TUid KFBSettingRememberLastPath = { 0x04 };
|
|
34 |
const TUid KFBSettingLastPath = { 0x05 };
|
|
35 |
|
|
36 |
const TUid KFBSettingSupportNetworkDrives = { 0x06 };
|
|
37 |
const TUid KFBSettingBypassPlatformSecurity = { 0x07 };
|
|
38 |
const TUid KFBSettingRemoveFileLocks = { 0x08 };
|
|
39 |
const TUid KFBSettingIgnoreProtectionsAtts = { 0x09 };
|
|
40 |
const TUid KFBSettingRemoveROMWriteProtection = { 0x0A };
|
|
41 |
|
|
42 |
const TUid KFBSettingFolderSelection = { 0x0B };
|
|
43 |
const TUid KFBSettingEnableToolbar = { 0x0C };
|
|
44 |
|
|
45 |
|
|
46 |
// FORWARD DECLARATIONS
|
|
47 |
class CFileBrowserFileListContainer;
|
|
48 |
class CFileBrowserScreenCapture;
|
|
49 |
class CFileBrowserFileUtils;
|
|
50 |
class CEikonEnv;
|
|
51 |
class CDictionaryFileStore;
|
|
52 |
class MFileBrowserUI;
|
|
53 |
|
|
54 |
// CLASS DECLARATIONS
|
|
55 |
|
|
56 |
class TFileBrowserSettings
|
|
57 |
{
|
|
58 |
public:
|
|
59 |
TInt iDisplayMode;
|
|
60 |
TInt iFileViewMode;
|
|
61 |
TBool iShowSubDirectoryInfo;
|
|
62 |
TBool iShowAssociatedIcons;
|
|
63 |
TBool iRememberLastPath;
|
|
64 |
TFileName iLastPath;
|
|
65 |
TBool iRememberFolderSelection;
|
|
66 |
TBool iEnableToolbar;
|
|
67 |
|
|
68 |
TBool iSupportNetworkDrives;
|
|
69 |
TBool iBypassPlatformSecurity;
|
|
70 |
TBool iRemoveFileLocks;
|
|
71 |
TBool iIgnoreProtectionsAtts;
|
|
72 |
TBool iRemoveROMWriteProrection;
|
|
73 |
};
|
|
74 |
|
|
75 |
// INFERFACE FOR COMMUNICATION WITH UI
|
|
76 |
|
|
77 |
class MFileBrowserUI
|
|
78 |
{
|
|
79 |
public:
|
|
80 |
// /**
|
|
81 |
// * Method from getting current index
|
|
82 |
// * @return current index.
|
|
83 |
// */
|
|
84 |
// virtual TInt QueryCurrentItemIndex() = 0;
|
|
85 |
|
|
86 |
/**
|
|
87 |
* Shows info message with text
|
|
88 |
* @param A aText text to be shown in message body.
|
|
89 |
* @param A aTitle text to be shown in message title.
|
|
90 |
* @return None.
|
|
91 |
*/
|
|
92 |
virtual void ShowInformationNote(const TDesC &aDescText, const TDesC &aDescTitle) = 0;
|
|
93 |
|
|
94 |
/**
|
|
95 |
* Shows error message with error text
|
|
96 |
* @param aText An error text to be shown in message.
|
|
97 |
* @return None.
|
|
98 |
*/
|
|
99 |
virtual void ShowErrorNote(const TDesC& aText, TBool aNoTimeout = EFalse) = 0;
|
|
100 |
|
|
101 |
/**
|
|
102 |
* Shows confirmation message with text
|
|
103 |
* @param aText An text to be shown in message.
|
|
104 |
* @return None.
|
|
105 |
*/
|
|
106 |
virtual void ShowConfirmationNote(const TDesC& aText, TBool aNoTimeout = EFalse) = 0;
|
|
107 |
|
|
108 |
/**
|
|
109 |
* Shows progress bar with text
|
|
110 |
* @param aText A text to be shown at top of the progress bar.
|
|
111 |
* @param aMinimum A minimum progress bar value.
|
|
112 |
* @param aMaximum A maximum progress bar value.
|
|
113 |
* @return None.
|
|
114 |
*/
|
|
115 |
virtual void ShowProgressDialog(const TDesC& aDescText, TInt aMinimum, TInt aMaximum ) = 0;
|
|
116 |
|
|
117 |
/**
|
|
118 |
* Cancel progress dialog
|
|
119 |
* @return None.
|
|
120 |
*/
|
|
121 |
virtual void CancelProgressDialog() = 0;
|
|
122 |
|
|
123 |
/**
|
|
124 |
* Set progress dialog value
|
|
125 |
* @param aValue A vaule to be shown at top of the progress dialog.
|
|
126 |
*/
|
|
127 |
virtual void SetProgressValue(TInt aValue) = 0;
|
|
128 |
//
|
|
129 |
// /**
|
|
130 |
// * Sets progress bar value
|
|
131 |
// * @param aValue A value between min and max value of the progress bar range
|
|
132 |
// * @return None.
|
|
133 |
// */
|
|
134 |
// virtual void SetProgressBarValue(TInt aValue) = 0;
|
|
135 |
//
|
|
136 |
// /**
|
|
137 |
// * Hides progress bar
|
|
138 |
// * @return None.
|
|
139 |
// */
|
|
140 |
// virtual void HideProgressBar() = 0;
|
|
141 |
//
|
|
142 |
/**
|
|
143 |
* Shows wait dialog with text
|
|
144 |
* @param aText A text to be shown at top of the wait bar.
|
|
145 |
* @return None.
|
|
146 |
*/
|
|
147 |
virtual void ShowWaitDialog(const TDesC& aText) = 0;
|
|
148 |
|
|
149 |
/**
|
|
150 |
* Cancel wait dialog
|
|
151 |
* @return None.
|
|
152 |
*/
|
|
153 |
virtual void CancelWaitDialog() = 0;
|
|
154 |
|
|
155 |
/**
|
|
156 |
* Processes all pending events to allow wait/progresa dialog to update itself
|
|
157 |
* @return None.
|
|
158 |
*/
|
|
159 |
virtual void ProcessEvents() = 0;
|
|
160 |
|
|
161 |
/**
|
|
162 |
* Shows confirmation dialog
|
|
163 |
* @param aFileName String contaning file name and path
|
|
164 |
* @return ETrue if user pressed OK button, otherwise EFalse.
|
|
165 |
*/
|
|
166 |
virtual TBool ShowConfirmationQuery(const TDesC& aDescText) = 0;
|
|
167 |
|
|
168 |
/**
|
|
169 |
* Notify wrapping model data has changed
|
|
170 |
*/
|
|
171 |
virtual void NotifyModelHasChanged() = 0;
|
|
172 |
|
|
173 |
};
|
|
174 |
|
|
175 |
class CEngine : public CBase
|
|
176 |
{
|
|
177 |
public:
|
|
178 |
static CEngine* NewL(MFileBrowserUI *aFileBrowserUI);
|
|
179 |
~CEngine();
|
|
180 |
|
|
181 |
private:
|
|
182 |
CEngine();
|
|
183 |
void ConstructL(MFileBrowserUI *aFileBrowserUI);
|
|
184 |
void LoadSettingsL();
|
|
185 |
void LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TInt& aValue);
|
|
186 |
void LoadDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, TDes& aValue);
|
|
187 |
void SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TInt& aValue);
|
|
188 |
void SaveDFSValueL(CDictionaryFileStore* aDicFS, const TUid& aUid, const TDes& aValue);
|
|
189 |
|
|
190 |
public:
|
|
191 |
void ActivateEngineL();
|
|
192 |
void DeActivateEngineL();
|
|
193 |
void SaveSettingsL(TBool aNotifyModules=ETrue);
|
|
194 |
TInt LaunchSettingsDialogL();
|
|
195 |
inline TFileBrowserSettings& Settings() { return iSettings; }
|
|
196 |
inline CEikonEnv* EikonEnv() { return iEnv; }
|
|
197 |
inline RApaLsSession& LsSession() { return iLs; }
|
|
198 |
inline CFileBrowserScreenCapture* ScreenCapture() { return iScreenCapture; }
|
|
199 |
inline CFileBrowserFileUtils* FileUtils() { return iFileUtils; }
|
|
200 |
inline MFileBrowserUI* FileBrowserUI() { return iFileBrowserUI; }
|
|
201 |
|
|
202 |
void OpenWithApparcL(const TFileName &);
|
|
203 |
void OpenWithDocHandlerL(const TFileName &, TBool);
|
|
204 |
// TInt QueryCurrentItemIndex();
|
|
205 |
TSearchAttributes GetSearchAttributes();
|
|
206 |
void ChangeAttributes(const TSearchAttributes &);
|
|
207 |
TSearchResults SearchResults();
|
|
208 |
CFileEntryList* FoundFiles();
|
|
209 |
void SearchL();
|
|
210 |
|
|
211 |
private:
|
|
212 |
MFileBrowserUI *iFileBrowserUI;
|
|
213 |
CFileBrowserScreenCapture *iScreenCapture;
|
|
214 |
CFileBrowserFileUtils *iFileUtils;
|
|
215 |
CEikonEnv* iEnv;
|
|
216 |
TFileBrowserSettings iSettings;
|
|
217 |
RApaLsSession iLs;
|
|
218 |
TBool iIsHashKeySelectionInUse;
|
|
219 |
};
|
|
220 |
|
|
221 |
|
|
222 |
#endif // __ENGINE_H__
|