CImageDisplayPlugin Class Reference

#include <icl/imagedisplayplugin.h>

Link against: imagedisplay.lib

class CImageDisplayPlugin : public CBase, public CBase

Inherits from

Protected Attributes
CImageDisplay::RImageSizeArray iImageSizes
Public Member Enumerations
enumTImageSourceType { EImgSrcNotDefined, EImgSrcFileName, EImgSrcFileHandle, EImgSrcDescriptor }
enumTPluginStatus { EStatusNoMoreToDecode, EStatusBusy, EStatusPaused, EStatusFrameReady, ..., EStatusEraseOutputContents }
Public Member Functions
~CImageDisplayPlugin()
Protected Member Functions
CImageDisplayPlugin()
IMPORT_C voidAsyncCallbackImageReady(const CFbsBitmap *, TUint, const TRect &, TInt)
IMPORT_C TBoolCallbackIsRunning()
IMPORT_C voidCancelCallback()
IMPORT_C const TSize &DestinationSizeInPixels()
IMPORT_C TDisplayModeDisplayMode()
virtual IMPORT_C TIntExtensionInterface(TUid, TAny *&)
virtual IMPORT_C voidGetBitmap(const CFbsBitmap *&, const CFbsBitmap *&)
virtual IMPORT_C TUintImageStatus()
IMPORT_C TBoolMaintainAspectRatio()
virtual IMPORT_C TIntNumFrames(TInt &)
pure virtual voidOpenL()
IMPORT_C TUintOptions()
pure virtual voidPause()
pure virtual voidPlay()
pure virtual const CImageDisplay::RImageSizeArray &RecommendedImageSizes()
IMPORT_C const TDesC8 &SourceData()
IMPORT_C const TDesC &SourceDataId()
IMPORT_C ContentAccess::TIntentSourceDataIntent()
IMPORT_C RFile &SourceFileHandle()
IMPORT_C const TDesC &SourceFilename()
IMPORT_C const TUidSourceImageSubType()
IMPORT_C const TUidSourceImageType()
IMPORT_C const TDesC8 &SourceMimeType()
IMPORT_C TBoolSourceRect(TRect &)
IMPORT_C TImageSourceTypeSourceType()
pure virtual voidStopPlay()
virtual IMPORT_C TBoolValidBitmap()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
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()

Detailed Description

This is the plugin API for the Image Display framework Intended for use by plugin writers only.

Member Attribute Documentation

iImageSizes

CImageDisplay::RImageSizeArray iImageSizes[protected]

An array containing the sizes of the images.

Member Enumeration Documentation

Enum TImageSourceType

Data source type definitions for plug-ins

EnumeratorValueDescription
EImgSrcNotDefined0

Undefined. Plug-in won't be given this value

EImgSrcFileName

The datasource is a file name

EImgSrcFileHandle

The datasource is a file handle

EImgSrcDescriptor

The datasource is a descriptor

Enum TPluginStatus

Defines an ImageDisplay plug-in status flag values

EnumeratorValueDescription
EStatusNoMoreToDecode0x00000001

A plug-in has nothing more to decode; also must be set also on fatal error contidition

EStatusBusy0x00000002

The next frame is not ready yet, bitmap may contain distorted image

EStatusPaused0x00000004

Image decoding is paused i.e. call Play() to continue (if EStatusNoMoreToDecode is not set)

EStatusFrameReady0x00000008

The next frame has been already decoded

EStatusDisplayThisFrameIndefinetely0x00000010

May be set after image decode completion i.e. when EStatusNoMoreToDecode is set

EStatusPartialFrame0x00000020

May be set if the image format supports progressive decoding; indicates that a bitmap contains roughtly decoded image

EStatusEraseOutputContents0x00000040

May be set in case when a plug-in asks to invalidate previous frame contents

Constructor & Destructor Documentation

CImageDisplayPlugin ( )

IMPORT_CCImageDisplayPlugin()[protected]

Exported default constructor

Constructor for the CImageDisplayPlugin class.

~CImageDisplayPlugin ( )

