Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <APACMDLN.H>
Link against: apparc.lib

Class CApaCommandLine

class CApaCommandLine : public CBase;

Description

Information for launching an application.

This is often referred to as a command line and contains:

the name of an application EXE to be launched,

a document name,

a command code that defines the way the application is launched

trailing data; the structure of this depends on the application to be launched.

The information is held in a buffer implemented by a heap descriptor.

Derivation

Members

Defined in CApaCommandLine:

Inherited from CBase:


Construction and destruction


NewL()

IMPORT_C static CApaCommandLine* NewL();

Description

Creates an empty command line object.

Return value

CApaCommandLine *

A pointer to the new command line object.


NewLC()

IMPORT_C static CApaCommandLine* NewLC();

Description

Creates an empty command line object, and puts a pointer to it onto the cleanup stack.

Return value

CApaCommandLine *

A pointer to the new command line object.


~CApaCommandLine()

IMPORT_C ~CApaCommandLine();

Description

Destructor.

Frees resources owned by the object prior to deletion.

[Top]


Member functions


SetProcessEnvironmentL(RProcess &)const

IMPORT_C void SetProcessEnvironmentL(RProcess &aProcess) const;

Description

Assigns a command line to a process (EKA2 only).

This replaces the EKA1 method which involved retrieving the full command line (using CApaCommandLine::FullCommandLine()) and passing it to the process (or thread on the emulator).

This function is used as follows (the order of the first 2 steps is irrelevant):-

Note that this sequence of steps bypasses the application architecture, and is not recommended. RApaLsSession::StartApp(const CApaCommandLine &) is the recommended way to launch an application with a command line.

Parameters

RProcess &aProcess

The process to which the command line is assigned.

Leave codes

KErrNotSupported

This indicates that the function was called on EKA1.

See also:


SetDocumentNameL(const TDesC &)

IMPORT_C void SetDocumentNameL(const TDesC &aDocName);

Description

Sets the document name from the specified descriptor.

If the document name has embedded spaces, then it must be enclosed within quotation marks.

Parameters

const TDesC16 &aDocName

A descriptor containing the document name.


DocumentName()const

IMPORT_C TPtrC DocumentName() const;

Description

Gets the document name from the launch information.

Return value

TPtrC16

A pointer descriptor representing the document name. The document name is returned without any enclosing quotation marks. If the launch information contains no document name, then the pointer descriptor has zero length.


SetExecutableNameL(const TDesC &)

IMPORT_C void SetExecutableNameL(const TDesC &aAppName);

Description

Sets the executable name from the specified descriptor.

Parameters

const TDesC16 &aAppName

A descriptor containing the executable name.


ExecutableName()const

IMPORT_C TPtrC ExecutableName() const;

Description

Gets the executable name from the launch information.

Return value

TPtrC16

A pointer descriptor representing the executable name.


SetOpaqueDataL(const TDesC8 &)

IMPORT_C void SetOpaqueDataL(const TDesC8 &aOpaqueData);

Description

Sets the opaque-data from the specified 8-bit descriptor.

This is called internally and populated from the data in the application's registration resource file, i.e. from the resource indicated by the opaque_data field of the APP_REGISTRATION_INFO resource (if the opaque_data field was non-zero).

Parameters

const TDesC8 &aOpaqueData

An 8-bit descriptor containing the opaque-data.


OpaqueData()const

IMPORT_C TPtrC8 OpaqueData() const;

Description

Gets the opaque-data from the launch information.

See the description of SetOpaqueDataL. By default, this attribute is an empty descriptor.

Return value

TPtrC8

An 8-bit pointer descriptor representing the opaque-data.

See also:


SetTailEndL(const TDesC8 &)

IMPORT_C void SetTailEndL(const TDesC8 &aTailEnd);

Description

Sets the trailing data.

The UI Framework provides a specific set of pre-defined command line options. Additional user defined or pre-defined command line options, may be passed to an application by setting the TailEnd.

Parameters

const TDesC8 &aTailEnd

An 8 bit descriptor containing the trailing data.


TailEnd()const

IMPORT_C TPtrC8 TailEnd() const;

Description

Gets the trailing data from the launch information.

See the description of SetTailEndL.

Return value

TPtrC8

