|
1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __EIKERROR_H__ |
|
17 #define __EIKERROR_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <f32file.h> |
|
21 #include <babackup.h> |
|
22 #include <eikenv.h> |
|
23 |
|
24 class CErrorFileFsMonitor; |
|
25 class CErrorSet; |
|
26 |
|
27 /** @internalAll */ |
|
28 NONSHARABLE_CLASS(CEikErrorResolver) : public CBase |
|
29 { |
|
30 public: |
|
31 enum TFoundError |
|
32 { |
|
33 EErrorNotFound = EFalse, |
|
34 EErrorFound = ETrue, |
|
35 }; |
|
36 public: |
|
37 IMPORT_C static CEikErrorResolver* NewL(CEikonEnv& aEnv); |
|
38 ~CEikErrorResolver(); |
|
39 inline CEikonEnv::TErrorValidity ResolveError(TDes& aErrorText,TInt aError); |
|
40 IMPORT_C CEikonEnv::TErrorValidity ResolveError(TDes& aErrorText,TInt aError,TUid aApp); |
|
41 IMPORT_C CEikonEnv::TErrorValidity ResolveErrorWithTitle(TDes& aErrorText, TDes& aTitleText, TInt aError); |
|
42 IMPORT_C CEikonEnv::TErrorValidity ResolveErrorWithTitle(TDes& aErrorText, TDes& aTitleText, TInt aError, TInt& aErrorResId, TUint& aFlags, TBool aIsMemoryAllocatedByErrResolver); |
|
43 public: |
|
44 void HandleFileSystemChange(const TDesC& aDriveAndPath); |
|
45 private: |
|
46 enum TStoreErrors {EStoreNone, EStoreErrors}; |
|
47 private: |
|
48 CEikErrorResolver(CEikonEnv& aEnv); |
|
49 void AddMonitorForResourceFolderL(const TDesC& aPath); |
|
50 void DoResolveErrorL(TDes& aErrorText,TInt aError,TUid aApp,CEikonEnv::TErrorValidity& aErrorValidity, TDes& aTitleText, |
|
51 TInt& aErrorResId, TUint& aFlags, TBool aIsMemoryAllocatedByErrResolver); |
|
52 TFoundError ScanDriveL(TInt aDrive, TDes& aErrorText, TInt aError, TUid aApp, |
|
53 CEikonEnv::TErrorValidity& aErrorValidity, CEikErrorResolver::TStoreErrors& aStoreErrors, |
|
54 CErrorSet*& aErrorSet, TLanguage& aLanguage, TDes& aTitleText,TInt& aErrorResId, TUint& aFlags, |
|
55 TBool aIsMemoryAllocatedByErrResolver); |
|
56 TFoundError ScanResourceFilesL(const TDesC& aPath, TDes& aErrorText, TInt aError, |
|
57 CEikonEnv::TErrorValidity& aErrorValidity, CErrorSet*& aErrorSet, TLanguage& aLanguage, TUid aAppUid, |
|
58 TDes& aTitleText,TInt& aErrorResId, TUint& aFlags, TBool aIsMemoryAllocatedByErrResolver); |
|
59 CErrorSet* CreateErrorSetFromResourceFileL(const TDesC& aResFileName) const; |
|
60 TFoundError ResolveErrorFromCachedList(TDes& aErrorText,TInt aError,CEikonEnv::TErrorValidity& aErrorValidity, TDes& aTitleText,TInt& aErrorResId, |
|
61 TUint& aFlags, TBool aIsMemoryAllocatedByErrResolver); |
|
62 TBool ResourceFileIsLoaded(const TDesC& aResFileName) const; |
|
63 TFoundError GetErrorMsgFromResourceFileL(const TDesC& aResFileName,TDes& aErrorText,TInt aError, |
|
64 CEikonEnv::TErrorValidity& aErrorValidity, CErrorSet*& aErrorSet, |
|
65 TLanguage& aLanguage, TUid aAppUid, TDes& aTitleText, |
|
66 TInt& aErrorResId, TUint& aFlags, TBool aIsMemoryAllocatedByErrResolver) const; |
|
67 private: |
|
68 CEikonEnv& iEnv; |
|
69 RPointerArray<CErrorSet> iErrorArray; |
|
70 CArrayPtr<CErrorFileFsMonitor>* iFsMonitors; |
|
71 }; |
|
72 |
|
73 |
|
74 inline CEikonEnv::TErrorValidity CEikErrorResolver::ResolveError(TDes& aErrorText,TInt aError) |
|
75 {return ResolveError(aErrorText,aError,KNullUid);} |
|
76 |
|
77 #endif // __EIKERROR_H__ |