IMPORT_C~CImageDisplayPlugin()

Virtual destructor. Current implementation will call the REComSession::DestroyedImplementation() to finalize destruction of the ECom plugin

This is the destructor for the CImageDisplayPlugin and is responsible for deallocating all resources.

Member Function Documentation

AsyncCallbackImageReady ( const CFbsBitmap *, TUint, const TRect &, TInt )

IMPORT_C voidAsyncCallbackImageReady(const CFbsBitmap *aBitmap,
TUintaStatus,
const TRect &aUpdatedArea,
TIntaError
)[protected]

A plug-in should use this function to pass information asinchronously to an API client. This function is asinchronous. Callback to the client application, via the ImageDisplay framework

Parameters
aBitmapa pointer to the bitmap that contains decoding result
aStatusthe plugin status that should be combination of the TPluginStatus set
aUpdatedAreaa rectangle within the aBitmap that was updated during the latest operation
aErrorerror code of latest operation

CallbackIsRunning ( )

IMPORT_C TBoolCallbackIsRunning()const [protected]

A plug-in may use this function to determine if a previuos callback function to an API client has been completed

Return Value
ETrue if callback has not been completed yet

CancelCallback ( )

IMPORT_C voidCancelCallback()[protected]

A plug-in should use this function to cancel callback to a client if it is stil pending

DestinationSizeInPixels ( )

IMPORT_C const TSize &DestinationSizeInPixels()const [protected]

returns a requested by an API client destination image size Gets the requested size of the destination image

Return Value
const TSize - requested image size in pixelsThe destination image size

DisplayMode ( )

IMPORT_C TDisplayModeDisplayMode()const [protected]

returns a requested by an API client display mode for an image being decoded Return the display mode

Return Value
TDisplayMode - requested display modeDisplay mode of the image

ExtensionInterface ( TUid, TAny *& )

IMPORT_C TIntExtensionInterface(TUidaIFaceUid,
TAny *&aIFacePtr
)[protected, virtual]

A plug-in that supports an extension interface has to override this function When a plugin extension has been implemented, this function should be implemented by the plugin writer to enable the client access to the extension

Parameters
aIFaceUida request extension Uid
aIFacePtra reference to the pointer that should be given extension interface pointer on success
Return Value
KErrNotSupported if requested extension is not supported otherwise KErrNoneA pointer to a fully constructed CImageDisplayPluginExtension NULL, if there is no extension to this plugin

GetBitmap ( const CFbsBitmap *&, const CFbsBitmap *& )

IMPORT_C voidGetBitmap(const CFbsBitmap *&aBitmap,
const CFbsBitmap *&aMask
)const [protected, virtual]

A plug-in that supports image mask getting has to override this function

Parameters
aBitmapa reference to bitmap pointer
aMaska reference to bitmap pointer, a plug-in may return NULL if no mask is available

ImageStatus ( )

IMPORT_C TUintImageStatus()const [protected, virtual]

A plug-in that supports source image status checking has to override this function

Return Value
TUint - set of the TImageStatus flags

MaintainAspectRatio ( )

IMPORT_C TBoolMaintainAspectRatio()const [protected]

returns ETrue if an API client requested to preserve source image aspect ratio Return whether the client wishes to maintain the source image's aspect ratio

Return Value
TBool - requested aspect ratio flagETrue if the aspect ratio is to be maintained

NumFrames ( TInt & )

IMPORT_C TIntNumFrames(TInt &aNumFrames)const [protected, virtual]

A plug-in that supports getting of source image number of frames has to override this function

Parameters
aNumFramesNumber of frames in the source image
Return Value
TInt - KErrNone if aNumFrames contains a valid number of frames

OpenL ( )

voidOpenL()[protected, pure virtual]

Initialise the plugin and check the image display settings.

This is called by the ImageDisplay framework when the client app calls CImageDisplay::SetupL().

The plugin should check the validity of the source image and all other settings set by the client API. If any of these is unsupported then it should leave with KErrArgument

A plugin implementing CImageDisplayPluginExtension to allow extension of the client API should initialise it here.

