mtpfws/mtpfw/inc/cmtpobjectstore.h
branchRCL_3
changeset 14 60a94a45d437
parent 0 d0791faffa3f
child 23 f5809cfbf6d5
equal deleted inserted replaced
12:8b094906a049 14:60a94a45d437
   160 			}
   160 			}
   161 	private:
   161 	private:
   162 		CMTPObjectStore& iStore;
   162 		CMTPObjectStore& iStore;
   163 		};
   163 		};
   164 	
   164 	
       
   165 	class CSnapshotWorker: public CActive
       
   166         {
       
   167         public:
       
   168             static CSnapshotWorker* NewL(CMTPObjectStore* aObjectStore, TBool aOnlyRoot); 
       
   169             
       
   170             void RunL();
       
   171             TInt RunErr();
       
   172             void ActiveSelf();
       
   173             
       
   174         private:
       
   175             CSnapshotWorker(CMTPObjectStore* aObjectStore, TBool aOnlyRoot);
       
   176             void ConstructL();
       
   177 
       
   178         private:
       
   179             void DoCancel();
       
   180             
       
   181         private:
       
   182         CMTPObjectStore* iObjectStore;
       
   183         TBool            iOnlyRoot;
       
   184         };
   165 public:
   185 public:
   166 
   186 
   167 	static CMTPObjectStore* NewL();
   187 	static CMTPObjectStore* NewL();
   168 	~CMTPObjectStore();
   188 	~CMTPObjectStore();
   169 
   189 
   177 	void RestorePersistentObjectsL(TUint aDataProviderId);
   197 	void RestorePersistentObjectsL(TUint aDataProviderId);
   178 	void RemoveObjectsByStorageIdL(TUint32 aStorageId);
   198 	void RemoveObjectsByStorageIdL(TUint32 aStorageId);
   179 	void RemoveNonPersistentObjectsL(TUint aDataProviderId);
   199 	void RemoveNonPersistentObjectsL(TUint aDataProviderId);
   180 	void MarkNonPersistentObjectsL(TUint aDataProviderId, TUint32 aStorageId);
   200 	void MarkNonPersistentObjectsL(TUint aDataProviderId, TUint32 aStorageId);
   181 	void EstablishDBSnapshotL(TUint32 aStorageId);
   201 	void EstablishDBSnapshotL(TUint32 aStorageId);
   182 	void CleanDBSnapshotL();
   202 	void CleanDBSnapshotL(TBool aOnlyRoot = EFalse);
       
   203 	void ObjectsEnumComplete();
   183 	void MarkDPLoadedL(TUint aDataProviderId, TBool aFlag);
   204 	void MarkDPLoadedL(TUint aDataProviderId, TBool aFlag);
   184 
   205 
   185 public:
   206 public:
   186 
   207 
   187 	TUint CountL(const TMTPObjectMgrQueryParams& aParams) const;
   208 	TUint CountL(const TMTPObjectMgrQueryParams& aParams) const;
   250 		};
   271 		};
   251 
   272 
   252 	class CEnumertingCacheItem : public CBase
   273 	class CEnumertingCacheItem : public CBase
   253 		{
   274 		{
   254 	public:
   275 	public:
   255 		static CEnumertingCacheItem* NewLC(TUint32 aSuidHash, TUint32 aHandle, TUint32 aFormat, TUint64 aId, TUint8 aDpID)
   276 		static CEnumertingCacheItem* NewLC(TUint32 aSuidHash, TUint32 aHandle, TUint32 aParent, TUint32 aFormat, TUint64 aId, TUint8 aDpID)
   256 			{
   277 			{
   257 			CEnumertingCacheItem* self = new (ELeave) CEnumertingCacheItem(aSuidHash, aHandle, aFormat, aId, aDpID);
   278 			CEnumertingCacheItem* self = new (ELeave) CEnumertingCacheItem(aSuidHash, aHandle, aParent, aFormat, aId, aDpID);
   258 			CleanupStack::PushL(self);
   279 			CleanupStack::PushL(self);
   259 			return self;
   280 			return self;
   260 			}
   281 			}
   261 		static CEnumertingCacheItem* NewL(TUint32 aSuidHash, TUint32 aHandle, TUint32 aFormat, TUint64 aId, TUint8 aDpID)
   282 		static CEnumertingCacheItem* NewL(TUint32 aSuidHash, TUint32 aHandle, TUint32 aParent, TUint32 aFormat, TUint64 aId, TUint8 aDpID)
   262 			{
   283 			{
   263 			CEnumertingCacheItem* self = CEnumertingCacheItem::NewLC(aSuidHash, aHandle, aFormat, aId, aDpID);
   284 			CEnumertingCacheItem* self = CEnumertingCacheItem::NewLC(aSuidHash, aHandle, aParent, aFormat, aId, aDpID);
   264 			CleanupStack::Pop();
   285 			CleanupStack::Pop();
   265 			return self;
   286 			return self;
   266 			}
   287 			}
   267 		static TInt Compare(const CEnumertingCacheItem& aFirst, const CEnumertingCacheItem& aSecond);
   288 		static TInt Compare(const CEnumertingCacheItem& aFirst, const CEnumertingCacheItem& aSecond);
   268 		CEnumertingCacheItem(TUint32 aSuidHash, TUint32 aHandle, TUint32 aFormat, TUint64 aId, TUint8 aDpID);
   289 		CEnumertingCacheItem(TUint32 aSuidHash, TUint32 aHandle, TUint32 aParent, TUint32 aFormat, TUint64 aId, TUint8 aDpID);
   269 		~CEnumertingCacheItem()
   290 		~CEnumertingCacheItem()
   270 			{
   291 			{
   271 			delete iSuid;
   292 			delete iSuid;
   272 			}
   293 			}
   273 		TUint32 iObjHandleId;
   294 		TUint32 iObjHandleId;
       
   295 		TUint32 iObjParentId;
   274 		TUint32 iObjSuiIdHash;
   296 		TUint32 iObjSuiIdHash;
   275 		TUint32 iFormatcode;
   297 		TUint32 iFormatcode;
   276 		TUint64 iPOUID;
   298 		TUint64 iPOUID;
   277 		HBufC* iSuid;
   299 		HBufC* iSuid;
   278 		TPtrC iSuidPtr;
   300 		TPtrC iSuidPtr;
   337 	CEnumertingCacheItem*					iSentinal;
   359 	CEnumertingCacheItem*					iSentinal;
   338 	CMTPDPIDStore*							iDPIDStore;
   360 	CMTPDPIDStore*							iDPIDStore;
   339 	CMTPPkgIDStore*							iPkgIDStore;
   361 	CMTPPkgIDStore*							iPkgIDStore;
   340 	CMtpDeltaDataMgr* 						iMtpDeltaDataMgr;
   362 	CMtpDeltaDataMgr* 						iMtpDeltaDataMgr;
   341 	CDbCompactor*							iCompactor;
   363 	CDbCompactor*							iCompactor;
       
   364 	TInt                                    iSnapshotCleanPos;
       
   365 	CSnapshotWorker*                        iSnapshotWorker;
   342 	mutable TFileName                       iSuidBuf;
   366 	mutable TFileName                       iSuidBuf;
   343 	/**
   367 	/**
   344 	 FLOGGER debug trace member variable.
   368 	 FLOGGER debug trace member variable.
   345 	 */
   369 	 */
   346 	__FLOG_DECLARATION_MEMBER_MUTABLE;
   370 	__FLOG_DECLARATION_MEMBER_MUTABLE;