1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
25 */ |
25 */ |
26 #include <apaid.h> |
26 #include <apaid.h> |
27 #include <badesca.h> |
27 #include <badesca.h> |
28 #include <s32file.h> |
28 #include <s32file.h> |
29 |
29 |
|
30 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
31 #include <usif/scr/scr.h> |
|
32 #include <usif/scr/appregentries.h> |
|
33 #include <apgcli.h> |
|
34 #endif |
|
35 |
30 // classes defined: |
36 // classes defined: |
31 class CApaAppList; |
37 class CApaAppList; |
32 class CApaAppViewData; |
38 class CApaAppViewData; |
33 // classes referenced: |
39 // classes referenced: |
34 class CApaMaskedBitmap; |
40 class CApaMaskedBitmap; |
35 class TEntry; |
41 class TEntry; |
36 class RFs; |
42 class RFs; |
|
43 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
37 class CApaAppRegFinder; |
44 class CApaAppRegFinder; |
|
45 #endif |
38 class CApaAppIconArray; |
46 class CApaAppIconArray; |
39 class CApaIconLoader; |
47 class CApaIconLoader; |
40 class TApaAppEntry; |
48 class TApaAppEntry; |
41 class CApaAppData; |
49 class CApaAppData; |
42 class CApaIconCaptionOverrides; |
50 class CApaIconCaptionOverrides; |
70 |
78 |
71 @internalComponent |
79 @internalComponent |
72 */ |
80 */ |
73 class CApaAppList : public CBase |
81 class CApaAppList : public CBase |
74 { |
82 { |
75 public: |
|
76 IMPORT_C static CApaAppList* NewL(RFs& aFs, TBool aLoadMbmIconsOnDemand, TInt aTimeoutDelay = 50000); // takes ownership of aAppRegFinder |
|
77 public: |
83 public: |
|
84 IMPORT_C static CApaAppList* NewL(RFs& aFs, TBool aLoadMbmIconsOnDemand, TInt aTimeoutDelay = 50000); |
|
85 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
78 IMPORT_C void PurgeL(); |
86 IMPORT_C void PurgeL(); |
|
87 IMPORT_C CApaAppData* FindAndAddSpecificAppL(CApaAppRegFinder* aFinder, TUid aAppUid); |
|
88 IMPORT_C void StopScan(TBool aNNAInstall = EFalse); |
|
89 IMPORT_C void RestartScanL(); |
|
90 IMPORT_C TBool AppListUpdatePending(); |
|
91 IMPORT_C void AddForcedRegistrationL(const TDesC& aRegistrationFile); |
|
92 IMPORT_C void ResetForcedRegistrations(); |
|
93 #else |
|
94 IMPORT_C CApaAppData* FindAndAddSpecificAppL(TUid aAppUid); |
|
95 #endif |
|
96 |
79 IMPORT_C TInt Count() const; |
97 IMPORT_C TInt Count() const; |
80 IMPORT_C CApaAppData* FirstApp() const; |
98 IMPORT_C CApaAppData* FirstApp() const; |
81 IMPORT_C CApaAppData* FirstApp(TInt aScreenMode) const; |
99 IMPORT_C CApaAppData* FirstApp(TInt aScreenMode) const; |
82 IMPORT_C CApaAppData* NextApp(const CApaAppData* aApp) const; |
100 IMPORT_C CApaAppData* NextApp(const CApaAppData* aApp) const; |
83 IMPORT_C CApaAppData* NextApp(const CApaAppData* aApp, TInt aScreenMode) const; |
101 IMPORT_C CApaAppData* NextApp(const CApaAppData* aApp, TInt aScreenMode) const; |
84 IMPORT_C CApaAppData* AppDataByUid(TUid aAppUid) const; |
102 IMPORT_C CApaAppData* AppDataByUid(TUid aAppUid) const; |
85 IMPORT_C void StopScan(TBool aNNAInstall = EFalse); |
|
86 IMPORT_C void RestartScanL(); |
|
87 IMPORT_C TBool AppListUpdatePending(); |
|
88 // ER5 |
103 // ER5 |
89 IMPORT_C TUid PreferredDataHandlerL(const TDataType& aDataType) const; |
104 IMPORT_C TUid PreferredDataHandlerL(const TDataType& aDataType) const; |
90 IMPORT_C void StartIdleUpdateL(); |
105 IMPORT_C void StartIdleUpdateL(); |
91 IMPORT_C void StartIdleUpdateL(MApaAppListObserver* aObserver); |
106 IMPORT_C void StartIdleUpdateL(MApaAppListObserver* aObserver); |
92 IMPORT_C void InitListL(MApaAppListObserver* aObserver); |
107 IMPORT_C void InitListL(MApaAppListObserver* aObserver); |
97 IMPORT_C CBufFlat* ServiceArrayBufferL(TUid aAppUid) const; |
112 IMPORT_C CBufFlat* ServiceArrayBufferL(TUid aAppUid) const; |
98 IMPORT_C CBufFlat* ServiceImplArrayBufferL(TUid aServiceUid) const; |
113 IMPORT_C CBufFlat* ServiceImplArrayBufferL(TUid aServiceUid) const; |
99 IMPORT_C CBufFlat* ServiceImplArrayBufferL(TUid aServiceUid, const TDataType& aDataType) const; |
114 IMPORT_C CBufFlat* ServiceImplArrayBufferL(TUid aServiceUid, const TDataType& aDataType) const; |
100 IMPORT_C CBufFlat* ServiceUidBufferL(TUid aAppUid) const; |
115 IMPORT_C CBufFlat* ServiceUidBufferL(TUid aAppUid) const; |
101 IMPORT_C CBufFlat* ServiceOpaqueDataBufferL(TUid aAppUid, TUid aServiceUid) const; |
116 IMPORT_C CBufFlat* ServiceOpaqueDataBufferL(TUid aAppUid, TUid aServiceUid) const; |
102 IMPORT_C CApaAppData* FindAndAddSpecificAppL(CApaAppRegFinder* aFinder, TUid aAppUid); |
|
103 IMPORT_C TUid PreferredDataHandlerL(const TDataType& aDataType, const TUid* aServiceUid, |
117 IMPORT_C TUid PreferredDataHandlerL(const TDataType& aDataType, const TUid* aServiceUid, |
104 TInt& aPriority) const; |
118 TInt& aPriority) const; |
105 IMPORT_C ~CApaAppList(); |
119 IMPORT_C ~CApaAppList(); |
106 // 9.1 |
120 // 9.1 |
107 IMPORT_C CApaAppData* AppDataByFileName(const TDesC& aFullFileName) const; |
121 IMPORT_C CApaAppData* AppDataByFileName(const TDesC& aFullFileName) const; |
108 /*IMPORT_C*/ RFs& ShareProtectedFileServer(); |
122 /*IMPORT_C*/ RFs& ShareProtectedFileServer(); |
109 IMPORT_C void AddForcedRegistrationL(const TDesC& aRegistrationFile); |
|
110 IMPORT_C void ResetForcedRegistrations(); |
|
111 IMPORT_C TBool IsLanguageChangePending() const; |
123 IMPORT_C TBool IsLanguageChangePending() const; |
112 IMPORT_C static CApaAppList* Self(); |
124 IMPORT_C static CApaAppList* Self(); |
113 IMPORT_C CArrayFixFlat<TUid>* UninstalledAppArray(); |
125 IMPORT_C CArrayFixFlat<TUid>* UninstalledAppArray(); |
114 |
126 |
115 void AcquireDefaultIconArrayL() const; |
127 void AcquireDefaultIconArrayL() const; |
123 void InitiateStoringOfAppList(); |
135 void InitiateStoringOfAppList(); |
124 |
136 |
125 IMPORT_C void AddCustomAppInfoInListL(TUid aAppUid, TLanguage aLanguage, const TDesC& aShortCaption); |
137 IMPORT_C void AddCustomAppInfoInListL(TUid aAppUid, TLanguage aLanguage, const TDesC& aShortCaption); |
126 IMPORT_C void UpdateAppListByShortCaptionL(); |
138 IMPORT_C void UpdateAppListByShortCaptionL(); |
127 IMPORT_C void UpdateAppListByIconCaptionOverridesL(); |
139 IMPORT_C void UpdateAppListByIconCaptionOverridesL(); |
|
140 |
|
141 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
142 IMPORT_C void InitializeApplistL(MApaAppListObserver* aObserver); |
|
143 void InitializeLangAppListL(); |
|
144 IMPORT_C void UpdateApplistL(MApaAppListObserver* aObserver, RArray<TApaAppUpdateInfo>* aAppUpdateInfo, TUid aSecureID); |
|
145 IMPORT_C void UpdateApplistByForceRegAppsL(RPointerArray<Usif::CApplicationRegistrationData>& aForceRegAppsInfo); |
|
146 IMPORT_C CArrayFixFlat<TApaAppUpdateInfo>* UpdatedAppsInfo(); |
|
147 #endif |
|
148 |
128 private: |
149 private: |
129 enum |
150 enum |
130 { |
151 { |
131 EFirstScanComplete = 0x01, |
152 EFirstScanComplete = 0x01, |
132 EAppListHasChanged = 0x02, // This flag is used to check if the applist has really changed after a re-scan/update scan. |
153 EAppListHasChanged = 0x02, // This flag is used to check if the applist has really changed after a re-scan/update scan. |
133 ENotifyUpdateOnFirstScanComplete = 0x04,// This flag is used to notify clients for applist update on first boot when AppsList.Bin is used. |
154 ENotifyUpdateOnFirstScanComplete = 0x04,// This flag is used to notify clients for applist update on first boot when AppsList.Bin is used. |
134 ELangChangePending = 0x08 // This flag is used to check if applist update is in progress on language change event. |
155 ELangChangePending = 0x08 // This flag is used to check if applist update is in progress on language change event. |
135 }; |
156 }; |
136 private: |
157 private: |
137 CApaAppList(RFs& aFs, TBool aLoadMbmIconsOnDemand, TInt aIdlePeriodicDelay); |
158 CApaAppList(RFs& aFs, TBool aLoadMbmIconsOnDemand, TInt aIdlePeriodicDelay); |
138 void UpdateNextAppL(const TApaAppEntry& aAppEntry,TBool& aHasChanged); |
|
139 void AddToList( CApaAppData* aAppData ); |
159 void AddToList( CApaAppData* aAppData ); |
140 static void SetPending(CApaAppData* aAppData); |
|
141 static void SetNotFound(CApaAppData* aAppData, TBool& aHasChanged); |
|
142 static TInt IdleUpdateCallbackL(TAny* aObject); |
160 static TInt IdleUpdateCallbackL(TAny* aObject); |
143 TInt IdleUpdateL(); |
161 TInt IdleUpdateL(); |
144 void ScanComplete(); |
162 void ScanComplete(); |
145 void UndoSetPending(CApaAppData* aAppData); |
|
146 |
163 |
147 void StopIdler(); |
164 void StopIdler(); |
148 void DeleteAppData(); |
165 void DeleteAppData(); |
149 CArrayFixFlat<TDataTypeWithPriority>* DataTypeArrayDeepCopyLC(const CArrayFixFlat<TDataTypeWithPriority>& aOriginal) const; |
166 CArrayFixFlat<TDataTypeWithPriority>* DataTypeArrayDeepCopyLC(const CArrayFixFlat<TDataTypeWithPriority>& aOriginal) const; |
150 CApaAppIconArray* LoadDefaultIconsL() const; |
167 CApaAppIconArray* LoadDefaultIconsL() const; |
152 |
169 |
153 void StartIconLoadingL(); |
170 void StartIconLoadingL(); |
154 void DeleteAppsListBackUpAndTempFiles(); |
171 void DeleteAppsListBackUpAndTempFiles(); |
155 void ScanRemovableDrivesAndUpdateL(); |
172 void ScanRemovableDrivesAndUpdateL(); |
156 void CreateDefaultAppIconFileNameL(); |
173 void CreateDefaultAppIconFileNameL(); |
|
174 |
|
175 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
176 void UndoSetPending(CApaAppData* aAppData); |
|
177 static void SetPending(CApaAppData* aAppData); |
|
178 static void SetNotFound(CApaAppData* aAppData, TBool& aHasChanged); |
|
179 void UpdateNextAppL(const TApaAppEntry& aAppEntry,TBool& aHasChanged); |
|
180 #else |
|
181 TInt FindAndDeleteApp(TUid aAppUid); |
|
182 #endif |
|
183 |
157 private: |
184 private: |
158 // Persistence Layer |
185 // Persistence Layer |
159 void RestoreL(); |
186 void RestoreL(); |
160 void ConstructL(); |
187 void ConstructL(); |
161 |
188 |
234 CApaAppData* iAppData; // linked list of apps |
261 CApaAppData* iAppData; // linked list of apps |
235 CPeriodic* iAppIdler; |
262 CPeriodic* iAppIdler; |
236 MApaAppListObserver* iObserver; |
263 MApaAppListObserver* iObserver; |
237 CApaAppData* iValidFirstAppData; //First valid app data in linked list! |
264 CApaAppData* iValidFirstAppData; //First valid app data in linked list! |
238 TInt iFlags; |
265 TInt iFlags; |
239 CApaAppRegFinder* iAppRegFinder; |
266 TInt iIdlePeriodicDelay; // idle timeout periodic delay |
240 TInt iIdlePeriodicDelay; // idle timeout periodic delay |
|
241 RFs iFsShareProtected; |
267 RFs iFsShareProtected; |
242 mutable CApaAppIconArray* iDefaultIconArray; |
268 mutable CApaAppIconArray* iDefaultIconArray; |
243 mutable TInt iDefaultIconUsageCount; |
269 mutable TInt iDefaultIconUsageCount; |
244 CDesCArray* iForcedRegistrations; |
|
245 class CApaLangChangeMonitor; //inner class of CApaAppList. |
270 class CApaLangChangeMonitor; //inner class of CApaAppList. |
|
271 |
|
272 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
273 class CApaScrAppInfo; |
|
274 #else |
|
275 CDesCArray* iForcedRegistrations; |
|
276 #endif |
|
277 |
246 CApaLangChangeMonitor* iAppLangMonitor; // Active Object used for language change monitoring. |
278 CApaLangChangeMonitor* iAppLangMonitor; // Active Object used for language change monitoring. |
247 |
279 |
248 RBuf iAppsListCacheFileName; |
280 RBuf iAppsListCacheFileName; |
249 RBuf iAppsListCacheBackUpFileName; |
281 RBuf iAppsListCacheBackUpFileName; |
250 RBuf iAppsListCachePath; |
282 RBuf iAppsListCachePath; |
254 CApaIdleIconLoader* iAppIconLoader; //Active Object used for icon handling |
286 CApaIdleIconLoader* iAppIconLoader; //Active Object used for icon handling |
255 TBool iLoadMbmIconsOnDemand; |
287 TBool iLoadMbmIconsOnDemand; |
256 RPointerArray<CCustomAppInfoData> iCustomAppList; |
288 RPointerArray<CCustomAppInfoData> iCustomAppList; |
257 CApaIconCaptionOverrides* iIconCaptionOverrides; |
289 CApaIconCaptionOverrides* iIconCaptionOverrides; |
258 CApaIconCaptionCenrepObserver* iIconCaptionObserver; |
290 CApaIconCaptionCenrepObserver* iIconCaptionObserver; |
259 TBool iNNAInstallation; |
291 CArrayFixFlat<TUid>* iUninstalledApps; |
260 CArrayFixFlat<TUid>* iUninstalledApps; |
292 |
|
293 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
294 Usif::RSoftwareComponentRegistry iScr; |
|
295 CApaScrAppInfo *iScrAppInfo; |
|
296 RArray<TUid> iForceRegAppUids; |
|
297 CArrayFixFlat<TApaAppUpdateInfo>* iAppsUpdated; |
|
298 #else |
|
299 CApaAppRegFinder* iAppRegFinder; |
|
300 TBool iNNAInstallation; |
|
301 #endif |
261 |
302 |
262 private: |
303 private: |
263 friend class CApaLangChangeMonitor; |
304 friend class CApaLangChangeMonitor; |
264 }; |
305 }; |
265 |
306 |