CMnServiceBase Class Reference

class CMnServiceBase : public CAknAppServiceBase

Its only purpose is to provide common base functionality for Map and Navigation service classes.

There are both synchronous and asynchronous request handlers defined in derived service base classes. Implementations of handlers shall behave as follows.
  • For Synchronous requests:
    • Exit normally to report successful completion

    • Leave with error code to report error

  • For Asynchronous requests:
    • Exit normally as soon as possible. Call dedicated Complete method to report successful completion

    • Leave with error code to report error found during execution of Handle method

    • Call CompleteRequest method with error code to report error found after execution of Handle method

    • Call CancelRequest method to report that user has cancelled execution

Following error codes shall be used by implementation to report specific cases:
  • KErrCancel - If user has cancelled operation.

  • KErrArgument - If given argument cannot be used for operation. For example, landmark has no coordinate or address and cannot be shown on map or address information is not sufficient for geocoding.

  • KErrNotSupported - If service feature is not supported, or cannot be executed with given parameters. For example, map content not available for specified area etc.

Since
3.1 mnservicelib.lib
Public Member Functions
IMPORT_C void CompleteRequest ( TInt )
Protected Member Functions
CMnServiceBase ()
~CMnServiceBase ()
void BaseConstructL ()
void Complete (const RMessage2 &, TInt )
HBufC8 * CopyClientBuffer8LC (const RMessage2 &, const TInt )
HBufC * CopyClientBufferLC (const RMessage2 &, const TInt )
TInt CurrentAsyncRequest ()
void DoCancel ()
void HandleCancelRequestL (const RMessage2 &)
TBool IsAsyncRequestActive ()
void PrepareAsyncRequestL (const RMessage2 &)
IMPORT_C void ServiceError (const RMessage2 &, TInt )
CPosLandmark * UnpackLandmarkLC (const RMessage2 &, TInt )
Inherited Functions
CAknAppServiceBase::CAknAppServiceBase()
CAknAppServiceBase::CreateL()
CAknAppServiceBase::ServiceL(const RMessage2 &)
CAknAppServiceBase::~CAknAppServiceBase()
CApaAppServiceBase::CApaAppServiceBase()
CApaAppServiceBase::CountResources()
CApaAppServiceBase::Disconnect(const RMessage2 &)
CApaAppServiceBase::SecurityCheckL(const RMessage2 &,TInt &,TSecurityInfo &)
CApaAppServiceBase::SendAppServerExitNotification(TInt)
CApaAppServiceBase::~CApaAppServiceBase()
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()
CSession2::CSession2()
CSession2::Extension_(TUint,TAny *&,TAny *)
CSession2::ResourceCountMarkEnd(const RMessage2 &)
CSession2::ResourceCountMarkStart()
CSession2::Server()const
CSession2::SetServer(const CServer2 *)
CSession2::~CSession2()
Inherited Enumerations
CSession2:TPanicNo
Protected Attributes
RMessage2 iMessage
Private Attributes
TInt iCurrentRequest

Constructor & Destructor Documentation

CMnServiceBase()

CMnServiceBase ( ) [protected]

C++ constructor

~CMnServiceBase()

~CMnServiceBase ( ) [protected]

Destructor

Member Functions Documentation

BaseConstructL()

void BaseConstructL ( ) [protected]

Complete(const RMessage2 &, TInt)

void Complete ( const RMessage2 & aMsg,
TInt aResult
) [protected]

Parameters

const RMessage2 & aMsg
TInt aResult

CompleteRequest(TInt)

IMPORT_C void CompleteRequest ( TInt aResult )

Called by implementations to complete client's request. Used by service implementations to report errors during execution of asynchronous requests. To report successful completion, special methods defined by service base classes should be used (e.g. CMnMapViewServiceBase::CompleteSelectionRequest )

For synchronous requests, handler should just leave if error is detected.

panic
"MnPanicServer"-KMnPanicAttemptToCompleteNoRequest This method called during execution of synchronous request.

Parameters

TInt aResult Error code.

CopyClientBuffer8LC(const RMessage2 &, const TInt)

HBufC8 * CopyClientBuffer8LC ( const RMessage2 & aMessage,
const TInt aClientBufferParam
) [protected, static]

Parameters

const RMessage2 & aMessage
const TInt aClientBufferParam

CopyClientBufferLC(const RMessage2 &, const TInt)

HBufC * CopyClientBufferLC ( const RMessage2 & aMessage,
const TInt aClientBufferParam
) [protected, static]

Parameters

const RMessage2 & aMessage
const TInt aClientBufferParam

CurrentAsyncRequest()

TInt CurrentAsyncRequest ( ) [protected]

DoCancel()

void DoCancel ( ) [protected, pure virtual]

Called by framework to report that request was cancelled by client application. Service implementations must implement this method. It is not needed to call CompleteRequest() in this case.

HandleCancelRequestL(const RMessage2 &)

void HandleCancelRequestL ( const RMessage2 & aMsg ) [protected]

Parameters

const RMessage2 & aMsg

IsAsyncRequestActive()

TBool IsAsyncRequestActive ( ) [protected]

PrepareAsyncRequestL(const RMessage2 &)

void PrepareAsyncRequestL ( const RMessage2 & aMessage ) [protected]

Parameters

const RMessage2 & aMessage

ServiceError(const RMessage2 &, TInt)

IMPORT_C void ServiceError ( const RMessage2 & aMessage,
TInt aError
) [protected, virtual]

Override of CSession2::ServiceError() . If further overridden, this function must be base-called.

Parameters

const RMessage2 & aMessage The client message.
TInt aError The error code to which occured during message servicing

UnpackLandmarkLC(const RMessage2 &, TInt)

CPosLandmark * UnpackLandmarkLC ( const RMessage2 & aMsg,
TInt aParamIndex
) [protected]

Parameters

const RMessage2 & aMsg
TInt aParamIndex

Member Data Documentation

TInt iCurrentRequest

TInt iCurrentRequest [private]

RMessage2 iMessage

RMessage2 iMessage [protected]