Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: w32std.h
Link against: ws32.lib

Class RWindowGroup

RWindowGroup

Support

Supported from 5.0

Description

Client-side handle to a server-side window group.

Derivation

MWsClientClassBase class for all classes whose objects are clients of the window server engine
RWindowGroupClient-side handle to a server-side window group
RWindowTreeNodeHandle to a node in the server-side window tree

Defined in RWindowGroup:
AddPriorityKey(), AutoForeground(), CancelCaptureKey(), CancelCaptureKeyUpAndDowns(), CancelTextCursor(), CaptureKey(), CaptureKeyUpAndDowns(), Construct(), DefaultOwningWindow(), DisableKeyClick(), DisableScreenChangeEvents(), EnableReceiptOfFocus(), EnableScreenChangeEvents(), FetchMessage(), Identifier(), Name(), RWindowGroup(), RemovePriorityKey(), SetName(), SetOrdinalPriorityAdjust(), SetOwningWindowGroup(), SetTextCursor(), SimulatePointerEvent()

Inherited from MWsClientClass:
WsHandle()

Inherited from RWindowTreeNode:
Child(), ClearPointerCursor(), Close(), Destroy(), DisableErrorMessages(), DisableFocusChangeEvents(), DisableGroupChangeEvents(), DisableModifierChangedEvents(), DisableOnEvents(), EFadeIncludeChildren, EFadeWindowOnly, EnableErrorMessages(), EnableFocusChangeEvents(), EnableGroupChangeEvents(), EnableModifierChangedEvents(), EnableOnEvents(), FullOrdinalPosition(), NextSibling(), OrdinalPosition(), OrdinalPriority(), Parent(), PrevSibling(), SetCustomPointerCursor(), SetFaded(), SetNonFading(), SetOrdinalPosition(), SetPointerCursor(), TFadeControl


Construction and destruction


RWindowGroup()

RWindowGroup();

Description

Creates a sessionless, uninitialised window group handle.

Handles to server-side objects must be created in a session in order to be operational; this constructor is merely a convenience to allow the handle to be stored as a data member. See RWindowTreeNode::RWindowTreeNode() for details of how the complete setup of a handle field may be deferred until the window server session is known.


RWindowGroup()

RWindowGroup(RWsSession &aWs);

Description

Creates an initialised window group handle within a server session.

Parameters

RWsSession &aWs

The window server session owning the window group.


Construct()

TInt Construct(TUint32 aClientHandle);

Description

Completes the construction of a window group.

Construction must be complete before any other window group methods can be called.

Parameters

TUint32 aClientHandle

The integer handle for this client: see RBlankWindow::Construct().

Return value

TInt

KErrNone if successful, otherwise one of the system-wide error codes.


Construct()

TInt Construct(TUint32 aClientHandle, TBool aInitialFocusState);

Description

Completes the construction of a window group, setting its initial focus state.

Construction must be complete before any other window group methods can be called.

aInitialFocusState can be specified in order to prevent a window group from automatically taking the keyboard focus when it is created. If specified, it sets the initial focus state of the window group. If a window group has a focus state of ETrue (the default), it can receive keyboard focus; if EFalse, it is prevented from receiving keyboard focus until this setting is changed. If a window group is constructed without specifying an initial focus state, keyboard focus will be enabled by default and the window group will receive keyboard focus automatically when it is created. To prevent this, set aInitialFocusState to EFalse.

Parameters

TUint32 aClientHandle

The integer handle for this client: see RBlankWindow::Construct().

TBool aInitialFocusState

Whether window is focusable. Set ETrue for it to be able to receive focus, EFalse otherwise.

Return value

TInt

KErrNone if successful, otherwise one of the system-wide error codes.

See also:

[Top]


Member functions


AddPriorityKey()

TInt AddPriorityKey(TUint aKeycode, TUint aModifierMask, TUint aModifier);

Description

Adds a priority key.

