CObexSrvMtm Class Reference

class CObexSrvMtm : public CBaseServerMtm

Inherits from

Public Member Functions
~CObexSrvMtm ()
IMPORT_C void ChangeL ( TMsvEntry , TRequestStatus &)
IMPORT_C TBool CommandExpected ()
IMPORT_C void CopyFromLocalL (const CMsvEntrySelection &, TMsvId , TRequestStatus &)
IMPORT_C void CopyToLocalL (const CMsvEntrySelection &, TMsvId , TRequestStatus &)
IMPORT_C void CopyWithinServiceL (const CMsvEntrySelection &, TMsvId , TRequestStatus &)
IMPORT_C void CreateL ( TMsvEntry , TRequestStatus &)
IMPORT_C void DeleteAllL (const CMsvEntrySelection &, TRequestStatus &)
IMPORT_C void DeleteL (const CMsvEntrySelection &, TRequestStatus &)
IMPORT_C void MoveFromLocalL (const CMsvEntrySelection &, TMsvId , TRequestStatus &)
IMPORT_C void MoveToLocalL (const CMsvEntrySelection &, TMsvId , TRequestStatus &)
IMPORT_C void MoveWithinServiceL (const CMsvEntrySelection &, TMsvId , TRequestStatus &)
IMPORT_C const TDesC8 & Progress ()
IMPORT_C void SetInitialEntry ( CMsvServerEntry *)
Protected Member Functions
CObexSrvMtm ( CRegisteredMtmDll &, CMsvServerEntry *)
IMPORT_C void ConstructL ()
IMPORT_C void DoCancel ()
IMPORT_C void DoComplete ( TInt )
IMPORT_C void DoRunL ()
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
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()
CBaseServerMtm::CBaseServerMtm(CRegisteredMtmDll &,CMsvServerEntry *)
CBaseServerMtm::Extension_(TUint,TAny *&,TAny *)
CBaseServerMtm::GetInterface(TUid)
CBaseServerMtm::GetNonOperationMtmData(TNonOperationMtmDataType &,TPtrC8 &)
CBaseServerMtm::StartCommandL(CMsvEntrySelection &,TInt,const TDesC8 &,TRequestStatus &)
CBaseServerMtm::SystemProgress(TMsvSystemProgress &)
CBaseServerMtm::~CBaseServerMtm()
Public Member Enumerations
enum TObexMtmOperations { EObexMtmUiNullOp , EObexMtmUiObexSend }
Inherited Enumerations
CActive:TPriority
Protected Attributes
CMsvServerEntry * iEntry
TRequestStatus * iReportStatus
CObexServerSendOperation * iSendOperation
Private Attributes
TPckgBuf < TObexMtmProgress > iProgress
Inherited Attributes
CActive::iStatus
CBaseServerMtm::iServerEntry

Constructor & Destructor Documentation

CObexSrvMtm(CRegisteredMtmDll &, CMsvServerEntry *)

IMPORT_C CObexSrvMtm ( CRegisteredMtmDll & aRegisteredMtmDll,
CMsvServerEntry * aEntry
) [protected]

Constructor

Parameters

CRegisteredMtmDll & aRegisteredMtmDll
CMsvServerEntry * aEntry Message Server entry to operate upon

~CObexSrvMtm()

IMPORT_C ~CObexSrvMtm ( )

Destructor: Cancels active object (this)s

Member Functions Documentation

ChangeL(TMsvEntry, TRequestStatus &)

IMPORT_C void ChangeL ( TMsvEntry aNewEntry,
TRequestStatus & aStatus
) [virtual]

Updates a remote entry with relevant data when called by the Message Server.

Implementations should provide this function if the messaging protocol supports updating of remote entries. If this is not supported, implementations should leave with KErrNotSupported.

The Server-side MTM implementation must decide what information in the TMsvEntry is relevant to the remote entry, and translate it appropriately for the specific protocol. Most of the data contained in the TMsvEntry is specific to the Symbian OS Message Server, and would probably have no direct correlation with the protocol's own storage format. Some entry data may however be useful. For example, if the protocol supports remote renaming of folders, the implementation could:

1. check for a folder type entry

2. extract the folder name from aNewEntry.iDetails

3. check if the folder name has changed by comparing the new name with iDetails in the index entry currently; if not, complete with KErrNone

4. initiate a protocol-specific action to rename the remote folder

The implementation should also always update the local Message Server index through CMsvServerEntry::ChangeL().

leave
KErrNotSupported The Server-side MTM does not support this operation
leave
Other leave codes Dependent on implementation

Parameters

TMsvEntry aNewEntry Data by which to update entry
TRequestStatus & aStatus Asynchronous completion word for the operation.

