CMnMapImageServiceBase Class Reference

class CMnMapImageServiceBase : public CMnServiceBase

Base class for MapImage service implementations ( KMnAppMapImageService ).

Provider Application must derive its MapImage service class from this one. This base implementation hides IPC communication details and provides native methods for accessing various parameters, specified by client.

Provider Application must return pointer to instance of its class, derived from this class, in response to CAknAppService::CreateServiceL() call, if given parameter is KMnAppMapImageService.

This class defines handlers of particular requests from client as pure virtual methods, which derived class must implement ( HandleRenderingL ). The parameters, which client application may specify in CMnMapImage are accessible via other methods of this class. Provider Application must obey these parameters.

See parent CMnServiceBase class documentation for other details.

Since
5.0 mnservicelib.lib
Public Member Functions
IMPORT_C void CompleteRendering ()
IMPORT_C const TMnMapImageParams & MapImageParams ()
IMPORT_C TMnMapImageParams & MapImageParams ()
void SetMapImageParams (const TMnMapImageParams &)
IMPORT_C CMnMapImage::TShowOptions ShowOptions ()
IMPORT_C CFbsBitmap & TargetBitmap ()
IMPORT_C TRect TargetRect ()
Protected Member Functions
CMnMapImageServiceBase ()
~CMnMapImageServiceBase ()
IMPORT_C void BaseConstructL ()
void HandleRenderingL ()
IMPORT_C void ServiceL (const RMessage2 &)
Private Member Functions
void HandleCancelRequestL (const RMessage2 &)
void StartAsyncRequestL (const RMessage2 &)
void UnpackBitmapHandleL (const RMessage2 &)
void UnpackImageParamsL (const RMessage2 &)
void UnpackOptionsL (const RMessage2 &)
Inherited Functions
CAknAppServiceBase::CAknAppServiceBase()
CAknAppServiceBase::CreateL()
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()
CMnServiceBase::CMnServiceBase()
CMnServiceBase::Complete(const RMessage2 &,TInt)
CMnServiceBase::CompleteRequest(TInt)
CMnServiceBase::CopyClientBuffer8LC(const RMessage2 &,const TInt)
CMnServiceBase::CopyClientBufferLC(const RMessage2 &,const TInt)
CMnServiceBase::CurrentAsyncRequest()
CMnServiceBase::DoCancel()
CMnServiceBase::IsAsyncRequestActive()
CMnServiceBase::PrepareAsyncRequestL(const RMessage2 &)
CMnServiceBase::ServiceError(const RMessage2 &,TInt)
CMnServiceBase::UnpackLandmarkLC(const RMessage2 &,TInt)
CMnServiceBase::~CMnServiceBase()
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
Private Attributes
CFbsBitmap * iBitmap
TMnMapImageParams iMapImageParams
CMnMapImage::TShowOptions iShowOptions
TPoint iTargetOrigin
Inherited Attributes
CMnServiceBase::iMessage

Constructor & Destructor Documentation

CMnMapImageServiceBase()

IMPORT_C CMnMapImageServiceBase ( ) [protected]

C++ constructor

~CMnMapImageServiceBase()

IMPORT_C ~CMnMapImageServiceBase ( ) [protected]

Destructor

Member Functions Documentation

BaseConstructL()

IMPORT_C void BaseConstructL ( ) [protected]

This method must be called from derived class' ConstructL to allow internal initialization of this class.

CompleteRendering()

IMPORT_C void CompleteRendering ( )

Must be called by client when rendering is successfully completed. (If there were an error, then CMnServiceBase::CompleteRequest() should be called instead.)

Before completion, actual type of image drawn should be set in MapImageParams() in case original value was TMnMapImageParams::ETypeUnspecified .

panic
"MnPanicServer"-KMnPanicInvalidResult if image type in MapImageParams() is TMnMapImageParams::ETypeUnspecified .
panic
"MnPanicServer"-KMnPanicAttemptToCompleteNoRequest if there is no ongoing asynchronous request.