A pointer descriptor representing the trailing data. If the launch information contains no trailing data, then the pointer descriptor has zero length.

See also:


SetCommandL(TApaCommand)

IMPORT_C void SetCommandL(TApaCommand aCommand);

Description

Sets the command code.

The command code is used to indicate how an application is to be launched.

Parameters

TApaCommand aCommand

The command code.

See also:


Command()const

IMPORT_C TApaCommand Command() const;

Description

Gets the command code from the launch information.

See the description of SetCommandL.

Return value

TApaCommand

The command code.

See also:


SetParentProcessId(TProcessId)

IMPORT_C void SetParentProcessId(TProcessId aProcessId);

Description

Sets the Parent Process ID for the Child Process launched with this command line.

This establishes a Parent-Child relationship which ensures that the child process is terminated when the parent terminates.

Parameters

TProcessId aProcessId

The Process ID.


ParentProcessId()const

IMPORT_C TProcessId ParentProcessId() const;

Description

Gets the Parent Process ID of the Child Process launched with this command line.

See the description of SetParentProcessId.

Return value

TProcessId

The Parent Process ID.

See also:


SetServerNotRequiredL()

IMPORT_C void SetServerNotRequiredL();

Description

Sets that no server is required.

The value of server differentiator is set to zero, to indicate that no server is required.

See the description of SetServerRequiredL.

See also:


SetServerRequiredL(TUint)

IMPORT_C void SetServerRequiredL(TUint aServerDifferentiator);

Description

Sets the required server.

The server differentiator is a number generated by the client that helps to uniquely identify the server. It is used by an application to indicate whether a server should be created and how it should be named.

Parameters

TUint aServerDifferentiator

A differentiator for the required server.


ServerRequired()const

IMPORT_C TUint ServerRequired() const;

Description

Gets the server differentiator.

See the description of SetServerRequiredL.

Return value

TUint

The non-zero differentiator for the server, else zero indicating a server is not required.

See also:


SetDefaultScreenL(TInt)

IMPORT_C void SetDefaultScreenL(TInt aDefaultScreenNumber);

Description

Provides support for devices with more than one screen. A number representing the default or startup screen may be passed to an application. Screen numbers and characteristics are defined in the window server initialisation file (wsini.ini).

Parameters

TInt aDefaultScreenNumber

The number of the default (startup) screen.


DefaultScreen()const

IMPORT_C TInt DefaultScreen() const;

Description

Extracts and returns the default (startup) screen that was specified in the command line.

Return value

TInt

A number representing the default (startup) screen. 0 (Zero) if nothing present.


SetParentWindowGroupID(TInt)

IMPORT_C void SetParentWindowGroupID(TInt aParentWindowGroupID);

Description

Sets the ID of the parent window-group - the application should create its own window-group as a child off this parent.

Parameters

TInt aParentWindowGroupID

The ID of the parent window-group - the application should create its window-group as a child off this parent.


ParentWindowGroupID()const

IMPORT_C TInt ParentWindowGroupID() const;

Description

Returns the ID of the parent window-group - the application should create its own window-group as a child of this parent.

Return value

TInt

The ID of the parent window-group - the application should create its window-group as a child off this .


EnvironmentSlotForPublicUse(TInt)

IMPORT_C static TInt EnvironmentSlotForPublicUse(TInt aIndex);

Description

Returns the index of a process environment-slot for public use (in other words, one that is not used internally by CApaCommandLine). The number of slots available for public use can be found in the (private) enum value CApaCommandLine::ENumberOfEnvironmentSlotsForPublicUse, (this value may be increased over time). The returned value can then be passed into any of the Open(TInt,...) functions on RSessionBase, RMutex, RChunk, RCondVar, etc, or into User::GetTIntParameter(TInt,TInt &), User::GetDesParameter(TInt,TDes8 &), etc, depending on the type of the object in that environment slot.

Parameters

TInt aIndex

The logical index of the public environment-slot. This must be greater than or equal to zero, and less than CApaCommandLine::ENumberOfEnvironmentSlotsForPublicUse.

Return value

TInt

The physical index of an environment-slot in the local process.

[Top]


Member enumerations


Enum anonymous

n/a

Description

EIpcFirstFreeSlot