CommandExpected()

IMPORT_C TBool CommandExpected ( ) [virtual]

Tests if the Server-side MTM object should be deleted when called by the Message Server

It is useful to stop the MTM being deleted when more commands are expected shortly. This would be the case, for example, after receiving a command to go online.

If there are no more commands expected by the Server-side MTM object, then the function should return EFalse, and the Message Server will delete it.

ConstructL()

IMPORT_C void ConstructL ( ) [protected]

Second phase constructor adds Obex server Mtm (this) to the active scheduler

CopyFromLocalL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)

IMPORT_C void CopyFromLocalL ( const CMsvEntrySelection & aSelection,
TMsvId aDestination,
TRequestStatus & aStatus
) [virtual]

Copies a selection of entries from a local location to a remote location N.B. Leaves as not supported

Parameters

const CMsvEntrySelection & aSelection The collection of message index entries for which the copy is required
TMsvId aDestination
TRequestStatus & aStatus Indicates operation completion

CopyToLocalL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)

IMPORT_C void CopyToLocalL ( const CMsvEntrySelection & aSelection,
TMsvId aDestination,
TRequestStatus & aStatus
) [virtual]

Copies a selection of entries from a remote location to a local location. This will only be meaningful for some protocols.

Requirements:

Implementations should provide this function if the messaging protocol supports retrieval of remote entries. If this is not supported, implementations should leave with KErrNotSupported.

Implementations of this function have three fundamental steps:

1. doing the transfer operation using the appropriate communications protocols

2. converting protocol-specific data into the three-part storage format (index entry, message store, binary files) required by the Message Server

3. updating entries in the Message Server

leave
KErrNotSupported The Server-side MTM does not support this operation
leave
Other leave codes Dependent on implementation

Parameters

const CMsvEntrySelection & aSelection The collection of message index entries for which the copy/moving is required.
TMsvId aDestination The entry ID to which the selection is to be copied
TRequestStatus & aStatus Asynchronous completion word for the operation

CopyWithinServiceL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)

IMPORT_C void CopyWithinServiceL ( const CMsvEntrySelection & aSelection,
TMsvId aDestination,
TRequestStatus & aStatus
) [virtual]

Copies a selection of entries within a remote location.

Requirements:

Implementations should provide this function if the messaging protocol supports the ability to copy entries within a remote service. If this is not supported, implementations should leave with KErrNotSupported.

leave
KErrNotSupported The Server-side MTM does not support this operation
leave
Other leave codes Dependent on implementation

Parameters

const CMsvEntrySelection & aSelection The collection of message index entries for which the copy is required
TMsvId aDestination The server entry ID to which the selection is to be copied
TRequestStatus & aStatus Asynchronous completion word for the operation

CreateL(TMsvEntry, TRequestStatus &)

IMPORT_C void CreateL ( TMsvEntry aNewEntry,
TRequestStatus & aStatus
) [virtual]

Creates a new remote entry with relevant data when called by the Message Server.

Implementations should provide this function if the messaging protocol supports creation of remote entries. If this is not supported, implementations should leave with KErrNotSupported.

As with ChangeL() , the Server-side MTM implementation must decide what information in the TMsvEntry is relevant to the remote entry, and translate it appropriately for the specific protocol. Most of the data contained in the TMsvEntry is specific to the Message Server, and would probably have no direct correlation with the protocol's own storage format. For example, for a folder, probably only the name and parent are needed, so if the protocol supports creation of remote folders, the implementation could:

1. check for a folder type entry

2. get the folder name and parent details from aNewEntry

3. initiate a protocol-specific action to create the remote folder

leave
KErrNotSupported The Server-side MTM does not support this operation
leave
Other leave codes Dependent on implementation

Parameters

TMsvEntry aNewEntry Data by which to create entry
TRequestStatus & aStatus Asynchronous completion word for the operation.

DeleteAllL(const CMsvEntrySelection &, TRequestStatus &)

IMPORT_C void DeleteAllL ( const CMsvEntrySelection & aSelection,
TRequestStatus & aStatus
) [virtual]

Deletes each entry in the supplied selection when called by the message Server. If any of the entries in the selection is a parent entry, then all its children should also be deleted, recursively to the bottom of the ownership tree.

Implementations should provide this function if the messaging protocol supports deletion of remote entries. If this is not supported, implementations should leave with KErrNotSupported.

leave
KErrNotSupported The Server-side MTM does not support this operation
leave
Other leave codes Dependent on implementation

Parameters

const CMsvEntrySelection & aSelection The collection of entries that are to be deleted.
TRequestStatus & aStatus Asynchronous completion object.

DeleteL(const CMsvEntrySelection &, TRequestStatus &)