Priority key events are typically used for providing "Abort" or "Escape" keys for an application. For priority key events to occur they must first be configured using this function. Functions provided by RWsSession can then be used to get priority key events. Note that unlike other events, the Control Framework does NOT get priority key events for you.

Priority key events for the key given by aKeyCode are only delivered when the modifier keys specified by aModifierMask are in the states specified by aModifier. See RWsSession::SetHotKey() for examples of how to use aModifierMask and aModifier.

More than one priority key can be added for each keycode, each having a different set of modifier requirements.

Note:

Parameters

TUint aKeycode

The priority key to be added.

TUint aModifierMask

Only the modifier keys in this mask are tested against the states specified in aModifier.

TUint aModifier

Key is captured only when modifier keys specified in aModifierMask match these states, where 1 = modifier key on, and 0 = modifier key off. Modifier key states are defined in TEventModifier.

Return value

TInt

KErrNone if successful, otherwise one of the system-wide error codes.


AutoForeground()

void AutoForeground(TBool aState);

Description

Sets or disables auto-foreground behaviour.

If this behaviour is set for a window, it will automatically be given ordinal position zero whenever a pointer event of type EButton1Down occurs in any of its child windows. This will cause it to be brought to the foreground, unless another window group exists with a higher priority.

A window group that is moved to the foreground will automatically get keyboard focus unless it has explicitly had receipt-of-focus disabled or there is a focusable window group of higher priority. See EnableReceiptOfFocus().

Parameters

TBool aState

Whether this group should be automatically brought to the foreground on an EButton1Down.


CancelCaptureKey()

void CancelCaptureKey(TInt32 aCaptureKey);

Description

Cancels a request for key capture.

Use this function to cancel a request to capture a key previously made with CaptureKey(). If the value passed in aCaptureKey is not a valid capture key handle, this function will cause a panic.

Parameters

TInt32 aCaptureKey

The key for which the capture request is cancelled.


CancelCaptureKeyUpAndDowns()

void CancelCaptureKeyUpAndDowns(TInt32 aCaptureKey);

Description

Cancels a capture request for a key up or key down event.

Use this function to cancel a request to capture a key previously made with CaptureKeyUpAndDowns(). If the value passed in aCaptureKey is not a valid capture key handle, this function will cause a panic.

Parameters

TInt32 aCaptureKey

Cancel the request to capture this key.


CancelTextCursor()

void CancelTextCursor();

Description

Removes the text cursor.

Use this function to remove the current text cursor from this window group. This function does nothing if the cursor is currently in another window group.


CaptureKey()

TInt32 CaptureKey(TUint aKeycode, TUint aModifierMask, TUint aModifier);

Description

Requests key capture.

Use this function to instruct the window server to send key events (of type EEventKey) from the specified key to this window group, regardless of which window group currently has the keyboard focus.

Key events for the key given by aKeyCode are captured only when the modifier keys specified by aModifierMask are in the states specified by aModifier. See RWsSession::SetHotKey() for examples of how to use aModifierMask and aModifier.

Normally, keyboard key presses result in three events being delivered to the client: EEventKeyDown, EEventKey and EEventKeyUp. However, CaptureKey() results in only the EEventKey being delivered to the window group that called it: the EEventKeyUp and EEventKeyDown events are sent to the window group that has focus. If a window group wishes to capture the EEventKeyUp and EEventKeyDown events as well as the EEventKey, it should call CaptureKeyUpAndDowns().

Parameters

TUint aKeycode

The key code for the key to be captured. Key codes for special keys are defined in TKeyCode.

TUint aModifierMask

Only the modifier keys in this mask are tested against the states specified in aModifier.

TUint aModifier

Key is captured only when modifier keys specified in aModifierMask match these states, where 1=modifier set, and 0=modifier not set. Modifier key states are defined in TEventModifier.

Return value

TInt32

