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.
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 Enumerations | |
---|---|
CSession2:TPanicNo |
Private Attributes | |
---|---|
CFbsBitmap * | iBitmap |
TMnMapImageParams | iMapImageParams |
CMnMapImage::TShowOptions | iShowOptions |
TPoint | iTargetOrigin |
Inherited Attributes | |
---|---|
CMnServiceBase::iMessage |
IMPORT_C void | BaseConstructL | ( | ) | [protected] |
This method must be called from derived class' ConstructL to allow internal initialization of this class.
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 .
void | HandleCancelRequestL | ( | const RMessage2 & | aMessage | ) | [private] |
const RMessage2 & aMessage |
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.
IMPORT_C const TMnMapImageParams & | MapImageParams | ( | ) | const |
Returns drawing parameters of map image.
IMPORT_C TMnMapImageParams & | MapImageParams | ( | ) |
Returns drawing parameters of map image.
IMPORT_C void | ServiceL | ( | const RMessage2 & | aMessage | ) | [protected, virtual] |
Override of CSession2::ServiceL() . If further overridden, this function must be base-called.
const RMessage2 & aMessage | The client message |
void | SetMapImageParams | ( | const TMnMapImageParams & | aImageParams | ) |
const TMnMapImageParams & aImageParams |
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.
void | StartAsyncRequestL | ( | const RMessage2 & | aMessage | ) | [private] |
const RMessage2 & aMessage |
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()
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() .
void | UnpackBitmapHandleL | ( | const RMessage2 & | aMessage | ) | [private] |
const RMessage2 & aMessage |
void | UnpackImageParamsL | ( | const RMessage2 & | aMessage | ) | [private] |
const RMessage2 & aMessage |
void | UnpackOptionsL | ( | const RMessage2 & | aMessage | ) | [private] |
const RMessage2 & aMessage |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.