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