CFSMailBox Class Reference

class CFSMailBox : public CFSMailBoxBase

mailbox data handling

FSFWCommonLib

Public Member Functions
~CFSMailBox()
IMPORT_C voidAddObserver(const TFSMailMsgId, MFSMailEventObserver &)
IMPORT_C voidCancelSearch()
IMPORT_C voidCancelSyncL()
IMPORT_C voidClearSearchResultCache()
IMPORT_C voidCopyMessagesL(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 TSSMailSyncStateCurrentSyncState()
IMPORT_C CEmailExtension *ExtensionL(const TUid &)
IMPORT_C TDesC &GetBrandingIdL()
IMPORT_C TIntGetConnectionId(TUint32 &)
IMPORT_C TFSProgressGetLastSyncStatusL()
IMPORT_C TFSMailBoxStatusGetMailBoxStatus()
IMPORT_C TFSMailMsgIdGetStandardFolderId(const TFSFolderType)
IMPORT_C voidGoOfflineL()
IMPORT_C voidGoOnlineL()
IMPORT_C TBoolHasCapability(const TFSMailBoxCapabilities)
IMPORT_C TIntIsConnectionAllowedWhenRoaming(TBool &)
IMPORT_C voidListFolders(const TFSMailMsgId, RPointerArray< CFSMailFolder > &)
IMPORT_C RPointerArray< CFSMailFolder > &ListFolders()
IMPORT_C MDesCArray *ListMrusL()
IMPORT_C voidMoveMessagesL(const RArray< TFSMailMsgId > &, const TFSMailMsgId, const TFSMailMsgId)
IMPORT_C TIntMoveMessagesL(MFSMailRequestObserver &, const RArray< TFSMailMsgId > &, const TFSMailMsgId, const TFSMailMsgId)
IMPORT_C CFSMailBox *NewL(TFSMailMsgId)
IMPORT_C CFSMailBox *NewLC(TFSMailMsgId)
IMPORT_C TIntRefreshNowL(MFSMailRequestObserver &)
IMPORT_C TIntRefreshNowL()
IMPORT_C voidReleaseExtension(CEmailExtension *)
IMPORT_C voidRemoveDownLoadedAttachmentsL()
IMPORT_C voidSearchL(const RPointerArray< TDesC > &, const TFSMailSortCriteria &, MFSMailBoxSearchObserver &)
IMPORT_C voidSearchL(const RPointerArray< TDesC > &, const TFSMailSortCriteria &, MFSMailBoxSearchObserver &, RArray< TFSMailMsgId >)
IMPORT_C voidSendMessageL(CFSMailMessage &)
IMPORT_C voidSetCredentialsL(const TDesC &, const TDesC &)
Private Member Functions
CFSMailBox()
voidAddAndRemoveExcessMruL(CDesCArraySeg &, CFSMailAddress &)
voidAppendMruItemL(CDesCArraySeg &, CFSMailAddress &)
voidConstructL(TFSMailMsgId)
CDesCArraySeg *CopyArrayL(MDesCArray &)
TInt FindAddressFromMruList(CDesCArraySeg &, TDesC &, TInt &)
voidSetAsMostRecentMruL(CDesCArraySeg &, TInt, CFSMailAddress &)
voidUpdateMruListL(CDesCArraySeg &, const RPointerArray< CFSMailAddress > &)
voidUpdateMrusL(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 &)

voidAddAndRemoveExcessMruL(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 & aMruListMru list.
CFSMailAddress & aToBeAddedAddress info to be added into the mru list.

AddObserver(const TFSMailMsgId, MFSMailEventObserver &)

IMPORT_C voidAddObserver(const TFSMailMsgIdaFolderId,
MFSMailEventObserver &aObserver
)

DEPRECATED

Parameters

const TFSMailMsgId aFolderId
MFSMailEventObserver & aObserverobserver

AppendMruItemL(CDesCArraySeg &, CFSMailAddress &)

voidAppendMruItemL(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 & aMruListMru list.
CFSMailAddress & aToBeAppended

CancelSearch()

IMPORT_C voidCancelSearch()

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 voidCancelSyncL()

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

ClearSearchResultCache()

IMPORT_C voidClearSearchResultCache()

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)

voidConstructL(TFSMailMsgIdaMailBoxId)[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 & aArrayToBeCopiedArray that should be copied.

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

IMPORT_C voidCopyMessagesL(const RArray< TFSMailMsgId > &aMessageIds,
RArray< TFSMailMsgId > &aCopiedMessages,
const TFSMailMsgIdaSourceFolderId,
const TFSMailMsgIdaDestinationFolderId
)

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 > & aMessageIdsids of the messages to be copied
RArray< TFSMailMsgId > & aCopiedMessagestable containing (new) ids of the copied messages owned by user
const TFSMailMsgId aSourceFolderIdsource folder id
const TFSMailMsgId aDestinationFolderIddestination folder id

CreateForwardMessage(const TFSMailMsgId, const TDesC &)

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

creates into this mailbox new draft email to be forwarded

Parameters

const TFSMailMsgId aOriginalMessageIdmessage 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 & aFileaccess 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 TFSMailMsgIdaOriginalMessageId,
const TBoolaReplyToAll,
const TDesC &aHeaderDescriptor =  KNullDesC
)

creates into this mailbox new email for reply

Parameters

const TFSMailMsgId aOriginalMessageIdid of the original message to be replied
const TBool aReplyToAllis 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 TSSMailSyncStateCurrentSyncState()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 & aInterfaceUidextension 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 & aMruListMru list that is searched through.
TDesC & searchedAddressAddress that is searched from the given mru list.
TInt & aPosReference 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 TIntGetConnectionId(TUint32 &aConnectionId)

reads connection id from plugin

Parameters

TUint32 & aConnectionIdreference to connection id

GetLastSyncStatusL()

IMPORT_C TFSProgressGetLastSyncStatusL()

Returns last synchronizing operation progress status.

GetMailBoxStatus()

IMPORT_C TFSMailBoxStatusGetMailBoxStatus()

mailbox connection status accessor

GetStandardFolderId(const TFSFolderType)

IMPORT_C TFSMailMsgIdGetStandardFolderId(const TFSFolderTypeaFolderType)

Standard folder id accessor.

Parameters

const TFSFolderType aFolderTypedefines folder type

GoOfflineL()

IMPORT_C voidGoOfflineL()

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 voidGoOnlineL()

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 TBoolHasCapability(const TFSMailBoxCapabilitiesaCapability)const

mailbox capability check for user

Parameters

const TFSMailBoxCapabilities aCapability

IsConnectionAllowedWhenRoaming(TBool &)

IMPORT_C TIntIsConnectionAllowedWhenRoaming(TBool &aConnectionAllowed)

checks from plugin if connection is allowed when roaming

Parameters

TBool & aConnectionAllowed

ListFolders(const TFSMailMsgId, RPointerArray< CFSMailFolder > &)

IMPORT_C voidListFolders(const TFSMailMsgIdaFolderId,
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 aFolderIddefines parent folder id. TFSMailId::NullId() for root level list.
RPointerArray< CFSMailFolder > & aFolderListplugin 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 voidMoveMessagesL(const RArray< TFSMailMsgId > &aMessageIds,
const TFSMailMsgIdaSourceFolderId,
const TFSMailMsgIdaDestinationFolderId
)

Moves a messages between folders.

Parameters

const RArray< TFSMailMsgId > & aMessageIdsids of the messages to be transferred
const TFSMailMsgId aSourceFolderIdsource folder id
const TFSMailMsgId aDestinationFolderIddestination folder id

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

IMPORT_C TIntMoveMessagesL(MFSMailRequestObserver &aOperationObserver,
const RArray< TFSMailMsgId > &aMessageIds,
const TFSMailMsgIdaSourceFolderId,
const TFSMailMsgIdaDestinationFolderId
)

Moves a messages between folders. Async version.

Parameters

MFSMailRequestObserver & aOperationObserver
const RArray< TFSMailMsgId > & aMessageIdsids of the messages to be transferred
const TFSMailMsgId aSourceFolderIdsource folder id
const TFSMailMsgId aDestinationFolderIddestination folder id

NewL(TFSMailMsgId)

IMPORT_C CFSMailBox *NewL(TFSMailMsgIdaMailBoxId)[static]

two based constructor

Parameters

TFSMailMsgId aMailBoxIdmailbox id in plugin containing mailbox

NewLC(TFSMailMsgId)

IMPORT_C CFSMailBox *NewLC(TFSMailMsgIdaMailBoxId)[static]

two based constructor

Parameters

TFSMailMsgId aMailBoxIdmailbox id in plugin containing mailbox

RefreshNowL(MFSMailRequestObserver &)

IMPORT_C TIntRefreshNowL(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 & aOperationObserveroptional observer given by user

RefreshNowL()

IMPORT_C TIntRefreshNowL()

ReleaseExtension(CEmailExtension *)

IMPORT_C voidReleaseExtension(CEmailExtension *aExtension)[virtual]

Parameters

CEmailExtension * aExtension

RemoveDownLoadedAttachmentsL()

IMPORT_C voidRemoveDownLoadedAttachmentsL()

removes downloaded attachments from local/terminal memory

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

IMPORT_C voidSearchL(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 > & aSearchStringstext strings that will be searched from different message fields.
const TFSMailSortCriteria & aSortCriteriasort criteria for the results
MFSMailBoxSearchObserver & aSearchObserver

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

IMPORT_C voidSearchL(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 voidSendMessageL(CFSMailMessage &aMessage)

sends email

Parameters

CFSMailMessage & aMessagemessage to be sent

SetAsMostRecentMruL(CDesCArraySeg &, TInt, CFSMailAddress &)

voidSetAsMostRecentMruL(CDesCArraySeg &aMruList,
TIntaPosition,
CFSMailAddress &aMostRecent
)const [private]

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

Parameters

CDesCArraySeg & aMruListMru list that should be edited.
TInt aPositionPosition 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 & aMostRecentAfter 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 voidSetCredentialsL(const TDesC &aUsername,
const TDesC &aPassword
)

mailbox authentication data mutator

Parameters

const TDesC & aUsernameaccount user name
const TDesC & aPasswordaccount password

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

voidUpdateMruListL(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 & aMruListMru list that should be updated.
const RPointerArray< CFSMailAddress > & aNewRecentlyUsedOnesAddresses that should be used to update the given mru list.

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

voidUpdateMrusL(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 > & aRecipientsemail recipients in TO-field
const RPointerArray< CFSMailAddress > & aCCRecipientsemail recipients in CC-field
const RPointerArray< CFSMailAddress > & aBCCRecipientsemail 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