Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <cchfcontenthandler.h>
Link against: chf.lib
This item is not part of the S60 5th Edition SDK

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:

Inherited from CBase:


Construction and destruction


~CCHFContentHandler()

IMPORT_C ~CCHFContentHandler();

Description

Destructor.


CCHFContentHandler(const TCHFContentHandlerParams &)

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(const TCHFMessage &,TCHFValue &)

IMPORT_C virtual 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(const TCHFMessage &)

IMPORT_C virtual 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(const RAbstractEventArray &,const TKeyEvent &,const TEventCode &)

IMPORT_C virtual 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(const RAbstractEventArray &,const TPointerEvent &)

IMPORT_C virtual 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(CGraphicsContext &,const TRect &,TPoint)const

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(const TRect &)

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(CCHFDataSupplier *)

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()const

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()const

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()const

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: IMPORT_C virtual void CCHFContentHandler_Reserved_1();

Description


CCHFContentHandler_Reserved_2()

private: IMPORT_C virtual void CCHFContentHandler_Reserved_2();

Description


CCHFContentHandler_Reserved_3()

private: IMPORT_C virtual void CCHFContentHandler_Reserved_3();

Description


CCHFContentHandler_Reserved_4()

private: IMPORT_C virtual void CCHFContentHandler_Reserved_4();

Description

[Top]


Member data


iRenderingWindow

protected: TRect iRenderingWindow;

Description

Content handler's rendering window.


iDataSupplier

protected: CCHFDataSupplier * iDataSupplier;

Description