30 class CAfStorage : public CBase |
30 class CAfStorage : public CBase |
31 { |
31 { |
32 public: |
32 public: |
33 ~CAfStorage(); |
33 ~CAfStorage(); |
34 |
34 |
35 static CAfStorage* NewL(RFs& session); |
35 static CAfStorage* NewL(RFs& aSession); |
36 |
36 |
37 void AddActivityL(CAfEntry &entry); |
37 void AddActivityL(CAfEntry &aEntry); |
|
38 |
|
39 void UpdateActivityL(CAfEntry &aEntry); |
|
40 |
|
41 void SaveActivityL(CAfEntry &aEntry); |
|
42 |
|
43 void DeleteActivityL(CAfEntry &aEntry); |
|
44 |
|
45 void DeleteActivitiesL(CAfEntry &aEntry); |
|
46 |
|
47 void AllActivitiesL(RPointerArray<CAfEntry> &aDst, TInt aLimit); |
|
48 |
|
49 void ActivitiesL(RPointerArray<CAfEntry> &aDst, TInt aAppId); |
38 |
50 |
39 void UpdateActivityL(CAfEntry &entry); |
51 void ActivityL(RPointerArray<CAfEntry> &aDst, CAfEntry &aSrc); |
40 |
|
41 void SaveActivityL(CAfEntry &entry); |
|
42 |
|
43 void DeleteActivityL(CAfEntry &entry); |
|
44 |
|
45 void DeleteActivitiesL(CAfEntry &entry); |
|
46 |
|
47 void ActivitiesL(RPointerArray<CAfEntry> &dst); |
|
48 |
|
49 void ActivitiesL(RPointerArray<CAfEntry> &dst, TInt appId); |
|
50 |
|
51 void ActivityL(RPointerArray<CAfEntry> &dst, CAfEntry &src); |
|
52 |
52 |
53 RFs& Fs(); |
53 RFs& Fs(); |
54 |
54 |
55 static void ThumbnailPathL(RBuf &dst, |
55 static void ThumbnailPathL(RBuf &aDst, |
56 RFs& fileSystem, |
56 RFs& aFileSystem, |
57 TInt uid, |
57 TInt aUid, |
58 const TDesC &activityName, |
58 const TDesC &aActivityName, |
59 TBool persistent); |
59 TBool aPersistent); |
60 |
60 |
61 static void StoragePathL(RBuf &dst, |
61 static void StoragePathL(RBuf &aDst, |
62 RFs& fileSystem, |
62 RFs& aFileSystem, |
63 TBool persistent); |
63 TBool aPersistent); |
64 static void AppStoragePathL(RBuf &dst, |
64 |
65 RFs& fileSystem, |
65 static void AppStoragePathL(RBuf &aDst, |
66 TInt uid, |
66 RFs& aFileSystem, |
67 TBool persistent); |
67 TInt aUid, |
|
68 TBool aPersistent); |
68 private: |
69 private: |
69 static HBufC8* Md5HexDigestL(const TDesC8 &string); |
70 static HBufC8* Md5HexDigestL(const TDesC8 &aString); |
70 |
71 |
71 private: |
72 private: |
72 CAfStorage(RFs& session); |
73 CAfStorage(RFs& aSession); |
73 |
74 |
74 void ConstructL(); |
75 void ConstructL(); |
75 |
76 |
76 void CreateDbL(const TDesC& databaseFile); |
77 void CreateDbL(const TDesC& aDatabaseFile); |
77 |
78 |
78 void OpenDbL(const TDesC& databaseFile); |
79 void OpenDbL(const TDesC& aDatabaseFile); |
|
80 |
|
81 void VerifyDbL(); |
|
82 |
|
83 CDbColSet* ExpectedTableLC(); |
79 |
84 |
80 void CreateTableL(); |
85 void CreateTableL(); |
81 |
86 |
|
87 void VerifyTableL(); |
|
88 |
82 void DeleteNonPersistentActivitiesL(); |
89 void DeleteNonPersistentActivitiesL(); |
83 |
90 |
84 void GetActivitiesL(const TDesC& dst); |
91 void GetActivitiesL(const TDesC& aDst); |
85 |
92 |
86 HBufC* SelectRowLC(TInt appId, const TDesC& actId) const; |
93 HBufC* SelectRowLC(TInt aAppId, const TDesC& aActId) const; |
87 |
94 |
88 HBufC* SelectRowsLC(TInt appId) const; |
95 HBufC* SelectRowsLC(TInt aAppId) const; |
89 |
96 |
90 HBufC* DeleteRowLC(TInt appId, const TDesC& actId) const; |
97 HBufC* DeleteRowLC(TInt aAppId, const TDesC& aActId) const; |
91 |
98 |
92 HBufC* DeleteRowsLC(TInt appId) const; |
99 HBufC* DeleteRowsLC(TInt aAppId) const; |
93 |
100 |
94 HBufC* BuildQueryLC(const TDesC& format, TInt appId, const TDesC& actId) const; |
101 HBufC* BuildQueryLC(const TDesC& aFormat, TInt aAppId, const TDesC& aActId) const; |
95 |
102 |
96 void ActivitiesL(RPointerArray<CAfEntry>& dst, |
103 void ActivitiesL(RPointerArray<CAfEntry>& aDst, |
97 const TDesC& query, |
104 const TDesC& aQuery, |
98 CAfEntry::AccessRights rights, |
105 CAfEntry::AccessRights aRights, |
99 TInt limit = 0); |
106 TInt aLimit = 0, |
|
107 TBool deserializeAllData = EFalse); |
100 |
108 |
101 void ActivitiesL(RPointerArray<CAfEntry>& dst, |
109 void ActivitiesL(RPointerArray<CAfEntry>& aDst, |
102 RDbView& query, |
110 RDbView& aQuery, |
103 CAfEntry::AccessRights rights, |
111 CAfEntry::AccessRights aRights, |
104 TInt limit = 0); |
112 TInt aLimit = 0, |
|
113 TBool deserializeAllData = EFalse); |
105 |
114 |
106 void GetActivityForUpdateL(RDbView& query, TInt appId, const TDesC& actId); |
115 void GetActivityForUpdateL(RDbView& aQuery, TInt aAppId, const TDesC& aActId); |
107 |
116 |
108 void ReadDataL(RBuf& dst, RDbRowSet& src, TInt offset) const; |
117 void ReadDataL(RBuf& aDst, RDbRowSet& aSrc, TInt aOffset) const; |
109 |
118 |
110 void ExternalizeDataL(RDbRowSet &dst,const CAfEntry & src, TInt offset) const; |
119 void ExternalizeDataL(RDbRowSet &aDst,const CAfEntry & aSrc, TInt aOffset) const; |
111 |
120 |
112 void InternalizeDataL(CAfEntry &dst, RDbRowSet& src, TInt offset) const; |
121 void InternalizeDataL(CAfEntry &aDst, RDbRowSet& aSrc, TInt aOffset) const; |
113 |
122 |
114 public: |
123 public: |
115 TBool InterruptCleanup(); |
124 TBool InterruptCleanup(); |
116 void RequestCleanup(); |
125 void RequestCleanup(); |
117 |
126 |
118 private: |
127 private: |
119 RFs& mFsSession; |
128 RFs& iFsSession; |
120 RDbStoreDatabase mActDb;/* For database operations */ |
129 RDbStoreDatabase iActDb;/** For database operations*/ |
121 CFileStore* mFileStore; /* For creating and opening database files */ |
130 CFileStore* iFileStore; /** For creating and opening database files */ |
122 CAfDatabaseCleaner *mDatabaseCleaner; |
131 CAfDatabaseCleaner *iDatabaseCleaner; |
123 }; |
132 }; |
124 |
133 |
125 #endif //AFSTORAGE_H |
134 #endif //AFSTORAGE_H |