IMPORT_C void DeleteL ( const CMsvEntrySelection & aSelection,
TRequestStatus & aStatus
)

Parameters

const CMsvEntrySelection & aSelection
TRequestStatus & aStatus

DoCancel()

IMPORT_C void DoCancel ( ) [protected, virtual]

Cancels the obex send operation

DoComplete(TInt)

IMPORT_C void DoComplete ( TInt aError ) [protected, virtual]

Called by the base class RunL() if DoRunL() leaves.

It should be implemented to handle this error. For example, progress information could be updated to reflect the problem.

Parameters

TInt aError The leave code given by DoRunL().

DoRunL()

IMPORT_C void DoRunL ( ) [protected, virtual]

Handles the completion of any asynchronous requests that it makes. It is called from the base class RunL() .

Note that any leaves made by this function result in DoComplete() being called with the leave code.

MoveFromLocalL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)

IMPORT_C void MoveFromLocalL ( const CMsvEntrySelection & aSelection,
TMsvId aDestination,
TRequestStatus & aStatus
) [virtual]

Moves a selection of entries from a local location to a remote location.

Requirements:

Implementations should provide this function if the messaging protocol supports retrieval of remote entries. If this is not supported, implementations should leave with KErrNotSupported.

Implementations of this function have three fundamental steps:

1. reading entry data

2. converting entry data from the Message Server format into that required by the protocol

3. doing the transfer operation using the appropriate communications protocols

The implementation of MoveFromLocalL() should differ from CopyFromLocalL() in additionally deleting the original local data.

leave
KErrNotSupported The Server-side MTM does not support this operation
leave
Other leave codes Dependent on implementation

Parameters

const CMsvEntrySelection & aSelection The collection of message index entries for which the move is required
TMsvId aDestination The entry ID of the service by which the entries should be transferred
TRequestStatus & aStatus Asynchronous completion word for the operation

MoveToLocalL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)

IMPORT_C void MoveToLocalL ( const CMsvEntrySelection & aSelection,
TMsvId aDestination,
TRequestStatus & aStatus
) [virtual]

Moves a selection of entries from a remote location to a local location.

Requirements:

Implementations should provide this function if the messaging protocol supports retrieval of remote entries. If this is not supported, implementations should leave with KErrNotSupported.

Implementations of this function have three fundamental steps:

1. doing the transfer operation using the appropriate communications protocols

2. converting protocol-specific data into the three-part storage format (index entry, message store, binary files) required by the Message Server

3. updating entries in the Message Server

MoveToLocalL() should differ from CopyToLocalL() in additionally deleting the original remote data.

leave
KErrNotSupported The Server-side MTM does not support this operation
leave
Other leave codes Dependent on implementation

Parameters

const CMsvEntrySelection & aSelection The collection of message index entries for which the moving is required.
TMsvId aDestination The entry ID to which the selection is to be copied/moved
TRequestStatus & aStatus Asynchronous completion word for the operation

MoveWithinServiceL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)

IMPORT_C void MoveWithinServiceL ( const CMsvEntrySelection & aSelection,
TMsvId aDestination,
TRequestStatus & aStatus
) [virtual]

Moves a selection of entries within a remote location.

Requirements:

Implementations should provide this function if the messaging protocol supports the ability to move entries within a remote service. If this is not supported, implementations should leave with KErrNotSupported.

The implementation of MoveWithinServiceL() should differ from CopyWithinServiceL() in additionally deleting the original data.

leave
KErrNotSupported The Server-side MTM does not support this operation
leave
Other leave codes Dependent on implementation

Parameters

const CMsvEntrySelection & aSelection The collection of message index entries for which the move is required
TMsvId aDestination The server entry ID to which the selection is to be moved
TRequestStatus & aStatus Asynchronous completion word for the operation

Progress()

IMPORT_C const TDesC8 & Progress ( ) [virtual]

Obtains progress from the send operation and copies it into the iProgress member

SetInitialEntry(CMsvServerEntry *)

IMPORT_C void SetInitialEntry ( CMsvServerEntry * aEntry )

Sets message entry to be sent to aEntry

Parameters

CMsvServerEntry * aEntry message server entry (service)

Member Enumerations Documentation

Enum TObexMtmOperations

Enumerators

EObexMtmUiNullOp
EObexMtmUiObexSend

Member Data Documentation

CMsvServerEntry * iEntry

CMsvServerEntry * iEntry [protected]

TPckgBuf< TObexMtmProgress > iProgress

TPckgBuf < TObexMtmProgress > iProgress [private]

TRequestStatus * iReportStatus

TRequestStatus * iReportStatus [protected]

CObexServerSendOperation * iSendOperation

CObexServerSendOperation * iSendOperation [protected]