|
1 // Copyright (c) 1997-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 // aplappregfinder.h |
|
15 // |
|
16 |
|
17 #ifndef __APLAPPREGFINDER_H__ |
|
18 #define __APLAPPREGFINDER_H__ |
|
19 |
|
20 #include <f32file.h> |
|
21 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
22 #include "apsidcheckermap.h" |
|
23 #else |
|
24 #include <apsidchecker.h> |
|
25 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS |
|
26 #include <badesca.h> // typedef CDesCArray |
|
27 |
|
28 class TDriveUnitInfo; |
|
29 class TApaAppEntry; |
|
30 |
|
31 /** |
|
32 @internalComponent |
|
33 */ |
|
34 class CApaAppRegFinder : public CBase |
|
35 { |
|
36 public: // Construction / Destruction |
|
37 IMPORT_C static CApaAppRegFinder* NewL(const RFs& aFs); |
|
38 IMPORT_C static CApaAppRegFinder* NewLC(const RFs& aFs); |
|
39 ~CApaAppRegFinder(); |
|
40 private: // Private construction |
|
41 CApaAppRegFinder(const RFs& aFs); |
|
42 void ConstructL(); |
|
43 public: |
|
44 enum TScanScope |
|
45 { |
|
46 EScanAllDrives, |
|
47 EScanRemovableDrives |
|
48 }; |
|
49 |
|
50 IMPORT_C void FindAllAppsL(TScanScope aScopeOfScan); // sets up a scan for all apps |
|
51 IMPORT_C TBool NextL(TApaAppEntry& aEntry, const CDesCArray& aForcedRegistrations); // increments a scan for all apps |
|
52 IMPORT_C TArray<const TDriveUnitInfo> DriveList() const; |
|
53 private: |
|
54 void RebuildDriveListL(TScanScope aScopeOfScan); |
|
55 TBool NextDriveAndFolderInNormalizedOrder(TDriveUnitInfo& aNextDrive, TPtrC& aAppFolderOnDrive) const; |
|
56 void GetCurrentDriveAndFolder(TDriveUnitInfo& aDrive, TPtrC& aAppFolderOnDrive) const; |
|
57 TInt GetAppListOfDriveL(TDriveUnit aDriveUnit, const TDesC& aPathName, CDir*& aFileList) const; |
|
58 static void LeaveIfIrregularErrorL(TInt aError); |
|
59 private: |
|
60 enum TScanStage |
|
61 { |
|
62 EScanStageNonImportROM, |
|
63 EScanStageImportNonROM, |
|
64 EScanStageImportNonNativeResourceNonROM, |
|
65 EScanStageImportROM, |
|
66 EScanStageImportNonNativeResourceROM, |
|
67 EScanStageComplete |
|
68 }; |
|
69 private: |
|
70 CDir* iFileList; |
|
71 TInt iFileIndex; |
|
72 const RFs& iFs; |
|
73 RSidCheckerMap iSidCheckerMap; |
|
74 RArray<const TDriveUnitInfo> iListOfDrives; |
|
75 mutable TInt iCurrentIndexInDriveList; |
|
76 mutable TInt iScanStage; |
|
77 mutable TPtrC iFolderOnCurrentDrive; |
|
78 TUid iLastChkedApp; //Uid of the last app whose sid cheking has been done. |
|
79 }; |
|
80 |
|
81 NONSHARABLE_CLASS(TDriveUnitInfo) |
|
82 { |
|
83 public: |
|
84 TDriveUnit iUnit; |
|
85 TUint iAttribs; |
|
86 }; |
|
87 |
|
88 #endif // __APLAPPREGFINDER_H__ |