CWsGraphicDrawer Class Reference

class CWsGraphicDrawer : public CBase

A window-server-side peer to a CWsGraphic

Inherits from

Public Member Functions
~CWsGraphicDrawer ()
void ConstructL ( MWsGraphicDrawerEnvironment &, const TGraphicDrawerId &, MWsClient &, const TDesC8 &)
IMPORT_C TBool Contains (const TArray < TGraphicDrawerId > &)
IMPORT_C void Draw ( MWsGc &, const TRect &, const TDesC8 &)
IMPORT_C void HandleEvent (const TWservCrEvent &)
void HandleMessage (const TDesC8 &)
IMPORT_C TBool HasEventHandler ()
IMPORT_C const TGraphicDrawerId & Id ()
IMPORT_C TBool IsSharedWith ( TSecureId )
IMPORT_C const MWsClient & Owner ()
IMPORT_C void SetEventHandler ( MWsEventHandler *)
IMPORT_C TInt Share ( TSecureId )
IMPORT_C TInt ShareGlobally ()
IMPORT_C TInt UnShare ( TSecureId )
IMPORT_C TInt UnShareGlobally ()
Protected Member Functions
CWsGraphicDrawer ()
IMPORT_C void BaseConstructL ( MWsGraphicDrawerEnvironment &, const TGraphicDrawerId &, MWsClient &)
IMPORT_C MWsGraphicDrawerEnvironment & Env ()
IMPORT_C const MWsGraphicDrawerEnvironment & Env ()
IMPORT_C void Invalidate ()
IMPORT_C TInt SendMessage (const TDesC8 &)
IMPORT_C TInt SendMessage ( CWsMessageData &)
Private Member Functions
void DoDraw ( MWsGc &, const TRect &, const TDesC8 &)
IMPORT_C TBool HasAsChild (const TArray < TGraphicDrawerId > &)
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()
Private Attributes
TUid iDtor_ID_Key
CPimpl * iPimpl
TInt iWsGraphicDrawerSpare

Constructor & Destructor Documentation

CWsGraphicDrawer()

IMPORT_C CWsGraphicDrawer ( ) [protected]

Constructor

~CWsGraphicDrawer()

IMPORT_C ~CWsGraphicDrawer ( )

Destructor

Member Functions Documentation

BaseConstructL(MWsGraphicDrawerEnvironment &, const TGraphicDrawerId &, MWsClient &)

IMPORT_C void BaseConstructL ( MWsGraphicDrawerEnvironment & aEnv,
const TGraphicDrawerId & aId,
MWsClient & aOwner
) [protected]

Completes construction of the baseclass. Derived drawers should call this from their ConstructL() implementations

Parameters

MWsGraphicDrawerEnvironment & aEnv the environment this drawer exists in
const TGraphicDrawerId & aId the ID of this drawer
MWsClient & aOwner the client session that owns this drawer

ConstructL(MWsGraphicDrawerEnvironment &, const TGraphicDrawerId &, MWsClient &, const TDesC8 &)

void ConstructL ( MWsGraphicDrawerEnvironment & aEnv,
const TGraphicDrawerId & aId,
MWsClient & aOwner,
const TDesC8 & aData
) [pure virtual]

This function should be overriden by all derived classes. The first call the implementation of this function should make is to BaseConstructL() .

Parameters

MWsGraphicDrawerEnvironment & aEnv the environment this drawer exists in
const TGraphicDrawerId & aId the ID of this drawer
MWsClient & aOwner the client session that owns this drawer
const TDesC8 & aData arbitrary data for constructing this instance, sent from the client.

Contains(const TArray< TGraphicDrawerId > &)

IMPORT_C TBool Contains ( const TArray < TGraphicDrawerId > & aIds ) const

Tests whether this drawer is, or itself draws, any of the graphic drawers identified by the IDs. Calls HasAsChild() on itself to determine if this graphic does itself contain any of the IDs. Derived classes which themselves draw other graphic drawers should override HasAsChild() .

Parameters

const TArray < TGraphicDrawerId > & aIds the (sorted in TGraphicDrawerId::Compare order) list of IDs

DoDraw(MWsGc &, const TRect &, const TDesC8 &)

void DoDraw ( MWsGc & aGc,
const TRect & aRect,
const TDesC8 & aData
) const [private, pure virtual]

Parameters

