24
|
1 |
// Copyright (c) 2007-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 |
//
|
|
15 |
|
|
16 |
/**
|
|
17 |
@file
|
|
18 |
@internalAll
|
|
19 |
*/
|
|
20 |
|
|
21 |
#if !defined (__SMSPCLASS0STOR_H__)
|
|
22 |
#define __SMSPCLASS0STOR_H__
|
|
23 |
|
|
24 |
#include "smspreassemblystore.h"
|
|
25 |
|
|
26 |
/**
|
|
27 |
* @internalComponent
|
|
28 |
*/
|
|
29 |
_LIT(KPreAllocatedFileName,"smsclass0preallocated.dat"); //Pre-allocated File Name
|
|
30 |
_LIT(KClass0ReassemblyStoreName,"smsclass0reast.dat"); //reassembly store name
|
|
31 |
|
|
32 |
const TInt KClass0ReassemblyStoreUidValue=0x102835A1;
|
|
33 |
const TUid KClass0ReassemblyStoreUid={KClass0ReassemblyStoreUidValue}; // Used for Third uid of class 0 reassembly store
|
|
34 |
|
|
35 |
class TSmsPreAllocatedFileStoreReassemblyEntry;
|
|
36 |
class CClass0SmsReassemblyStore;
|
|
37 |
|
|
38 |
/**
|
|
39 |
CSmsPermanentFileStore.
|
|
40 |
|
|
41 |
This class is based on Symbian Permanent file store mechanism.
|
|
42 |
This class stores the data as streams. Like CSmsReassemblyStore's implementation,
|
|
43 |
the root stream will contain an array (header info) of TSmsReassemblyEntry.
|
|
44 |
There is one entry in the array for every sms messages which is being stored.
|
|
45 |
The entry contains the generic information related to the SMS message.
|
|
46 |
Each SMS is also allocated its own stream inside the file. This stream is primarily
|
|
47 |
used to store the SMS message's user data. The stream id is also stored in the
|
|
48 |
corresponding entry in the header to identify on which stream the SMS user data is stored.
|
|
49 |
|
|
50 |
It provides interface to add, update, delete the SMS messages. It also provides the interface
|
|
51 |
to modify the entry information (update log server id, message passed to client, etc.)
|
|
52 |
|
|
53 |
It also provides few cleanup functions to clean the stored messages from this permanent store file.
|
|
54 |
(CleanupEntriesWithCompactL, CleanupEntriesL)
|
|
55 |
This requirement is very specific to class 0 re-assembly store implementation.
|
|
56 |
These functions are needed because it is not possible to delete the message in out-of-disk condition
|
|
57 |
from permanent store file. But after getting the disk space it is required to clean up the entries.
|
|
58 |
In Class 0 re-assembly store it is possible that few PDUs of a concatenated message are stored
|
|
59 |
in this file. Others are stored in pre-allocated file. There might be a scenario where user has
|
|
60 |
deleted a message but the corresponding message has not been deleted from permanent store file
|
|
61 |
due to out-of-disk condition. And also at the time of forwarding an incomplete message a
|
|
62 |
forwarded message has not been deleted due to above reason. But the entry/PDU is invalid
|
|
63 |
because it is no more in the pre-allocated file which contains master header info.
|
|
64 |
|
|
65 |
@internalComponent
|
|
66 |
*/
|
|
67 |
class CSmsPermanentFileStore : public CBase
|
|
68 |
{
|
|
69 |
friend void CSmsPermanentStoreCloseObject(TAny* aObj);
|
|
70 |
|
|
71 |
public:
|
|
72 |
static CSmsPermanentFileStore* NewL(RFs& aFs, const TDesC& aFileName, const TUid& aThirdUid);
|
|
73 |
~CSmsPermanentFileStore();
|
|
74 |
|
|
75 |
void CreateL();
|
|
76 |
void OpenL();
|
|
77 |
void Close();
|
|
78 |
TBool IsFileOK();
|
|
79 |
|
|
80 |
const CArrayFix<TSmsReassemblyEntry>& Entries() const {return iEntryArray;}
|
|
81 |
|
|
82 |
void AddNewMessageL(TInt& aIndex, CSmsMessage& aSmsMessage,const TGsmSms& aGsmSms);
|
|
83 |
void UpdateExistingMessageL(TInt aIndex, const CSmsMessage& aSmsMessage, const CArrayFix<TInt>& aIndexArray, const CArrayFix<TGsmSms>& aSmsArray);
|
|
84 |
void DeleteEntryL(TInt aIndex);
|
|
85 |
|
|
86 |
void MatchEntryToExistingMessage(const TReassemblyEntry& aEntry, TInt& aIndex);
|
|
87 |
void UpdateLogServerIdL(TInt& aIndex, TLogId aLogServerId);
|
|
88 |
void SetPassedToClientL(TInt aIndex, TBool aBool);
|
|
89 |
|
|
90 |
void BeginTransactionL();
|
|
91 |
void CommitTransactionL();
|
|
92 |
void Revert();
|
|
93 |
|
|
94 |
void InternalizeEntryL(const TInt aIndex, CSmsMessage& aSmsMessage, CArrayFix<TInt>& aIndexArray, CArrayFix<TGsmSms>& aSmsArray);
|
|
95 |
|
|
96 |
void RemovePDUsL(TInt aIndex, TInt aStartPos, TInt aEndPos);
|
|
97 |
void CleanupEntriesWithCompactL(const CArrayFix<TSmsPreAllocatedFileStoreReassemblyEntry>& aEntryArray);
|
|
98 |
void CleanupEntriesL(const CArrayFix<TSmsPreAllocatedFileStoreReassemblyEntry>& aEntryArray);
|
|
99 |
|
|
100 |
private:
|
|
101 |
CSmsPermanentFileStore(RFs& aFs, const TUid& aThirdUid);
|
|
102 |
void ConstructL(const TDesC& aFileName);
|
|
103 |
|
|
104 |
void AddEntryL(TSmsReassemblyEntry& aEntry);
|
|
105 |
void ChangeEntryL(TInt aIndex, const TSmsReassemblyEntry& aNewEntry);
|
|
106 |
|
|
107 |
void ExternalizeEntryArrayL();
|
|
108 |
void InternalizeEntryArrayL();
|
|
109 |
|
|
110 |
void ExternalizeEntryL(TStreamId& aStreamId,const CSmsMessage& aSmsMessage,const CArrayFix<TInt>& aIndexArray,const CArrayFix<TGsmSms>& aSmsArray);
|
|
111 |
void DoCommitAndCompactL();
|
|
112 |
void RemoveDeletedEntries();
|
|
113 |
void ReinstateDeletedEntries();
|
|
114 |
|
|
115 |
private:
|
|
116 |
enum
|
|
117 |
{
|
|
118 |
KNumStoreCommitsBeforeCompaction=16
|
|
119 |
};
|
|
120 |
|
|
121 |
private:
|
|
122 |
RFs& iFs;
|
|
123 |
HBufC* iFileName;
|
|
124 |
TUid iThirdUid;
|
|
125 |
CFileStore* iFileStore;
|
|
126 |
CArrayFixFlat<TSmsReassemblyEntry> iEntryArray;
|
|
127 |
TBool iInTransaction;
|
|
128 |
TInt iCommitCount;
|
|
129 |
TBool iCompact;
|
|
130 |
};
|
|
131 |
|
|
132 |
/*
|
|
133 |
It will contain forwarded message's bit-map information.
|
|
134 |
The max size of SMS message can be 256 PDUs. Due to this
|
|
135 |
reason 32 bytes character is reserved to store the forwarded
|
|
136 |
message information.
|
|
137 |
|
|
138 |
@internalComponent
|
|
139 |
*/
|
|
140 |
const TInt KBitMapLen = 32;
|
|
141 |
typedef TBuf8<KBitMapLen> TForwardedPDUBitMap;
|
|
142 |
|
|
143 |
|
|
144 |
/**
|
|
145 |
SMS reassembly store entry for incoming SMS messages in Pre-allocated file.
|
|
146 |
|
|
147 |
NOTE:
|
|
148 |
Previously these 4 fields (iStatus, iTimeOffset, iDecodedOnSim, iForwardToClient)
|
|
149 |
was not part of entry information. Because it was part of CSmsMesssage
|
|
150 |
& was being stored in the permanent store file. But in the raw data file,
|
|
151 |
there is no provision to store CSmsMessage, only PDUs are stored so the given
|
|
152 |
4 fields are added for this purpose.
|
|
153 |
|
|
154 |
@internalComponent
|
|
155 |
*/
|
|
156 |
class TSmsPreAllocatedFileStoreReassemblyEntry : public TSmsReassemblyEntry
|
|
157 |
{
|
|
158 |
public:
|
|
159 |
TSmsPreAllocatedFileStoreReassemblyEntry();
|
|
160 |
inline TInt PreAllocatedStorageId () const {return iPreAllocatedStorageId;}
|
|
161 |
inline void SetPreAllocatedStorageId (TInt aStorageId) {iPreAllocatedStorageId = aStorageId;}
|
|
162 |
|
|
163 |
inline RMobileSmsStore::TMobileSmsStoreStatus Status() const {return iStatus;}
|
|
164 |
inline void SetStatus(RMobileSmsStore::TMobileSmsStoreStatus aStatus) {iStatus=aStatus;}
|
|
165 |
|
|
166 |
inline TTimeIntervalSeconds UTCOffset() const {return iTimeOffset;}
|
|
167 |
inline void SetUTCOffset(TTimeIntervalSeconds aTimeOffset) {iTimeOffset = aTimeOffset;}
|
|
168 |
|
|
169 |
inline TBool DecodedOnSIM() const { return iDecodedOnSim; }
|
|
170 |
inline void SetDecodedOnSIM(TBool aBool) { iDecodedOnSim = aBool; }
|
|
171 |
|
|
172 |
inline TBool ForwardToClient() const { return iForwardToClient; }
|
|
173 |
inline void SetForwardToClient(TBool aBool) { iForwardToClient = aBool; }
|
|
174 |
|
|
175 |
inline TInt NumberOfPDUsForwardToClient() const { return iForwardedCount; }
|
|
176 |
inline void SetNumberOfPDUsForwardToClient(TInt aCount) { iForwardedCount = aCount; }
|
|
177 |
|
|
178 |
void GetBitMap(TUint8 aIndex, TUint8& aBitMap);
|
|
179 |
void SetBitMap(TUint8 aIndex, TUint8 aBitMap);
|
|
180 |
|
|
181 |
private:
|
|
182 |
/*
|
|
183 |
In TSmsReassemblyEntry, the below 2 functions are public.
|
|
184 |
In this class main intention is to make these 2 function private
|
|
185 |
so that client can't use those 2 functions. This class will be used in
|
|
186 |
CPreallocatedFile class which does not deal with storing the data in
|
|
187 |
permanent store file. So there is no need of these 2 functions.
|
|
188 |
*/
|
|
189 |
TStreamId DataStreamId() const;
|
|
190 |
void SetDataStreamId(TStreamId aStreamId);
|
|
191 |
|
|
192 |
private:
|
|
193 |
/**
|
|
194 |
This is the unique identifier to identify the PDUs.
|
|
195 |
*/
|
|
196 |
TInt iPreAllocatedStorageId;
|
|
197 |
RMobileSmsStore::TMobileSmsStoreStatus iStatus;
|
|
198 |
TTimeIntervalSeconds iTimeOffset;
|
|
199 |
TBool iDecodedOnSim;
|
|
200 |
TBool iForwardToClient;
|
|
201 |
TInt iForwardedCount; //< number of PDUs forwarded to client
|
|
202 |
TForwardedPDUBitMap iBitMap; // Forwarded Message's bit-map information
|
|
203 |
};
|
|
204 |
|
|
205 |
/**
|
|
206 |
CPreallocatedFile.
|
|
207 |
|
|
208 |
This class will store the incoming PDU in out-of-disk condition. It will create a normal data
|
|
209 |
file (based on Symbian RFile) when SMS stack boots for the 1st time. It will be a fixed size
|
|
210 |
file dedicated to store fixed number (configurable) of class 0 PDUs in out of disk condition
|
|
211 |
& also contain all the stored SMS Message's generic information. At the time of creation of
|
|
212 |
this file, the size of the file will be set (RFile::SetSize) to guarantee that the entire
|
|
213 |
file is allocated. Since Pre-allocated file has a fixed size and known layout, SMS
|
|
214 |
Stack will use RFile::Write() to write data to a fixed position in the file.
|
|
215 |
And the update will be guaranteed to succeed even if there is no memory left on the drive.
|
|
216 |
When a class 0 SMS PDU is received and the disk space is exhausted, then class 0
|
|
217 |
reassembly store will store the segment in this file. It will take 2 configuration
|
|
218 |
elements to create this file:
|
|
219 |
|
|
220 |
1. Number of PDU segments that could be stored in out of disk condition.
|
|
221 |
2. Maximum number of class 0 messages that could be stored at one instance
|
|
222 |
|
|
223 |
This file will have 4 sections: Version Number, Header Section, Duplicate Header Section & Data Section
|
|
224 |
|
|
225 |
1. Version Number - Interger Value.
|
|
226 |
2. Header Section: Number of entries, Array of Entries, Array of PDU identifier section, Checksum.
|
|
227 |
3. Duplicate Header Section: Same as Header Section.
|
|
228 |
4. Data Section: Array of Container. Each container contains Sms slot informatiuon, index number & PDU.
|
|
229 |
|
|
230 |
It provides interface to add, update, delete the SMS messages. It also provides the interface
|
|
231 |
to modify the entry information (update log server id, message passed to client, etc.)
|
|
232 |
|
|
233 |
@internalComponent
|
|
234 |
*/
|
|
235 |
class CPreallocatedFile : public CBase
|
|
236 |
{
|
|
237 |
public:
|
|
238 |
/**
|
|
239 |
* Pre-allocated file versions
|
|
240 |
*/
|
|
241 |
enum TPreAllocatedFileVersion
|
|
242 |
{
|
|
243 |
/** The default value. */
|
|
244 |
EPreAllocatedFileV1
|
|
245 |
};
|
|
246 |
|
|
247 |
public:
|
|
248 |
static CPreallocatedFile* NewL(RFs& aFs, const TDesC& aFileName, TInt aMaxClass0Msg, TInt aMaxPDUSeg, TPreAllocatedFileVersion aVersion=EPreAllocatedFileV1);
|
|
249 |
~CPreallocatedFile();
|
|
250 |
|
|
251 |
void CreateL();
|
|
252 |
void OpenL();
|
|
253 |
void Close();
|
|
254 |
TBool IsFileOK();
|
|
255 |
|
|
256 |
void AddNewMessageL(TInt& aIndex, CSmsMessage& aSmsMessage,const TGsmSms& aGsmSms);
|
|
257 |
void UpdateExistingMessageL(TInt aIndex, const CSmsMessage& aSmsMessage, TInt aPduIndex, const TGsmSms& aSms);
|
|
258 |
void UpdateLogServerIdL(TInt& aIndex, TLogId aLogServerId);
|
|
259 |
void SetPassedToClientL(TInt aIndex, TBool aBool);
|
|
260 |
void MatchEntryToExistingMessage(const TReassemblyEntry& aEntry, TInt& aIndex);
|
|
261 |
void AddEntryL(TSmsPreAllocatedFileStoreReassemblyEntry& aEntry);
|
|
262 |
void DeleteEntryL(TInt aIndex);
|
|
263 |
|
|
264 |
void InternalizeEntryL(const TInt aIndex, CSmsMessage& aSmsMessage, CArrayFix<TInt>& aIndexArray, CArrayFix<TGsmSms>& aSmsArray);
|
|
265 |
|
|
266 |
void BeginTransactionL();
|
|
267 |
void CommitTransactionL();
|
|
268 |
void Revert();
|
|
269 |
void CopyDuplicateToMasterL();
|
|
270 |
TInt NumberOfPDUStored();
|
|
271 |
TInt GetOldestMessageEntryIndex();
|
|
272 |
|
|
273 |
void RemovePDUsL(TInt aIndex, TInt aStartPos, TInt aEndPos);
|
|
274 |
void StoreForwardedPDUsInfoL(TInt aIndex, TInt aStartPos, TInt aEndPos);
|
|
275 |
|
|
276 |
const CArrayFix<TSmsPreAllocatedFileStoreReassemblyEntry>& Entries() const {return iEntryArray;}
|
|
277 |
|
|
278 |
private:
|
|
279 |
CPreallocatedFile(RFs& aFs, TInt aMaxClass0Msg, TInt aMaxPDUSeg, TPreAllocatedFileVersion aVersion);
|
|
280 |
void ConstructL(const TDesC& aFileName);
|
|
281 |
|
|
282 |
void InternalizeEntryArrayL();
|
|
283 |
void ExternalizeEntryArray();
|
|
284 |
|
|
285 |
void ChangeEntryL(TInt aIndex, const TSmsPreAllocatedFileStoreReassemblyEntry& aNewEntry);
|
|
286 |
void AddStorageIdL(TInt aIndex, TInt aStorageId);
|
|
287 |
void ExternalizeEntry(TInt aContainerId, const TGsmSmsSlotEntry& aSmsSlot, TInt aIndex, const TGsmSms& aGsmSms);
|
|
288 |
void ExternalizeEntry(TInt aContainerId, TInt aIndex, const TGsmSms& aGsmSms);
|
|
289 |
TInt GetFreeContainer();
|
|
290 |
TInt GetFreeStorageId();
|
|
291 |
void CheckDataL();
|
|
292 |
TUint32 ChecksumValue();
|
|
293 |
void CopyMasterToDuplicateL();
|
|
294 |
void PutChecksumValueL();
|
|
295 |
void ClearEntryL(TInt aStorageId, TInt aNumberOfPDUs);
|
|
296 |
|
|
297 |
void RemoveDeletedEntries();
|
|
298 |
void ReinstateDeletedEntries();
|
|
299 |
void ReinstateEntries();
|
|
300 |
|
|
301 |
private:
|
|
302 |
enum TReinstateFlag
|
|
303 |
{
|
|
304 |
EEntryIsDeleted=1, //< indicates that this entry is deleted
|
|
305 |
EEntryIsAdded=2 //< indicated that this entry is added
|
|
306 |
};
|
|
307 |
|
|
308 |
class TReinstateEntryInfo
|
|
309 |
{
|
|
310 |
public:
|
|
311 |
TInt iPreAllocatedStorageId;
|
|
312 |
TInt iContainerId;
|
|
313 |
TReinstateFlag iFlag;
|
|
314 |
};
|
|
315 |
|
|
316 |
private:
|
|
317 |
RFs& iFs;
|
|
318 |
RFile iFile;
|
|
319 |
HBufC* iFileName;
|
|
320 |
CArrayFixFlat<TSmsPreAllocatedFileStoreReassemblyEntry> iEntryArray;
|
|
321 |
TBool iInTransaction;
|
|
322 |
/*
|
|
323 |
The below data structure (iReinstateEntryInfo) is there for revert
|
|
324 |
operation to succeed. e.g, If after removing the PDUs from pre-allocated
|
|
325 |
file it is needed to restore, then using this data structure the lost
|
|
326 |
information can be retrieved. In the same way after adding the PDU if
|
|
327 |
it is needed to be deleted then using this data structure it can be
|
|
328 |
found where the PDU is added.
|
|
329 |
*/
|
|
330 |
CArrayFixFlat<TReinstateEntryInfo> iReinstateEntryInfo;
|
|
331 |
|
|
332 |
TInt iMaxClass0Msg;
|
|
333 |
TInt iMaxPDUSeg;
|
|
334 |
TPreAllocatedFileVersion iVersion;
|
|
335 |
|
|
336 |
TInt iSizeOfEntrySection;
|
|
337 |
TInt iSizeOfStorageIdentifierSection;
|
|
338 |
TInt iSizeOfFile;
|
|
339 |
TInt iBeginOfDuplicateHeaderSection;
|
|
340 |
TInt iBeginOfDataSection;
|
|
341 |
};
|
|
342 |
|
|
343 |
/**
|
|
344 |
This class provides the interface to enable & disable the guard timer.
|
|
345 |
|
|
346 |
When class 0 re-assembly store opens, it enable the guard timer.
|
|
347 |
When the timer expires, it requests re-assembly store to forward & purge all
|
|
348 |
those messages whose time have expired. Then it again enables the guard timer.
|
|
349 |
It always enables the guard timer against the oldest message. When the timer expires
|
|
350 |
it again re-calculate expire time on the basis of time of old message. If there is no
|
|
351 |
message then it set the timer against configured timeout settings.
|
|
352 |
|
|
353 |
@internalComponent
|
|
354 |
*/
|
|
355 |
class CGuardTimer : public CTimer
|
|
356 |
{
|
|
357 |
public:
|
|
358 |
static CGuardTimer* NewL(CClass0SmsReassemblyStore& aClass0ReassemblyStore, TInt aGuardTimeout);
|
|
359 |
~CGuardTimer();
|
|
360 |
void EnableGuardTimer();
|
|
361 |
void DisableGuardTimer();
|
|
362 |
|
|
363 |
private:
|
|
364 |
CGuardTimer(CClass0SmsReassemblyStore& aClass0ReassemblyStore, TInt aGuardTimeout);
|
|
365 |
void RunL();
|
|
366 |
|
|
367 |
private:
|
|
368 |
CClass0SmsReassemblyStore& iClass0ReassemblyStore;
|
|
369 |
const TTimeIntervalSeconds iTimeoutInSecs;
|
|
370 |
};
|
|
371 |
|
|
372 |
/*
|
|
373 |
This class is primarily responsible for storing incoming class 0 SMS PDU's & assembling them.
|
|
374 |
It provides the same functionality as CSmsReassemblyStore class but augmented the
|
|
375 |
functionality by adding the fallback mechanism to store class 0 SMS message in out of
|
|
376 |
disk condition. It maintains reference to CPermanentStoreFile & CPreAllocatedFile
|
|
377 |
to store incoming PDU in normal & out of disk condition respectively. It also contains a
|
|
378 |
timer object which will be used as guard timer.
|
|
379 |
|
|
380 |
This class is derived from CReassemblyStore & has implemented all the pure virtual functions.
|
|
381 |
|
|
382 |
It also adds few new functions which is required for handling specific class 0 message requirements
|
|
383 |
like handling of incomplete class 0 messages, guard time out, etc.
|
|
384 |
|
|
385 |
@internalComponent
|
|
386 |
*/
|
|
387 |
class CClass0SmsReassemblyStore : public CReassemblyStore
|
|
388 |
{
|
|
389 |
friend class CFacadeSmsReassemblyStore;
|
|
390 |
friend void CClass0StoreCloseObject(TAny* aObj);
|
|
391 |
|
|
392 |
public:
|
|
393 |
static CClass0SmsReassemblyStore* NewL(RFs& aFs, MSmsComm& aSmsComm);
|
|
394 |
virtual ~CClass0SmsReassemblyStore();
|
|
395 |
|
|
396 |
//Function related to incomplete message
|
|
397 |
void ProcessMessageIfExceedLimitationL(MSmsComm& aSmsComm);
|
|
398 |
void ForwardCompleteClass0SmsMessagesL(MSmsComm& aSmsComm, const CSmsMessage& aSmsMessage,const TSmsAddr* aOriginalSmsAddr,const CSmsMessage* aOriginalSmsMessage,TDes& aDes);
|
|
399 |
void SetIncompleteMessageForwardedToClientL(const CSmsMessage& aSmsMessage);
|
|
400 |
//Function which set the disk space state
|
|
401 |
void SetDiskSpaceState(TSmsDiskSpaceMonitorStatus aDiskSpaceStatus);
|
|
402 |
//Function related to guard timer
|
|
403 |
void GetNextGuardTimeout(TTime& aNextTimeout);
|
|
404 |
void ProcessTimeoutMessageL();
|
|
405 |
//Function related to clean-up
|
|
406 |
TInt CleanReassemblyEntries();
|
|
407 |
|
|
408 |
public:
|
|
409 |
//Implementation of public pure virtual function of CReassemblyStore
|
|
410 |
virtual void OpenStoreL();
|
|
411 |
virtual void Close();
|
|
412 |
|
|
413 |
private:
|
|
414 |
CClass0SmsReassemblyStore(RFs& aFs, MSmsComm& aSmsComm);
|
|
415 |
void ConstructL();
|
|
416 |
void Revert();
|
|
417 |
void ReadConfigurableClass0SmsSettingsL(TInt& aMaxClass0Msg, TInt& aMaxPDUSeg, TInt& aGuardTimeOut);
|
|
418 |
|
|
419 |
//Function related for reserved space full.
|
|
420 |
TBool IsExceedLimitation();
|
|
421 |
TInt GetIndexOfOldestMessage();
|
|
422 |
TInt GetIndexOfOldestMessageFromReservedFileL();
|
|
423 |
void GetSmsEntriesL(const TReassemblyEntry& aEntry, CSmsMessage& aSmsMessage, CArrayFix<TInt>& aIndexArray, CArrayFix<TGsmSms>& aSmsArray);
|
|
424 |
void SortPDUsL(CArrayFix<TInt>& aIndexArray, CArrayFix<TGsmSms>& aSmsArray);
|
|
425 |
|
|
426 |
private:
|
|
427 |
//Implementation of private pure virtual function of CReassemblyStore
|
|
428 |
virtual void PopulateEntryArrayL(CArrayFix<TReassemblyEntry>& aEntryArray);
|
|
429 |
virtual void AddNewMessageL(CSmsMessage& aSmsMessage,const TGsmSms& aGsmSms);
|
|
430 |
virtual void UpdateExistingMessageL(CSmsMessage& aSmsMessage,const TGsmSms& aGsmSms, TBool& aDuplicateMsgRef, TBool& aDuplicateSlot);
|
|
431 |
virtual void RetrieveMessageL(const TReassemblyEntry& aEntry, CSmsMessage& aSmsMessage);
|
|
432 |
virtual void DeleteEntryL(const TReassemblyEntry& aEntry);
|
|
433 |
virtual void SetPassedToClientL(const TReassemblyEntry& aEntry, TBool aBool);
|
|
434 |
virtual void UpdateLogServerIdL(const TReassemblyEntry& aEntry, TLogId aLogServerId);
|
|
435 |
virtual void BeginTransactionLC();
|
|
436 |
virtual void CommitTransactionL();
|
|
437 |
|
|
438 |
private:
|
|
439 |
enum
|
|
440 |
{
|
|
441 |
KMaxNumberOfClass0MessagesInReassemblyStore = 10
|
|
442 |
};
|
|
443 |
|
|
444 |
enum
|
|
445 |
{
|
|
446 |
KNumberOfPDUSegmentsStoredInOODCondition = 20
|
|
447 |
};
|
|
448 |
|
|
449 |
enum
|
|
450 |
{
|
|
451 |
KGuardTimeOut = 12
|
|
452 |
};
|
|
453 |
|
|
454 |
private:
|
|
455 |
MSmsComm& iSmsComm;
|
|
456 |
CSmsPermanentFileStore* iPermanentFileStore;
|
|
457 |
CPreallocatedFile* iPreallocatedFile;
|
|
458 |
CGuardTimer* iGuardTimer;
|
|
459 |
TBool iInTransaction;
|
|
460 |
TSmsDiskSpaceMonitorStatus iDiskSpaceStatus;
|
|
461 |
|
|
462 |
TInt iMaxClass0Msg;
|
|
463 |
TInt iMaxPDUSeg;
|
|
464 |
TInt iGuardTimeOut;
|
|
465 |
};
|
|
466 |
|
|
467 |
#endif // !defined __SMSPCLASS0STOR_H__
|
|
468 |
|