CImCacheManager Class Reference

#include <mw/cacheman.h>

class CImCacheManager
Protected Attributes
CMsvEntry *iCurrentEntry
Public Member Functions
~CImCacheManager()
IMPORT_C voidDoCancel()
IMPORT_C const TDesC8 &ProgressL()
IMPORT_C voidStartL(TMsvId, TRequestStatus &)
IMPORT_C voidStartL(const CMsvEntrySelection &, TRequestStatus &)
Protected Member Functions
CImCacheManager(CMsvSession &, TRequestStatus &)
IMPORT_C voidConstructL()
IMPORT_C voidRunL()

Detailed 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.'

Member Attribute Documentation

iCurrentEntry

CMsvEntry *iCurrentEntry[protected]

Message entry currently being processed.

Constructor & Destructor Documentation

CImCacheManager ( CMsvSession &, TRequestStatus & )

IMPORT_CCImCacheManager(CMsvSession &aSession,
TRequestStatus &aObserverRequestStatus
)[protected]

Constructor.

Parameters
aSessionMessage server session
aObserverRequestStatusUnused

~CImCacheManager ( )

IMPORT_C~CImCacheManager()

Destructor.

This cancels any operation in progress.

Member Function Documentation

ConstructL ( )

IMPORT_C voidConstructL()[protected]

Second phase constructor.

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

DoCancel ( )

IMPORT_C voidDoCancel()

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: CActive::Cancel()

ProgressL ( )

IMPORT_C const TDesC8 &ProgressL()

Gets information on the progress of the operation.

Return Value
Packaged TImCacheManagerProgress object holding operation progress details

RunL ( )

IMPORT_C voidRunL()[protected]

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

See also: CActive::RunL()

StartL ( TMsvId, TRequestStatus & )

IMPORT_C voidStartL(TMsvIdaRootEntry,
TRequestStatus &aStatus
)

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
aRootEntryEntry from which to start cache cleanup
aStatusAsynchronous status word signalled when the operation is complete

StartL ( const CMsvEntrySelection &, TRequestStatus & )

IMPORT_C voidStartL(const CMsvEntrySelection &aSelection,
TRequestStatus &aStatus
)

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
aSelectionList of entries from which to start cache cleanup
aStatusAsynchronous status word signalled when the operation is complete