CPhCltMessenger Class Reference

class CPhCltMessenger : public CBase

Messenger interface: provides two-way communication between two or more clients. Meant for Phone and Video Telephony application information transfer.

PhoneClient.lib
Since
3.2

Inherits from

Constructor & Destructor Documentation

CPhCltMessenger()

CPhCltMessenger ( ) [protected]

C++ constructor.

Member Functions Documentation

CancelRequest(const TPhCltMessengerRequest &)

IMPORT_C void CancelRequest ( const TPhCltMessengerRequest & aRequest ) [pure virtual]

Cancel request. This method should only be called in destruction to make sure that messages are not missed.

Parameters

const TPhCltMessengerRequest & aRequest request to be canceled.

NewL(const TUid &, const TInt &)

IMPORT_C CPhCltMessenger * NewL ( const TUid & aCategoryUid,
const TInt & aDefaultMessageSize
) [static]

Two-phased constructor.

Parameters

const TUid & aCategoryUid Category of messages to be sent or received. Note that there can be many kinds of message uids below one category uid.
const TInt & aDefaultMessageSize The default size of the messages to be sent or received in bytes. Can be bigger than KPhCltDefMesSize, but then functionality is not guaranteed.

Receive(TRequestStatus &, TInt &, TDes8 &)

IMPORT_C void Receive ( TRequestStatus & aStatus,
TInt & aMessageSize,
TDes8 & aMessagePayload
) [pure virtual]

Receives next message. No memory is allocated during the operation of this method.

Parameters

TRequestStatus & aStatus This request will be completed once message has been received.
TInt & aMessageSize Tells the size of the received message. If bigger than the size of the aMessagePayload, then only the beginning of the received message is copied to aMessagePayload. This means that either Receive must be called with bigger buffer to receive full message or Skip must be called to indicate that the full message is not needed.
TDes8 & aMessagePayload Storage to the message to be received. The format of the message is determined by the category Uid used in Open method.

Send(TRequestStatus &, const TDesC8 &)

IMPORT_C void Send ( TRequestStatus & aStatus,
const TDesC8 & aMessagePayload
) [pure virtual]

Sends message. This is completed only after message has been delivered to all receivers of the same category. No memory is allocated during the operation of this method.

Parameters

TRequestStatus & aStatus This request will be completed once message has been sent.
const TDesC8 & aMessagePayload The sent message.The format of the message is determined by the category Uid used in Open method.

Skip()

void Skip ( ) [pure virtual]

Skip one (i.e. next) message. This method should be called only if Receive completion indicates that there is not enough space in aMessagePayload. Of course, you should attempt to recover, i.e. try to call Receive with big enough aMessagePayload buffer before calling this method.