Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: cchfcontenthandler.h
Link against: chf.lib

This item is not part of the S60 3rd Edition SDK for Symbian OS, Feature Pack 2.

Class CCHFContentHandler

class CCHFContentHandler : public CBase;

Description

Content Handler base class.

The interface for content handlers. It supplies default functions for some functions which should be overriden in derived classes.

Derivation

Members

Defined in CCHFContentHandler:
BaseConstructL(), CCHFContentHandler(), CCHFContentHandler_Reserved_1(), CCHFContentHandler_Reserved_2(), CCHFContentHandler_Reserved_3(), CCHFContentHandler_Reserved_4(), CommandL(), DataSupplier(), Draw(), GetDataSupplierObserver(), HandleAbstractKeyEventL(), HandleAbstractPointerEventL(), Parent(), Query(), Resize(), Session(), StartL(), iDataSupplier, iRenderingWindow, ~CCHFContentHandler()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


~CCHFContentHandler()

IMPORT_C ~CCHFContentHandler();

Description

Destructor.


CCHFContentHandler()

protected: IMPORT_C CCHFContentHandler(const TCHFContentHandlerParams &aParams);

Description

Constructor.

Parameters

const TCHFContentHandlerParams &aParams

The initialisation parameter block for the content handler

[Top]


Member functions


Query()

virtual IMPORT_C TInt Query(const TCHFMessage &aQuery, TCHFValue &aResponse);

Description

Query a content handler.

This function should be overriden by derived classes. It should deal with any queries with the KCHFQueryUid category.

Parameters

const TCHFMessage &aQuery

A message containing the query.

TCHFValue &aResponse

An out parameter used to return the response. The type of the TCHFValue depends on the query. Trying to set a value of the wrong type will cause a panic.

Return value

TInt


CommandL()

virtual IMPORT_C void CommandL(const TCHFMessage &aMessage);

Description

Issue a command to a content handler.

This function should be overridden by derived classes. It should deal with any commands with the KCHFCommandUid category. Any command categories in aMessage that are not handled should be silently failed.

Parameters

const TCHFMessage &aMessage

A message containing the command to carry out

Leave codes

Any

Classes that derive from CCHFContentHandler should only leave if they are trying to carry out a command and that fails. It should not leave if the command is unknown.


HandleAbstractKeyEventL()

virtual IMPORT_C TKeyResponse HandleAbstractKeyEventL(const RAbstractEventArray &aEvents, const TKeyEvent &aKeyEvent, const TEventCode &aType);

Description

Issue a key stroke event to the content handler.

The function should be overridden by derived classes. It should deal with any mapped CHF abstract events that the key stroke is mapped to or deal with the raw event. Content handlers are expected to try and handle the CHF standard abstract event mappings.

Parameters

const RAbstractEventArray &aEvents

A list of priority ordered CHF abstract events that the key stroke events maps to. If no abstract events in the list can be handled by the content handler, the last abstract event in the list will be ERawKey (unless overridden by the application).

const TKeyEvent &aKeyEvent

The raw key event issued

const TEventCode &aType

The type of raw key event issued

Return value

TKeyResponse

Standard key response value indicating whether the key event was consumed or not

Leave codes

Any

Symbian OS or CHF standard error code


HandleAbstractPointerEventL()

virtual IMPORT_C TBool HandleAbstractPointerEventL(const RAbstractEventArray &aEvents, const TPointerEvent &aPointerEvent);

Description

Issue a pointer event to the content handler.

The function should be overridden by derived classes. It should deal with any mapped CHF abstract events that the pointer event is mapped to or deal with the raw event. Content handlers are expected to try and handle the CHF standard abstract event mappings.

Parameters

const RAbstractEventArray &aEvents

A list of priority ordered CHF abstract events that the key stroke events maps to. If no abstract events in the list can be handled by the content handler, the last abstract event in the list will be ERawPointer (unless overridden by the application).

const TPointerEvent &aPointerEvent

The raw pointer event issued

Return value

TBool

Boolean value indicating whether the event was consumed or not

Leave codes

Any

Symbian OS or CHF standard error code


StartL()

virtual void StartL()=0;

Description

Called to start the content handler after construction.

Until StartL is called, the content handler should not process any data and will not be able to display.

Leave codes

Any

An error code from a derived content handler indicating that the Content Handler cannot process its data or display.


Draw()

virtual void Draw(CGraphicsContext &aGc, const TRect &aClippingRect, TPoint aOffset) const=0;

Description

Draw to a graphics context.

Parameters

CGraphicsContext &aGc

The graphics context to draw to.

const TRect &aClippingRect

The clipping rectangle that contains the section of the content handler that can be drawn. Content handlers must only draw the part of themselves that falls inside the clipping rectangle. This should be relative to their own dimensions. E.g. a top left of 0,0 is the origin of this content handler.

TPoint aOffset

An offset to the origin of the graphics context


Resize()

virtual void Resize(const TRect &aNewRenderingWindow)=0;

Description

Resize the Content Handler.

Parameters

const TRect &aNewRenderingWindow

The new size of the content handler's rendering window


BaseConstructL()

protected: IMPORT_C void BaseConstructL(CCHFDataSupplier *aDataSupplier);

Description

Completes the construction of a content handler.

This function should be called just before returning a new content handler to finish the initialisation. It is this function that gives ownership of the supplied data supplier to the content handler. No leaving functions should be called after this function.

Parameters

CCHFDataSupplier *aDataSupplier

The data supplier that the client provided in the initialisation parameters.


Parent()

protected: IMPORT_C MCHFParent &Parent() const;

Description

Gets the parent of the content handler. This is set on construction.

Return value

MCHFParent &

Parent of the content handler.


DataSupplier()

protected: IMPORT_C CCHFDataSupplier &DataSupplier() const;

Description

Gets the data supplier of the content handler. This is set on construction.

Return value

CCHFDataSupplier &

Data supplier


Session()

protected: IMPORT_C CCHFSession &Session() const;

Description

Gets the CHF session to which to the content handler belongs. This is set on construction.

Return value

CCHFSession &

CHF session


GetDataSupplierObserver()

protected: virtual MCHFDataSupplierObserver &GetDataSupplierObserver()=0;

Description

Gets the observer that the content handler wishes to use for its data supplier observer.

It's likely that this will actually be the content handler itself in most cases.

Return value

MCHFDataSupplierObserver &

Content handler's data supplier observer


CCHFContentHandler_Reserved_1()

private: virtual IMPORT_C void CCHFContentHandler_Reserved_1();

Description


CCHFContentHandler_Reserved_2()

private: virtual IMPORT_C void CCHFContentHandler_Reserved_2();

Description


CCHFContentHandler_Reserved_3()

private: virtual IMPORT_C void CCHFContentHandler_Reserved_3();

Description


CCHFContentHandler_Reserved_4()

private: virtual IMPORT_C void CCHFContentHandler_Reserved_4();

Description

[Top]


Member data


iRenderingWindow

protected: TRect iRenderingWindow;

Description

Content handler's rendering window.


iDataSupplier

protected: CCHFDataSupplier * iDataSupplier;

Description