Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: apgtask.h
Link against: apgrfx.lib

Class TApaTask

TApaTask

Support

Supported from 5.0

Description

Application task.

A task is a running application. At any one time, for any given application, there may be zero, one, or more tasks running on a device.

A task is identified by its association with the running application's window group.

An instance of the TApaTaskList class is used to find and access specific tasks.

Defined in TApaTask:
BringToForeground(), EndTask(), Exists(), KillTask(), SendKey(), SendMessage(), SendSystemEvent(), SendToBackground(), SetWgId(), SwitchCreateFile(), SwitchOpenFile(), TApaTask(), ThreadId(), WgId()

See also:


Construction


TApaTask()

TApaTask(RWsSession& aWsSession);

Description

Constructs an empty task object, taking a reference to a window server session.

An object of this type is constructed by an instance of the TApaTaskList class.

The object represents a task when it is assigned a task's window group ID.

Parameters

RWsSession& aWsSession

The window server session.

See also:

[Top]


Accessors and information


Exists()

TBool Exists() const;

Description

Tests whether this is an empty task object.

Return value

TBool

True, if the task exists; false, otherwise.

See also:


ThreadId()

TThreadId ThreadId() const;

Description

Gets the ID of this task's thread

Return value

TThreadId

The thread ID.


WgId()

TInt WgId() const;

Description

Gets the ID of this task's window group.

Return value

TInt

The window group ID. For an empty task object, this is zero.

[Top]


Actions


BringToForeground()

void BringToForeground();

Description

Brings this task to the foreground.

If the task uses the View architecture, then the task's top view is activated.


SendToBackground()

void SendToBackground();

Description

Sends this task to the background.

The task whose window group is at the next ordinal position is brought up to the foreground. In addition, the new foreground task's top view is activated, if it uses the View architecture.


EndTask()

void EndTask();

Description

Requests normal closing of this task.


KillTask()

void KillTask();

Description

Kills this task.


SendMessage()

TInt SendMessage(TUid aUid, const TDesC8& aParams);

Description

Sends a message to this task's window group.

The message is handled by the UI framework, specifically by CEikAppUI::ProcessMessageL().

Parameters

TUid aUid

The UID identifying the message. By default, the UI framework recognizes only two messages, KUidApaMessageSwitchOpenFileValue and KUidApaMessageSwitchCreateFileValue.

const TDesC8& aParams

The message. The format and meaning of the message depends on the specific type as identified by the UID.

Return value

TInt

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

See also:


SendSystemEvent()

void SendSystemEvent(TApaSystemEvent aEvent);

Description

Sends a system event to this task's window group.

Events are handled by the UI framework, specifically by CEikAppUi::HandleSystemEventL().

Parameters

TApaSystemEvent aEvent

The event type.

See also:


SetWgId()

void SetWgId(TInt aWgId);

Description

Sets this task's window group ID.

Parameters

TInt aWgId

The ID to be assigned.


SwitchCreateFile()

TInt SwitchCreateFile(const TDesC& aFilename);

Description

Requests the task to close its existing document, and to create and open a new document.

Parameters

const TDesC& aFilename

The name of the new document.

Return value

TInt

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


SwitchOpenFile()

TInt SwitchOpenFile(const TDesC& aFilename);

Description

Requests the task to close its existing document, and to open an existing document.

Parameters

const TDesC& aFilename

The name of the document to be opened.

Return value

TInt

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


SendKey()

void SendKey(TInt aKeyCode,TInt aModifiers);

Description

Sends a key event encapsulating the specified character code and specified modifier keys state to the task's window group.

Key events are handled by the UI framework, specifically by CCoeAppui::HandleWsEventL().

Parameters

TInt aKeyCode

The character code.

TInt aModifiers

State of the modifier keys.

See also:


SendKey()

void SendKey(const TKeyEvent& aKey);

Description

Sends the specified key event to the task's window group.

Key events are handled by the UI framework, specifically by CCoeAppui::HandleWsEventL().

Parameters

TKeyEvent& aKey

The key event.

See also: