CFSMailBox Class Reference

class CFSMailBox : public CFSMailBoxBase

mailbox data handling

FSFWCommonLib

Public Member Functions
~CFSMailBox ()
IMPORT_C void AddObserver (const TFSMailMsgId , MFSMailEventObserver &)
IMPORT_C void CancelSearch ()
IMPORT_C void CancelSyncL ()
IMPORT_C void ClearSearchResultCache ()
IMPORT_C void CopyMessagesL (const RArray < TFSMailMsgId > &, RArray < TFSMailMsgId > &, const TFSMailMsgId , const TFSMailMsgId )
IMPORT_C CFSMailMessage * CreateForwardMessage (const TFSMailMsgId , const TDesC &)
IMPORT_C CFSMailMessage * CreateMessageFromFileL (const RFile &)
IMPORT_C CFSMailMessage * CreateMessageToSend ()
IMPORT_C CFSMailMessage * CreateReplyMessage (const TFSMailMsgId , const TBool , const TDesC &)
IMPORT_C TSSMailSyncState CurrentSyncState ()
IMPORT_C CEmailExtension * ExtensionL (const TUid &)
IMPORT_C TDesC & GetBrandingIdL ()
IMPORT_C TInt GetConnectionId ( TUint32 &)
IMPORT_C TFSProgress GetLastSyncStatusL ()
IMPORT_C TFSMailBoxStatus GetMailBoxStatus ()
IMPORT_C TFSMailMsgId GetStandardFolderId (const TFSFolderType )
IMPORT_C void GoOfflineL ()
IMPORT_C void GoOnlineL ()
IMPORT_C TBool HasCapability (const TFSMailBoxCapabilities )
IMPORT_C TInt IsConnectionAllowedWhenRoaming ( TBool &)
IMPORT_C void ListFolders (const TFSMailMsgId , RPointerArray < CFSMailFolder > &)
IMPORT_C RPointerArray < CFSMailFolder > & ListFolders ()
IMPORT_C MDesCArray * ListMrusL ()
IMPORT_C void MoveMessagesL (const RArray < TFSMailMsgId > &, const TFSMailMsgId , const TFSMailMsgId )
IMPORT_C TInt MoveMessagesL ( MFSMailRequestObserver &, const RArray < TFSMailMsgId > &, const TFSMailMsgId , const TFSMailMsgId )
IMPORT_C CFSMailBox * NewL ( TFSMailMsgId )
IMPORT_C CFSMailBox * NewLC ( TFSMailMsgId )
IMPORT_C TInt RefreshNowL ( MFSMailRequestObserver &)
IMPORT_C TInt RefreshNowL ()
IMPORT_C void ReleaseExtension ( CEmailExtension *)
IMPORT_C void RemoveDownLoadedAttachmentsL ()
IMPORT_C void SearchL (const RPointerArray < TDesC > &, const TFSMailSortCriteria &, MFSMailBoxSearchObserver &)
IMPORT_C void SearchL (const RPointerArray < TDesC > &, const TFSMailSortCriteria &, MFSMailBoxSearchObserver &, RArray < TFSMailMsgId >)
IMPORT_C void SendMessageL ( CFSMailMessage &)
IMPORT_C void SetCredentialsL (const TDesC &, const TDesC &)
Private Member Functions
CFSMailBox ()
void AddAndRemoveExcessMruL ( CDesCArraySeg &, CFSMailAddress &)
void AppendMruItemL ( CDesCArraySeg &, CFSMailAddress &)
void ConstructL ( TFSMailMsgId )
CDesCArraySeg * CopyArrayL (MDesCArray &)
TInt FindAddressFromMruList ( CDesCArraySeg &, TDesC &, TInt &)
void SetAsMostRecentMruL ( CDesCArraySeg &, TInt , CFSMailAddress &)
void UpdateMruListL ( CDesCArraySeg &, const RPointerArray < CFSMailAddress > &)
void UpdateMrusL (const RPointerArray < CFSMailAddress > &, const RPointerArray < CFSMailAddress > &, const RPointerArray < CFSMailAddress > &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CFSMailBoxBase::BrandingId()
CFSMailBoxBase::CFSMailBoxBase()
CFSMailBoxBase::GetId()const
CFSMailBoxBase::GetName()const
CFSMailBoxBase::GetRCLInfo(TUid &,TUint &)
CFSMailBoxBase::GetSettingsUid()
CFSMailBoxBase::GetStatus()const
CFSMailBoxBase::IsMRInfoProcessorSet()
CFSMailBoxBase::MRInfoProcessorL()
CFSMailBoxBase::OwnMailAddress()
CFSMailBoxBase::SetMRInfoProcessorL(MMRInfoProcessor *)
CFSMailBoxBase::SetMailBoxId(TFSMailMsgId)
CFSMailBoxBase::SetName(const TDesC &)
CFSMailBoxBase::SetOwnMailAddressL(CFSMailAddress *)
CFSMailBoxBase::SetRCLInfo(const TUid,const TUint)
CFSMailBoxBase::SetSettingsUid(const TUid)
CFSMailBoxBase::SetStatus(const TFSMailBoxStatus)
CFSMailBoxBase::~CFSMailBoxBase()
Private Attributes
RPointerArray < CFSMailFolder > iFolders
CFSMailRequestHandler * iRequestHandler
Inherited Attributes
CExtendableEmail::iExtensions
CFSMailBoxBase::iMailBoxId

Constructor & Destructor Documentation

CFSMailBox()

CFSMailBox ( ) [private]

C++ default constructor.

~CFSMailBox()

~CFSMailBox ( )

Destructor.

Member Functions Documentation

AddAndRemoveExcessMruL(CDesCArraySeg &, CFSMailAddress &)

void AddAndRemoveExcessMruL ( CDesCArraySeg & aMruList,
CFSMailAddress & aToBeAdded
) const [private]

Removes the oldest entry from the mru list and adds given address info to the mru list.

Parameters

CDesCArraySeg & aMruList Mru list.
CFSMailAddress & aToBeAdded Address info to be added into the mru list.

AddObserver(const TFSMailMsgId, MFSMailEventObserver &)

IMPORT_C void AddObserver ( const TFSMailMsgId aFolderId,
MFSMailEventObserver & aObserver
)

DEPRECATED

Parameters

const TFSMailMsgId aFolderId
MFSMailEventObserver & aObserver observer

AppendMruItemL(CDesCArraySeg &, CFSMailAddress &)

void AppendMruItemL ( CDesCArraySeg & aMruList,
CFSMailAddress & aToBeAppended
) const [private]

Function to append mru entry to the mru list. This implementation adds display name and then the address in this order into the mru list.

Parameters

CDesCArraySeg & aMruList Mru list.
CFSMailAddress & aToBeAppended

CancelSearch()

IMPORT_C void CancelSearch ( )

Cancels current search. Does nothing if there is not any search ongoing. The search client will not be called back after this function is called.

note CancelSearch() method does NOT clear the search result cached in the store. A different sort order can be used for the same search string, and the cache will be utilized. Only by using a different search string can the cache be cleaned.

CancelSyncL()

IMPORT_C void CancelSyncL ( )

cancels all ongoing synchronizations in this mailbox regardless of initiator, by user or by plugin itself

ClearSearchResultCache()

IMPORT_C void ClearSearchResultCache ( )

Inform the store to clean up its cache for search results.

This method cancels the the ongoing search (if exists), and then clean ups store's cache.

This function should be called by the UI when search results are no longer in display.

ConstructL(TFSMailMsgId)

void ConstructL ( TFSMailMsgId aMailBoxId ) [private]

Two-phased constructor

Parameters

TFSMailMsgId aMailBoxId

CopyArrayL(MDesCArray &)

CDesCArraySeg * CopyArrayL ( MDesCArray & aArrayToBeCopied ) const [private]

Function used to copy array contents to another array.

Parameters

MDesCArray & aArrayToBeCopied Array that should be copied.

CopyMessagesL(const RArray< TFSMailMsgId > &, RArray< TFSMailMsgId > &, const TFSMailMsgId, const TFSMailMsgId)

IMPORT_C void CopyMessagesL ( const RArray < TFSMailMsgId > & aMessageIds,
RArray < TFSMailMsgId > & aCopiedMessages,
const TFSMailMsgId aSourceFolderId,
const TFSMailMsgId aDestinationFolderId
)

Copies a messages from one folder to another folder. including the properties, content, and all attachments. (note only works if the store is in an authenticated state, otherwise this function leaves with KErrNotReady)

Parameters

const RArray < TFSMailMsgId > & aMessageIds ids of the messages to be copied
RArray < TFSMailMsgId > & aCopiedMessages table containing (new) ids of the copied messages owned by user
const TFSMailMsgId aSourceFolderId source folder id
const TFSMailMsgId aDestinationFolderId destination folder id

CreateForwardMessage(const TFSMailMsgId, const TDesC &)

IMPORT_C CFSMailMessage * CreateForwardMessage ( const TFSMailMsgId aOriginalMessageId,
const TDesC & aHeaderDescriptor =  KNullDesC
)

creates into this mailbox new draft email to be forwarded

Parameters

const TFSMailMsgId aOriginalMessageId message id of the original message to be forwarded
const TDesC & aHeaderDescriptor =  KNullDesC user can give quote headers data to plugin as parameter if needed

CreateMessageFromFileL(const RFile &)

IMPORT_C CFSMailMessage * CreateMessageFromFileL ( const RFile & aFile )

creates email from RFC822 format data stream located in given attachment file

return new email object, ownership is transferred to user

Parameters

const RFile & aFile access to file containing data stream contents given by user

CreateMessageToSend()

IMPORT_C CFSMailMessage * CreateMessageToSend ( )

creates into this mailbox new draft email

CreateReplyMessage(const TFSMailMsgId, const TBool, const TDesC &)

IMPORT_C CFSMailMessage * CreateReplyMessage ( const TFSMailMsgId aOriginalMessageId,
const TBool aReplyToAll,
const TDesC & aHeaderDescriptor =  KNullDesC
)

creates into this mailbox new email for reply

Parameters

const TFSMailMsgId aOriginalMessageId id of the original message to be replied
const TBool aReplyToAll is set true if reply to all is requested
const TDesC & aHeaderDescriptor =  KNullDesC user can give quote headers data to plugin as parameter if needed

CurrentSyncState()

IMPORT_C TSSMailSyncState CurrentSyncState ( ) const

Returns the current synchronizing state of this mailbox.

ExtensionL(const TUid &)

IMPORT_C CEmailExtension * ExtensionL ( const TUid & aInterfaceUid ) [virtual]

Returns extension by uid, leaves KErrNotSupported if extension is not available.

Parameters

const TUid & aInterfaceUid extension interface uid

FindAddressFromMruList(CDesCArraySeg &, TDesC &, TInt &)

TInt FindAddressFromMruList ( CDesCArraySeg & aMruList,
TDesC & searchedAddress,
TInt & aPos
) const [private]

Function used to search an address from given mru list. Fucntion goes through the addresses in the mru list and returns the first one matching the given address.

Parameters

CDesCArraySeg & aMruList Mru list that is searched through.
TDesC & searchedAddress Address that is searched from the given mru list.
TInt & aPos Reference parameter used to return the position of a matching address if such was found.

GetBrandingIdL()

IMPORT_C TDesC & GetBrandingIdL ( )

Branding id accessor for this mailbox. This function is used by Branding Manager to associate mailbox to a branding definition.

GetConnectionId(TUint32 &)

IMPORT_C TInt GetConnectionId ( TUint32 & aConnectionId )

reads connection id from plugin

Parameters

TUint32 & aConnectionId reference to connection id

GetLastSyncStatusL()

IMPORT_C TFSProgress GetLastSyncStatusL ( )

Returns last synchronizing operation progress status.

GetMailBoxStatus()

IMPORT_C TFSMailBoxStatus GetMailBoxStatus ( )

mailbox connection status accessor

GetStandardFolderId(const TFSFolderType)

IMPORT_C TFSMailMsgId GetStandardFolderId ( const TFSFolderType aFolderType )

Standard folder id accessor.

Parameters

const TFSFolderType aFolderType defines folder type

GoOfflineL()

IMPORT_C void GoOfflineL ( )

Disables mailbox synchronization. Connection to server in order to synchronize the mailbox is not allowed after this.

If GoOnlineL has effect on other mailboxes using the same connection then this function has effect on those mailboxes also.

GoOnlineL()

IMPORT_C void GoOnlineL ( )

Enables synchronization of the mailbox. This means that the framework can connect to server to do synchronization of the mailbox when necessary or stay connected all the time. The actual functionality depends on user settings and connection implementation.

All collections (mail etc.) supported by the connection and enabled by user settings are synchronized.

This function sets the mailbox online but it may have a side effect that also other mailboxes provided through the same connection are set online too.

Connection is set offline normally by using specific function for this purpose. There are also other reasons for ending up in offline state like network error or scheduling.

HasCapability(const TFSMailBoxCapabilities)

IMPORT_C TBool HasCapability ( const TFSMailBoxCapabilities aCapability ) const

mailbox capability check for user

Parameters

const TFSMailBoxCapabilities aCapability

IsConnectionAllowedWhenRoaming(TBool &)

IMPORT_C TInt IsConnectionAllowedWhenRoaming ( TBool & aConnectionAllowed )

checks from plugin if connection is allowed when roaming

Parameters

TBool & aConnectionAllowed

ListFolders(const TFSMailMsgId, RPointerArray< CFSMailFolder > &)

IMPORT_C void ListFolders ( const TFSMailMsgId aFolderId,
RPointerArray < CFSMailFolder > & aFolderList
)

List subfolders of given folder. Only direct subfolders of given folder are returned.

folder data :
  • folder id

  • folder name

  • folder type ; Inbox, Outbox, Sent, Drafts, Deleted, Other

  • message count

  • unread message count

  • mailbox id

  • parent folder

  • subfolder count

Parameters

const TFSMailMsgId aFolderId defines parent folder id. TFSMailId::NullId() for root level list.
RPointerArray < CFSMailFolder > & aFolderList plugin writes results in this array owned by user

ListFolders()

IMPORT_C RPointerArray < CFSMailFolder > & ListFolders ( )

List all subfolders of mailbox.

folder data :
  • folder id

  • folder name

  • folder type ; Inbox, Outbox, Sent Items, Drafts, Deleted Items, Other

  • message count

  • unread message count

  • mailbox id

  • parent folder

  • subfolder count

ListMrusL()

IMPORT_C MDesCArray * ListMrusL ( ) const

Get a list of most recently used addresses of this mailbox. Each MRU entry consists of two descriptors placed sequentially in the array. First one is the display name and the second one is the actual email address. If for example some entry does not contain a name at all then a KNullDesC is found in place of the name.

MoveMessagesL(const RArray< TFSMailMsgId > &, const TFSMailMsgId, const TFSMailMsgId)

IMPORT_C void MoveMessagesL ( const RArray < TFSMailMsgId > & aMessageIds,
const TFSMailMsgId aSourceFolderId,
const TFSMailMsgId aDestinationFolderId
)

Moves a messages between folders.

Parameters

const RArray < TFSMailMsgId > & aMessageIds ids of the messages to be transferred
const TFSMailMsgId aSourceFolderId source folder id
const TFSMailMsgId aDestinationFolderId destination folder id

MoveMessagesL(MFSMailRequestObserver &, const RArray< TFSMailMsgId > &, const TFSMailMsgId, const TFSMailMsgId)

IMPORT_C TInt MoveMessagesL ( MFSMailRequestObserver & aOperationObserver,
const RArray < TFSMailMsgId > & aMessageIds,
const TFSMailMsgId aSourceFolderId,
const TFSMailMsgId aDestinationFolderId
)

Moves a messages between folders. Async version.

Parameters

MFSMailRequestObserver & aOperationObserver
const RArray < TFSMailMsgId > & aMessageIds ids of the messages to be transferred
const TFSMailMsgId aSourceFolderId source folder id
const TFSMailMsgId aDestinationFolderId destination folder id

NewL(TFSMailMsgId)

IMPORT_C CFSMailBox * NewL ( TFSMailMsgId aMailBoxId ) [static]

two based constructor

Parameters

TFSMailMsgId aMailBoxId mailbox id in plugin containing mailbox

NewLC(TFSMailMsgId)

IMPORT_C CFSMailBox * NewLC ( TFSMailMsgId aMailBoxId ) [static]

two based constructor

Parameters

TFSMailMsgId aMailBoxId mailbox id in plugin containing mailbox

RefreshNowL(MFSMailRequestObserver &)

IMPORT_C TInt RefreshNowL ( MFSMailRequestObserver & aOperationObserver )

Forces synchronization of mailbox. This can be called whether the mailbox is currently offline or online. In the case the mailbox is offline in the beginning, connection is made up for the time of the synchronization.

All collections (mail etc.) supported by the connection and enabled by user settings are synchronized.

This is an asynchronous operation and the request id is returned for cancelling purpose.

User can provide an observer as a parameter, which will pass progress notifications during the operation as callbacks related to this operation.

Alternatively user can use overloaded parallel implementation of function without an observer function and rely only on general events. Notice that the general event system is not as comprehensive as the observing using dedicated observer.

Parameters

MFSMailRequestObserver & aOperationObserver optional observer given by user

RefreshNowL()

IMPORT_C TInt RefreshNowL ( )

ReleaseExtension(CEmailExtension *)

IMPORT_C void ReleaseExtension ( CEmailExtension * aExtension ) [virtual]

Parameters

CEmailExtension * aExtension

RemoveDownLoadedAttachmentsL()

IMPORT_C void RemoveDownLoadedAttachmentsL ( )

removes downloaded attachments from local/terminal memory

SearchL(const RPointerArray< TDesC > &, const TFSMailSortCriteria &, MFSMailBoxSearchObserver &)

IMPORT_C void SearchL ( const RPointerArray < TDesC > & aSearchStrings,
const TFSMailSortCriteria & aSortCriteria,
MFSMailBoxSearchObserver & aSearchObserver
)

Asyncronous call for starting search for given string. Only one search can be performed at a time.

This function will search for message's containing the given search string. The search will be performed on the all message fields: To, Cc, Bcc, subject, body. The search client will be notified of each found message, and upon completion of the search. Only one search can be performed at a time.

To change the sort order in the search result, use the same search string in the but change the aSortCriteria parameter. The store "caches" the search results generated by the same search string.

The function will leave with KErrInUse if a search is already in progress.

note only works if the store is in an authenticated state, otherwise this function leaves with KErrNotReady

Parameters

const RPointerArray < TDesC > & aSearchStrings text strings that will be searched from different message fields.
const TFSMailSortCriteria & aSortCriteria sort criteria for the results
MFSMailBoxSearchObserver & aSearchObserver

SearchL(const RPointerArray< TDesC > &, const TFSMailSortCriteria &, MFSMailBoxSearchObserver &, RArray< TFSMailMsgId >)

IMPORT_C void SearchL ( const RPointerArray < TDesC > & aSearchStrings,
const TFSMailSortCriteria & aSortCriteria,
MFSMailBoxSearchObserver & aSearchObserver,
RArray < TFSMailMsgId > aFolderIds
)

Parameters

const RPointerArray < TDesC > & aSearchStrings
const TFSMailSortCriteria & aSortCriteria
MFSMailBoxSearchObserver & aSearchObserver
RArray < TFSMailMsgId > aFolderIds

SendMessageL(CFSMailMessage &)

IMPORT_C void SendMessageL ( CFSMailMessage & aMessage )

sends email

Parameters

CFSMailMessage & aMessage message to be sent

SetAsMostRecentMruL(CDesCArraySeg &, TInt, CFSMailAddress &)

void SetAsMostRecentMruL ( CDesCArraySeg & aMruList,
TInt aPosition,
CFSMailAddress & aMostRecent
) const [private]

Function to set the already existing entry in the mru list as the most recent one.

Parameters

CDesCArraySeg & aMruList Mru list that should be edited.
TInt aPosition Position where from the address element of the most recent address is found. The display name of the address is found with index one less from the mru list.
CFSMailAddress & aMostRecent After removal of the mru entry with given index, this entry is added into the mru list as the most recently used one.

SetCredentialsL(const TDesC &, const TDesC &)

IMPORT_C void SetCredentialsL ( const TDesC & aUsername,
const TDesC & aPassword
)

mailbox authentication data mutator

Parameters

const TDesC & aUsername account user name
const TDesC & aPassword account password

UpdateMruListL(CDesCArraySeg &, const RPointerArray< CFSMailAddress > &)

void UpdateMruListL ( CDesCArraySeg & aMruList,
const RPointerArray < CFSMailAddress > & aNewRecentlyUsedOnes
) const [private]

Function used to update given mru list with recently used address info. If this info is already found from the mru list then it is moved to the end of the mru list. This way the most recent ones are found from the end of the list.

Parameters

CDesCArraySeg & aMruList Mru list that should be updated.
const RPointerArray < CFSMailAddress > & aNewRecentlyUsedOnes Addresses that should be used to update the given mru list.

UpdateMrusL(const RPointerArray< CFSMailAddress > &, const RPointerArray< CFSMailAddress > &, const RPointerArray< CFSMailAddress > &)

void UpdateMrusL ( const RPointerArray < CFSMailAddress > & aRecipients,
const RPointerArray < CFSMailAddress > & aCCRecipients,
const RPointerArray < CFSMailAddress > & aBCCRecipients
) const [private]

Function used internally to inform that Mru list related to this mailbox should now be updated using the given recipient info. In other words this function makes sure that the given recipients are found from the mru list in which the mrus of this mailbox are stored. Mrus are stored in the plugin.

Parameters

const RPointerArray < CFSMailAddress > & aRecipients email recipients in TO-field
const RPointerArray < CFSMailAddress > & aCCRecipients email recipients in CC-field
const RPointerArray < CFSMailAddress > & aBCCRecipients email recipients in BCC-field

Member Data Documentation

RPointerArray< CFSMailFolder > iFolders

RPointerArray < CFSMailFolder > iFolders [private]

mailbox folder list

CFSMailRequestHandler * iRequestHandler

CFSMailRequestHandler * iRequestHandler [private]

request handler for plugin requests