A handle identifying the capture key, or one of the system-wide error codes (if <0). Handles should be kept to pass to CancelCaptureKey() later.


CaptureKeyUpAndDowns()

TInt32 CaptureKeyUpAndDowns(TUint aScanCode, TUint aModifierMask, TUint aModifier);

Description

Requests the capture of key-up and key-down events on behalf of a window group.

This function requests the window server to send EEventKeyUp and EEventKeyDown key events from the specified key to this window group, regardless of which window group currently has the keyboard focus. This contrasts with CaptureKey(), which causes the window server to send the EEventKey event.

Key events for the key given by aScanCode are captured only when the modifier keys specified by aModifierMask are in the states specified by aModifier. See RWsSession::SetHotKey() for examples of how to set aModifierMask and aModifier.

Note:

Parameters

TUint aScanCode

Scan code for the key to be captured. Scan codes are defined in TStdScanCode.

TUint aModifierMask

Only the modifier keys in this mask are tested against the states specified in aModifier.

TUint aModifier

Key is captured only when modifier keys specified in aModifierMask match these states, where 1=modifier set, and 0=modifier not set. Modifier key states are defined in TEventModifier.

Return value

TInt32

A handle identifying the capture key, or one of the system-wide error codes (if < 0). Handles should be kept pass to CancelCaptureKeyUpAndDowns() later.


DefaultOwningWindow()

void DefaultOwningWindow();

Description

Make this window group the default owning window group.

The default owning window group is the group that is brought to the foreground when the window group which has keyboard focus (the foreground application) dies — if no other window has been set up as the owning group.

This window group will take over as the default owning window group even if another window group has previously called this function. However, if this window group is subsequently destroyed, the default owning window group will revert to being the previous window group.

See also:


DisableKeyClick()

void DisableKeyClick(TBool aState);

Description

Disable key click.

If a window group calls this function with aState=ETrue, key click (i.e., the sound generated when keys are pressed) will be disabled whenever this window group has the keyboard focus. Key click for this window group can be re-enabled by calling this function with aState=EFalse.

Note that this function doesn't do anything in releases 6.0 and 6.1, but should be available again in subsequent releases.

Parameters

TBool aState

ETrue — no key click when this window group has keyboard focus. EFalse — key click enabled when this window group has keyboard focus.


DisableScreenChangeEvents()

void DisableScreenChangeEvents();

Description

Disables screen change event sending.

This function prevents window groups from getting screen change events, which are set when the screen size mode changes. Such events would be sent, for example, when the flip on an Ericsson R380 phone is opened or closed.

Note that not getting screen change events is the default behaviour.

See EnableScreenChangeEvents().


EnableReceiptOfFocus()

void EnableReceiptOfFocus(TBool aState);

Description

Enables or disables receipt of keyboard focus.

The front most focusable window has keyboard focus. This function sets whether or not the window can receive keyboard focus.

Parameters

TBool aState

Whether this window group can accept keyboard focus.


EnableScreenChangeEvents()

TInt EnableScreenChangeEvents();

Description

Enables screen change event sending.

This function ensures that window groups are sent screen change events, which are set when the screen size mode changes. Such events are sent, for example, when the flip on an Ericsson R380 phone is opened or closed.

Note that not getting screen change events is the default behaviour.

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.

See also:


FetchMessage()

TInt FetchMessage(TUid& aUid, TPtr8& aParams);

Support

Withdrawn in 6.0

Description

Gets a message from the session.

Use this function to retrieve a message that has been sent to this window group by a session (either the session that owns this window group or another session) using RWsSession::SendMessageToWindowGroup(). This function should be called whenever the window group receives an event of type EEventMessageReady.

Caution! An application must ensure that it calls this function whenever it receives an EEventMessageReady event. It will receive no further EEventMessageReady events until it does so.

Notes:

Parameters

TUid& aUid

On return, contains the UID passed to RWsSession::SendMessageToWindowGroup() in aUid.

