Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: CACHEMAN.H
Link against: imcm.lib

Class CImCacheManager

class CImCacheManager : public CMsvOperation;

Description

Provides management of the local cache of messages in remote mailboxes.

A mailbox that is being used in disconnected mode allows the user access to message data by opening the message directly from the remote mailbox. If the required message has been downloaded previously, then it will not necessarily need to be downloaded again. This functionality is achieved by preserving the message data locally, under the remote service entry. The preserved message data acts as a cache to allow the user access to the message without the need for it to be downloaded every time.

The cache management functionality is required to reduce the amount of memory that is consumed by the message cache. CImCacheManager provides a mechanism for asynchronously traversing a message tree and for removing text and attachment data from messages. Deleting more message data will free up more memory but there is a higher chance that a user will need to download a message for a second time.

CImCacheManager is an abstract base class, which can be specialised to implement a filter (Filter()) that decides if data for a message shoulded be deleted: for example, deletion could be restricted to 'all read messages over a week old,' or, 'all read messages, over 20K in size which are also over a day old.'

Derivation

Members

Defined in CImCacheManager:
CImCacheManager(), ConstructL(), DoCancel(), Filter(), ProgressL(), RunL(), StartL(), StartL(), iCurrentEntry, ~CImCacheManager()

Inherited from CActive:
Cancel(), Deque(), EPriorityHigh, EPriorityIdle, EPriorityLow, EPriorityStandard, EPriorityUserInput, IsActive(), IsAdded(), Priority(), RunError(), SetActive(), SetPriority(), TPriority, iStatus

Inherited from CBase:
Delete(), operator new()

Inherited from CMsvOperation:
Extension_(), FinalProgress(), Id(), Mtm(), Service(), SystemProgress(), iMsvSession, iMtm, iObserverRequestStatus, iService


Construction and destruction


~CImCacheManager()

IMPORT_C ~CImCacheManager();

Description

Destructor.

This cancels any operation in progress.


ConstructL()

protected: IMPORT_C void ConstructL();

Description

Second phase constructor.

All classes derived from CImCacheManager must call this function before StartL() is called.


CImCacheManager()

protected: IMPORT_C CImCacheManager(CMsvSession &aSession, TRequestStatus &aObserverRequestStatus);

Description

Constructor.

Parameters

CMsvSession &aSession

Message server session

TRequestStatus &aObserverRequestStatus

Unused

[Top]


Member functions


StartL()

IMPORT_C void StartL(TMsvId aRootEntry, TRequestStatus &aStatus);

Description

Performs a recursive cache cleanup starting from a specified root entry.

Cached data for entries below the specified root are cleaned-up if they meet the criteria specified by the implementation of Filter().

Parameters

TMsvId aRootEntry

Entry from which to start cache cleanup

TRequestStatus &aStatus

Asynchronous status word signalled when the operation is complete


StartL()

IMPORT_C void StartL(const CMsvEntrySelection &aSelection, TRequestStatus &aStatus);

Description

Performs a recursive cache cleanup for a specified selection of root entries.

Cached data for entries below the specified roots are cleaned-up if they meet the criteria specified by the implementation of Filter().

Parameters

const CMsvEntrySelection &aSelection

List of entries from which to start cache cleanup

TRequestStatus &aStatus

Asynchronous status word signalled when the operation is complete


ProgressL()

virtual IMPORT_C const TDesC8 &ProgressL();

Description

Gets information on the progress of the operation.

Return value

const TDesC8 &

Packaged TImCacheManagerProgress object holding operation progress details


DoCancel()

virtual IMPORT_C void DoCancel();

Description

Implements the active object cancellation protocol for a cache cleanup operation.

As the cache manager is an active object, a cache cleanup operation started by Start() can be cancelled using CActive::Cancel().

Cancellation halts any further deletion of message data, but does not restore any data that has already been deleted by the cleanup operation.

See also:


RunL()

protected: virtual IMPORT_C void RunL();

Description

Implements the active object completion protocol for a cache cleanup operation.

See also:


Filter()

private: virtual TBool Filter() const=0;

Description

Tests if cache cleanup should be performed on a message entry.

After StartL() has been called, this is called once for each message entry. It should return true if the body text and attachment data belonging to the current message, as held in iCurrentEntry, should be deleted, or false if the message should be left unchanged.

This function must be implemented in any classes derived from CImCacheManager.

Return value

TBool

True to clean the entry, false to leave it unchanged

[Top]


Member data


iCurrentEntry

protected: CMsvEntry * iCurrentEntry;

Description

Message entry currently being processed.