MWsGc & aGc
const TRect & aRect
const TDesC8 & aData

Draw(MWsGc &, const TRect &, const TDesC8 &)

IMPORT_C void Draw ( MWsGc & aGc,
const TRect & aRect,
const TDesC8 & aData
) const

Parameters

MWsGc & aGc
const TRect & aRect
const TDesC8 & aData

Env()

IMPORT_C MWsGraphicDrawerEnvironment & Env ( ) [protected]

The environment this drawer exists in

Env()

IMPORT_C const MWsGraphicDrawerEnvironment & Env ( ) const [protected]

The environment this drawer exists in

HandleEvent(const TWservCrEvent &)

IMPORT_C void HandleEvent ( const TWservCrEvent & aEvent )

Parameters

const TWservCrEvent & aEvent

HandleMessage(const TDesC8 &)

void HandleMessage ( const TDesC8 & aData ) [pure virtual]

Parameters

const TDesC8 & aData

HasAsChild(const TArray< TGraphicDrawerId > &)

IMPORT_C TBool HasAsChild ( const TArray < TGraphicDrawerId > & aIds ) const [private, virtual]

Called by Contains() to determine if the graphic identified by Id is contained within the other graphic drawers that this graphic drawer itself draws. Derived classes which draw other drawers should override this method and call Contains() on all graphics which they draw.

Parameters

const TArray < TGraphicDrawerId > & aIds a (sorted in TGraphicDrawerId::Compare order) list of the drawer IDs to see if this drawer draws

HasEventHandler()

IMPORT_C TBool HasEventHandler ( ) const

Id()

IMPORT_C const TGraphicDrawerId & Id ( ) const

The ID of this graphic

Invalidate()

IMPORT_C void Invalidate ( ) [protected]

Schedules all potentially affected parts of the screen to repaint Called by derived classes when their presentation changes (e.g. they receive new artwork via a SendMessage() ) Note: this is not a suitable method for animating a graphic. For animation, use MWsGc::Invalidate when the graphic is being drawn to schedule the next animation frame instead.

IsSharedWith(TSecureId)

IMPORT_C TBool IsSharedWith ( TSecureId aClientId ) const

tests whether the client is allowed to draw this graphic Conditions include whether the client is the owner of this graphic, whether the graphic is shared globally, or whether this graphic has been explicitly shared with the client

Parameters

TSecureId aClientId the Secure ID of the client session's process

Owner()

IMPORT_C const MWsClient & Owner ( ) const

Only the owner can delete, replace or send messages to this graphic. The owner and any session sharing the owner's Secure ID can always draw the graphic.

SendMessage(const TDesC8 &)

IMPORT_C TInt SendMessage ( const TDesC8 & aData ) [protected]

Sends this message to the client-side peer

Parameters

const TDesC8 & aData the data to send

SendMessage(CWsMessageData &)

IMPORT_C TInt SendMessage ( CWsMessageData & aData ) [protected]

Sends this message to the client-side peer

Parameters

CWsMessageData & aData the data to send

SetEventHandler(MWsEventHandler *)

IMPORT_C void SetEventHandler ( MWsEventHandler * aHandler )

Parameters

MWsEventHandler * aHandler

Share(TSecureId)

IMPORT_C TInt Share ( TSecureId aClientId )

Explicitly shares this graphic with client sessions with the specified Secure ID

Parameters

TSecureId aClientId the Secure ID of the client sessions to share with

ShareGlobally()

IMPORT_C TInt ShareGlobally ( )

Share this drawer with all client sessions Sharing globally trumps explicit shares

UnShare(TSecureId)

IMPORT_C TInt UnShare ( TSecureId aClientId )

Stop this drawer from being shared with all client sessions with the specific Secure ID ShareGlobally() trumps explicit sharing

Parameters

TSecureId aClientId the Secure ID of the client sessions to not share with

UnShareGlobally()

IMPORT_C TInt UnShareGlobally ( )

Stop this drawer from being shared with all client sessions A drawer that isn't shared explicitly is only available to clients it has been explicitly shared with using Share()

Member Data Documentation

TUid iDtor_ID_Key

TUid iDtor_ID_Key [private]

CPimpl * iPimpl

CPimpl * iPimpl [private]

TInt iWsGraphicDrawerSpare

TInt iWsGraphicDrawerSpare [private]