TPtr8& aParams

On return, contains the data that was passed to RWsSession::SendMessageToWindowGroup() in aParams.

Return value

TInt

KErrNone if successful, otherwise one of the system-wide error codes.


Identifier()

TInt Identifier() const;

Description

Gets the identifier of the window group.

Return value

TInt

The window group identifier.


Name()

TInt Name(TDes &aWindowName) const;

Description

Gets the window group’s name. See SetName().

Parameters

TDes &aWindowName

On return, contains the name of this window group.

Return value

TInt

KErrNone if successful, otherwise one of the system-wide error codes.


RemovePriorityKey()

void RemovePriorityKey(TUint aKeycode, TUint aModifierMask, TUint aModifier);

Description

Removes a priority key.

Use this function to remove a priority key that was added using AddPriorityKey(). If the specified priority key does not exist, this function does nothing.

Note:

Parameters

TUint aKeycode

Key code for the priority key to be removed

TUint aModifierMask

Modifier mask for the priority key to be removed

TUint aModifier

Modifier states for the priority key to be removed


SetName()

TInt SetName(const TDesC &aName);

Description

Sets the window group's name.

Use this function to set the name of a window group. Window group names are completely arbitrary and can contain any data that can be stored in a descriptor of type TDesC.

Note:

Parameters

const TDesC &aName

The name for the window group.

Return value

TInt

KErrNone if successful, otherwise one of the system-wide error codes.


SetOrdinalPriorityAdjust()

void SetOrdinalPriorityAdjust(TInt aAdjust);

Description

Set the window group's priority adjust value.

This function is primarily designed for sessions that own multiple window groups. After this function has been called by a window group, that window group's priority will be adjusted by the amount given by aAdjust whenever another window group owned by the same session gains keyboard focus.

When the session loses focus the priority returns to its original value.

Parameters

TInt aAdjust

Value to be added to window group's existing priority.


SetOwningWindowGroup()

void SetOwningWindowGroup(TInt aIdentifier);

Description

Sets the owning window group for this window group.

The owning window group is the group that is brought to the foreground when the window group which has keyboard focus (the foreground application) dies.

If the owning window group is not set, then the window group brought to the foreground when the application dies will be the default owning window group.

Parameters

TInt aIdentifier

The window group's identifier.


SetTextCursor()

void SetTextCursor(RWindowBase &aWin, const TPoint &aPos, const TTextCursor &aCursor);

Description

Sets the text cursor.

Use this function to set a text cursor for this window group, or to update the text cursor's position or appearance.

Parameters

RWindowBase &aWin

The text cursor is in this window, and is hence clipped to it and positioned relative to it.

const TPoint &aPos

Position of the text cursor's origin, relative to the origin of aWin.

const TTextCursor &aCursor

The cursor to set.


SetTextCursor()

void SetTextCursor(RWindowBase& aWin, const TPoint& aPos, const TTextCursor &aCursor, const TRect &aClipRect);

Description

Sets the text cursor and its clipping rectangle.

Use this function to set a text cursor for this window group, or to update the text cursor's position or appearance.

If aClipRect is specified, the cursor is clipped to this rectangle. This allows, for example, the window to have a border region in which the cursor is not displayed.

Parameters

RWindowBase& aWin

The text cursor is in this window, and is hence clipped to it and positioned relative to it.

const TPoint& aPos

Position of the text cursor's origin, relative to the origin of aWin.

const TTextCursor& aCursor

The cursor to set.

const TRect& aClipRect

Cursor is clipped to this rectangle. Rectangle co-ordinates are relative to the origin of aWin.


SimulatePointerEvent()

void SimulatePointerEvent(TRawEvent aEvent);

Description

Simulates a pointer event.

This function sends a pointer event into the window just as if it had come from the kernel, except that it will be send to a window which is a child of the Window Group it is called on.

Notes:

Parameters

TRawEvent aEvent

The simulated raw event.