This is a virtual function that each individual plugin must implement.

Leave Codes
KErrArgumentSome of the configuration parameters are invalid

Options ( )

IMPORT_C TUintOptions()const [protected]

returns a requested by an API client image options e.g. combination of the TImageOptions Gets the options requested by the client

Return Value
TUint - requested image option setThe options requested by the client

Pause ( )

voidPause()[protected, pure virtual]

Pause image decoding

This is a virtual function that each individual plugin must implement.

Play ( )

voidPlay()[protected, pure virtual]

Initiate the image display operation

This is a virtual function that each individual plugin must implement.

RecommendedImageSizes ( )

const CImageDisplay::RImageSizeArray &RecommendedImageSizes()const [protected, pure virtual]

Should return an array of recommended image sizes i.e. sizes which would be processed faster This is a virtual function that each individual plugin must implement.

Return Value
a reference to the array of recommended image sizes

SourceData ( )

IMPORT_C const TDesC8 &SourceData()const [protected]
returns an image source descriptor Gets the source descriptor
Return Value
const TDesC8& a reference to a 8 bit descriptor A reference to the source descriptor
Panic Codes
ImageDisplay4 EImageWrongType if image data source is of type other than the descriptor
EImageWrongTypeThe source is not a descriptor

SourceDataId ( )

IMPORT_C const TDesC &SourceDataId()const [protected]

returns requested content data Id that should be used to open content

Return Value
const TDesC& a desired data unique Id

SourceDataIntent ( )

IMPORT_C ContentAccess::TIntentSourceDataIntent()const [protected]

returns an intent that is requested by client for opening the image source

Return Value
ContentAccess::TIntent a desired intent value

SourceFileHandle ( )

IMPORT_C RFile &SourceFileHandle()const [protected]
returns an image source file handle Gets the source file name
Return Value
const RFile& a reference to a file handle The source file handle
Panic Codes
ImageDisplay4 EImageWrongType if image data source is of type other than the file handle
EImageWrongTypeThe source is not a file

SourceFilename ( )

IMPORT_C const TDesC &SourceFilename()const [protected]
returns an image source file name Gets the source file name
Return Value
const TDesC& a reference to read-only descriptor The source file name
Panic Codes
ImageDisplay4 EImageWrongType if image data source is of type other than the file name
EImageWrongTypeThe source is not a file

SourceImageSubType ( )

IMPORT_C const TUidSourceImageSubType()const [protected]

returns a global image subtype or KNullUid if not defined Gets the source image's subtype

Return Value
const TUid an image subtype UidThe UID of the source type KNullUid if not defined

SourceImageType ( )

IMPORT_C const TUidSourceImageType()const [protected]

returns a global image type Gets the source image's type

Return Value
const TUid an image type UidThe UID of the source type KNullUid if not defined

SourceMimeType ( )

IMPORT_C const TDesC8 &SourceMimeType()const [protected]

returns an image source MIME type or KNullDesC8 if not defined Gets the source image's MIME type

Return Value
const TDesC8& a reference to a 8 bit descriptorA reference to the source image's MIME type KNullDesC8 if not defined

SourceRect ( TRect & )

IMPORT_C TBoolSourceRect(TRect &aRect)const [protected]

returns a requested by an API client source clipping rect Gets the source image's clipping region

Parameters
aRectThe source image's clipping region
Return Value
ETrue if clipping rect was defined by clientETrue if a clipping region has been defined

SourceType ( )

IMPORT_C TImageSourceTypeSourceType()const [protected]

returns an image datasource type Return whether the source is data

Return Value
TImageSourceTypeTImageSourceType the source of image

StopPlay ( )

voidStopPlay()[protected, pure virtual]

Cancel the image display operation May be called by the framework even when there is no outstanding request.

This is a virtual function that each individual plugin must implement.

ValidBitmap ( )

IMPORT_C TBoolValidBitmap()const [protected, virtual]

A plug-in that supports target bitmap status checkig has to override this function

Return Value
TBool - ETrue if subsequent call to the GetBitmap() able to return valid bitmaps