HandleCancelRequestL(const RMessage2 &)

void HandleCancelRequestL ( const RMessage2 & aMessage ) [private]

Parameters

const RMessage2 & aMessage

HandleRenderingL()

void HandleRenderingL ( ) [protected, pure virtual]

Handles client's request for rendering map image.

Derived class must implement this method if KMnSvcFeatureRender feature is specified in SERVICE_INFO.

Implementation should draw map image to bitmap object returned by TargetBitmap() . Drawing must be done to the area of the bitmap, specified by TargetRect() .

Map image parameters are specified in object of TMnMapImageParams and can be accessed via MapImageOptions() . Center of the drawing must correspond to world point given by TMnMapImageParams::GetCentralPoint() , scale must be as specified by TMnMapImageParams::Scale() . Image must be oriented as required by TMnMapImageParams::Direction() . Image type requested is defined in TMnMapImageParams::ImageType() . Additional options defined by ShowOptions() must also be obeyed (if possible).

If any of those requirements can not be satisfied, rendering must be completed with KErrNotSupported. If any of arguments are considered generally invalid, then error code should be KErrArgument.

This is asynchronous request. Implementation should complete this request by calling CompleteRendering() if rendering ended successfully or by calling CMnServiceBase::CompleteRequest() in case of error.

This request can be canceled by client, in which case base method DoCancel() will be called.

If this function leaves then client's request is automatically completed with error.

leave
KErrNotSupported Should leave if this feature is not supported.

MapImageParams()

IMPORT_C const TMnMapImageParams & MapImageParams ( ) const

Returns drawing parameters of map image.

MapImageParams()

IMPORT_C TMnMapImageParams & MapImageParams ( )

Returns drawing parameters of map image.

ServiceL(const RMessage2 &)

IMPORT_C void ServiceL ( const RMessage2 & aMessage ) [protected, virtual]

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

Parameters

const RMessage2 & aMessage The client message

SetMapImageParams(const TMnMapImageParams &)

void SetMapImageParams ( const TMnMapImageParams & aImageParams )

Parameters

const TMnMapImageParams & aImageParams

ShowOptions()

IMPORT_C CMnMapImage::TShowOptions ShowOptions ( ) const

Returns rendering options set by client. Rendering process must obey these options. If it is not possible, it should complete rendering with KErrNotSupported.

StartAsyncRequestL(const RMessage2 &)

void StartAsyncRequestL ( const RMessage2 & aMessage ) [private]

Parameters

const RMessage2 & aMessage

TargetBitmap()

IMPORT_C CFbsBitmap & TargetBitmap ( ) const

Returns reference to target bitmap object. This is the bitmap, which the map image should be rendered to. It is guaranteed that bitmap's size in pixels is sufficient for drawing. This method should be called only during processing of rendering request, i.e. not before HandleRenderingL() or after CompleteRendering()

TargetRect()

IMPORT_C TRect TargetRect ( ) const

Returns origin and size of needed image in pixels. Size part of that rectangle is the same as specified in MapImageParams() .

UnpackBitmapHandleL(const RMessage2 &)

void UnpackBitmapHandleL ( const RMessage2 & aMessage ) [private]

Parameters

const RMessage2 & aMessage

UnpackImageParamsL(const RMessage2 &)

void UnpackImageParamsL ( const RMessage2 & aMessage ) [private]

Parameters

const RMessage2 & aMessage

UnpackOptionsL(const RMessage2 &)

void UnpackOptionsL ( const RMessage2 & aMessage ) [private]

Parameters

const RMessage2 & aMessage

Member Data Documentation

CFbsBitmap * iBitmap

CFbsBitmap * iBitmap [private]

TMnMapImageParams iMapImageParams

TMnMapImageParams iMapImageParams [private]

CMnMapImage::TShowOptions iShowOptions

CMnMapImage::TShowOptions iShowOptions [private]

TPoint iTargetOrigin

TPoint iTargetOrigin [private]