CObexSrvMtm Class Reference

class CObexSrvMtm : public CBaseServerMtm

Inherits from

Public Member Functions
~CObexSrvMtm()
IMPORT_C voidChangeL(TMsvEntry, TRequestStatus &)
IMPORT_C TBoolCommandExpected()
IMPORT_C voidCopyFromLocalL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)
IMPORT_C voidCopyToLocalL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)
IMPORT_C voidCopyWithinServiceL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)
IMPORT_C voidCreateL(TMsvEntry, TRequestStatus &)
IMPORT_C voidDeleteAllL(const CMsvEntrySelection &, TRequestStatus &)
IMPORT_C voidDeleteL(const CMsvEntrySelection &, TRequestStatus &)
IMPORT_C voidMoveFromLocalL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)
IMPORT_C voidMoveToLocalL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)
IMPORT_C voidMoveWithinServiceL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)
IMPORT_C const TDesC8 &Progress()
IMPORT_C voidSetInitialEntry(CMsvServerEntry *)
Protected Member Functions
CObexSrvMtm(CRegisteredMtmDll &, CMsvServerEntry *)
IMPORT_C voidConstructL()
IMPORT_C voidDoCancel()
IMPORT_C voidDoComplete(TInt)
IMPORT_C voidDoRunL()
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
enumTObexMtmOperations { 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_CCObexSrvMtm(CRegisteredMtmDll &aRegisteredMtmDll,
CMsvServerEntry *aEntry
)[protected]

Constructor

Parameters

CRegisteredMtmDll & aRegisteredMtmDll
CMsvServerEntry * aEntryMessage Server entry to operate upon

~CObexSrvMtm()

IMPORT_C~CObexSrvMtm()

Destructor: Cancels active object (this)s

Member Functions Documentation

ChangeL(TMsvEntry, TRequestStatus &)

IMPORT_C voidChangeL(TMsvEntryaNewEntry,
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 aNewEntryData by which to update entry
TRequestStatus & aStatusAsynchronous completion word for the operation.

CommandExpected()

IMPORT_C TBoolCommandExpected()[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 voidConstructL()[protected]

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

CopyFromLocalL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)

IMPORT_C voidCopyFromLocalL(const CMsvEntrySelection &aSelection,
TMsvIdaDestination,
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 & aSelectionThe collection of message index entries for which the copy is required
TMsvId aDestination
TRequestStatus & aStatusIndicates operation completion

CopyToLocalL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)

IMPORT_C voidCopyToLocalL(const CMsvEntrySelection &aSelection,
TMsvIdaDestination,
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 & aSelectionThe collection of message index entries for which the copy/moving is required.
TMsvId aDestinationThe entry ID to which the selection is to be copied
TRequestStatus & aStatusAsynchronous completion word for the operation

CopyWithinServiceL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)

IMPORT_C voidCopyWithinServiceL(const CMsvEntrySelection &aSelection,
TMsvIdaDestination,
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 & aSelectionThe collection of message index entries for which the copy is required
TMsvId aDestinationThe server entry ID to which the selection is to be copied
TRequestStatus & aStatusAsynchronous completion word for the operation

CreateL(TMsvEntry, TRequestStatus &)

IMPORT_C voidCreateL(TMsvEntryaNewEntry,
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 aNewEntryData by which to create entry
TRequestStatus & aStatusAsynchronous completion word for the operation.

DeleteAllL(const CMsvEntrySelection &, TRequestStatus &)

IMPORT_C voidDeleteAllL(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 & aSelectionThe collection of entries that are to be deleted.
TRequestStatus & aStatusAsynchronous completion object.

DeleteL(const CMsvEntrySelection &, TRequestStatus &)

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

Parameters

const CMsvEntrySelection & aSelection
TRequestStatus & aStatus

DoCancel()

IMPORT_C voidDoCancel()[protected, virtual]

Cancels the obex send operation

DoComplete(TInt)

IMPORT_C voidDoComplete(TIntaError)[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 aErrorThe leave code given by DoRunL().

DoRunL()

IMPORT_C voidDoRunL()[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 voidMoveFromLocalL(const CMsvEntrySelection &aSelection,
TMsvIdaDestination,
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 & aSelectionThe collection of message index entries for which the move is required
TMsvId aDestinationThe entry ID of the service by which the entries should be transferred
TRequestStatus & aStatusAsynchronous completion word for the operation

MoveToLocalL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)

IMPORT_C voidMoveToLocalL(const CMsvEntrySelection &aSelection,
TMsvIdaDestination,
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 & aSelectionThe collection of message index entries for which the moving is required.
TMsvId aDestinationThe entry ID to which the selection is to be copied/moved
TRequestStatus & aStatusAsynchronous completion word for the operation

MoveWithinServiceL(const CMsvEntrySelection &, TMsvId, TRequestStatus &)

IMPORT_C voidMoveWithinServiceL(const CMsvEntrySelection &aSelection,
TMsvIdaDestination,
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 & aSelectionThe collection of message index entries for which the move is required
TMsvId aDestinationThe server entry ID to which the selection is to be moved
TRequestStatus & aStatusAsynchronous 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 voidSetInitialEntry(CMsvServerEntry *aEntry)

Sets message entry to be sent to aEntry

Parameters

CMsvServerEntry * aEntrymessage 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]