CImapSyncDownloadRules Class Reference

class CImapSyncDownloadRules : public CBase

Stores the download rules to be used during the IMAP synchronisation phase.

Each rule consists of a bearer types field, and a set of get mail options. The bearer types are defined by the TCommDbBearer enumeration and it is possible to specify multiple bearer types for one rule by performing a bitwise OR operation on the values from the enumeration and passing the resulting value to the various APIs. The get mail options are defined by the TImImap4GetPartialMailInfo structure.

There are two sets of download rules, one set for the inbox and one set for other folders. Generally each of the APIs takes a flag to indicate which set to operate upon.

Inherits from

Constructor & Destructor Documentation

CImapSyncDownloadRules()

CImapSyncDownloadRules ( ) [private]

Class constructor

~CImapSyncDownloadRules()

~CImapSyncDownloadRules ( )

Class destructor

Member Functions Documentation

AddRuleL(TRulesType, TInt, TUint32, const TImImap4GetPartialMailInfo &)

IMPORT_C TInt AddRuleL ( TRulesType aType,
TInt aPos,
TUint32 aBearerTypes,
const TImImap4GetPartialMailInfo & aMailInfo
)

Adds a new synchronisation download rule.

The position for the new rule is specified in the parameter list. If the position is greater than the number of rules already in the list then the new rule is added at the end of the list. If the position is less than the number of rules already in the list, then the new rule is inserted at that position and all subsequent rules moved down by one position. The actual position where the rule was added is given by the return value.

Invalid arguments passed to the routine will cause a panic on debug builds but a leave with KErrArgument on a release build.

leave
KErrArgument Argument passed in is invalid

Parameters

TRulesType aType Type of folder the rule is for (inbox or other folder)
TInt aPos Position in the list to add the rule.
TUint32 aBearerTypes Bearer types that will use the rule.
const TImImap4GetPartialMailInfo & aMailInfo Partial mail info options to use during synchronisation

ConstructL()

void ConstructL ( ) [private]

Second phase constructor

CopyL()

IMPORT_C CImapSyncDownloadRules * CopyL ( )

Make copy of an instance of the class.

CopyLC()

IMPORT_C CImapSyncDownloadRules * CopyLC ( )

Make new copy of an instance of the class. On return the copy will be on the cleanup stack.

DeleteBearerTypesL(TRulesType, TUint32, TBool &)

IMPORT_C TInt DeleteBearerTypesL ( TRulesType aType,
TUint32 aBearerTypes,
TBool & aRuleRemoved
)

Deletes bearer types from the synchronisation download rules.

Every rule is examined to see if the bearer types associated with that rule contain all of the passed in bearer types. If there is a match then the bearer types are removed from the rule. If this results in all the bearer types for the rule being removed then the rule is deleted and all subsequent rules are moved up one position.

Invalid arguments passed to the routine will cause a panic on debug builds but a leave with KErrArgument on a release build.

leave
KErrArgument Argument passed in is invalid

Parameters

TRulesType aType Type of folder the rule is for (inbox or other folder)
TUint32 aBearerTypes Bearer types to remove.
TBool & aRuleRemoved If the bearer types are removed, this flag indicates if the removal resulted in the rule being removed as well.

DeleteRuleL(TRulesType, TInt)

IMPORT_C TBool DeleteRuleL ( TRulesType aType,
TInt aPos
)

Deletes a synchronisation download rule from a given position

Invalid arguments passed to the routine will cause a panic on debug builds but a leave with KErrArgument on a release build.

leave
KErrArgument Argument passed in is invalid

Parameters

TRulesType aType Type of folder the rule is for (inbox or other folder)
TInt aPos Position in the list to add the rule.

GetMailInfoL(TRulesType, TUint32, TImImap4GetPartialMailInfo &)

IMPORT_C TInt GetMailInfoL ( TRulesType aType,
TUint32 aBearerTypes,
TImImap4GetPartialMailInfo & aMailInfo
) const

Gets the partial mail info object from the synchronisation download rule for a given bearer type.

The mail info is returned only if its associated bearer types contain all the bearer types specified in the passed in value.

Invalid arguments passed to the routine will cause a panic on debug builds but a leave with KErrArgument on a release build.

leave
KErrArgument Argument passed in is invalid

Parameters

TRulesType aType Type of folder the rule is for (inbox or other folder)
TUint32 aBearerTypes The bearer types to search for
TImImap4GetPartialMailInfo & aMailInfo On successful completion, this holds the mail info for the rule

GetRuleL(TRulesType, TInt, TUint32 &, TImImap4GetPartialMailInfo &)

IMPORT_C TBool GetRuleL ( TRulesType aType,
TInt aPos,
TUint32 & aBearerTypes,
TImImap4GetPartialMailInfo & aMailInfo
) const

Gets the synchronisation download rule at a given position.

Invalid arguments passed to the routine will cause a panic on debug builds but a leave with KErrArgument on a release build.

leave
KErrArgument Argument passed in is invalid

Parameters

TRulesType aType Type of folder the rule is for (inbox or other folder)
TInt aPos Position of the rule in the list
TUint32 & aBearerTypes On successful completion, this holds the bearer types for the rule
TImImap4GetPartialMailInfo & aMailInfo On successful completion, this holds the mail info for the rule

NewL()

IMPORT_C CImapSyncDownloadRules * NewL ( ) [static]

Factory constructor.

NewLC()

IMPORT_C CImapSyncDownloadRules * NewLC ( ) [static]

Factory constructor.

Reset()

IMPORT_C void Reset ( )

Reset the rules lists so that they are empty

Member Enumerations Documentation

Enum TRulesType

Defines the type of folder (inbox or other folder)

Enumerators

EInboxRulesType
EFolderRulesType

Member Data Documentation

RArray< TImapSyncDownloadRules > iRulesList

RArray < TImapSyncDownloadRules > iRulesList [private]