Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <COECCNTX.H>
Link against: cone.lib

Class MCoeControlContext

class MCoeControlContext;

Description

Interface to allow sharing of graphics settings between controls.

The interface provides functions to set the graphics context of a control before drawing. If a control has its iContext member set, the UI Control Framework calls functions defined by this interface when a control is about to be drawn. Developers must implement MCoeControlContext::PrepareContext(CWindowGc &)const, which is called by the framework, to initialise the control's window with the required graphics settings.

To use control contexts, a control should inherit from an MCoeControlContext-derived class. To share the context between controls, this control should then be set as the context for all controls that wish to share it. This is done by setting the iContext member of each of the controls, using CCoeControl::SetControlContext(MCoeControlContext *) and CCoeControl::CopyControlContextFrom(const CCoeControl *).

Members

Defined in MCoeControlContext:


Construction and destruction


MCoeControlContext()

protected: IMPORT_C MCoeControlContext();

Description

[Top]


Member functions


ActivateContext(CWindowGc &,RDrawableWindow &)const

IMPORT_C virtual void ActivateContext(CWindowGc &aGc, RDrawableWindow &aWindow) const;

Description

Activates a graphics context for the specified window.

This function is called whenever a control is about to be drawn. Its default implementation activates the graphics context given by aGc for the window given by aWindow, and calls MCoeControlContext::PrepareContext(CWindowGc &)const.

This function may be overridden by derived classes.

Parameters

CWindowGc &aGc

The graphics context to activate. When called from CCoeControl::ActivateGc()const, this is the system graphics context.

RDrawableWindow &aWindow

The window for which the graphics context is to be activated.


ResetContext(CWindowGc &)const

IMPORT_C virtual void ResetContext(CWindowGc &aGc) const;

Description

Resets the control context.

The default implementation first resets the graphics context given by aGc, and then calls MCoeControlContext::PrepareContext(CWindowGc &)const. The function may be overridden by derived classes.

Parameters

CWindowGc &aGc

The graphics context to be reset.


PrepareContext(CWindowGc &)const

IMPORT_C virtual void PrepareContext(CWindowGc &aGc) const;

Description

Initialises graphics context settings.

This function should be implemented by derived classes to initialise the graphics context, given by aGc, with the required settings. The default implementation is empty.

Parameters

CWindowGc &aGc

The graphics context to be initialised.


MCoeControlContext_Reserved1()

private: IMPORT_C virtual void MCoeControlContext_Reserved1();

Description


MCoeControlContext_Reserved2()

private: IMPORT_C virtual void MCoeControlContext_Reserved2();

Description