#include <mw/apacmdln.h>
class CApaCommandLine : public CBase |
Public Member Enumerations | |
---|---|
enum | anonymous { EIpcFirstFreeSlot } |
Information for launching an application.
To start an application, passed a CApaCommandLine object to the RApaLsSession::StartApp() method.
This class 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.
To start an application, startup parameters are set on the CApaCommandLine object that is then externalized into a stream and attached to a new RProcess object. These parameters are then used to re-populate a new CApaCommandLine object inside the process by EikStart::RunApplication() and used to bootstrap the launching application.
IMPORT_C | ~CApaCommandLine | ( | ) |
Destructor. Frees resources owned by the object prior to deletion.
IMPORT_C TApaCommand | Command | ( | ) | const |
Gets the command code from the launch information.
See the description of SetCommandL.
See also: SetCommandL TApaCommand
Returns: The command code.
IMPORT_C void | ConstructCmdLineFromMessageL | ( | const RMessage2 & | aMessage | ) |
Acts as a second constructor and completes a commandline object from the aMessage object.
IMPORT_C TInt | DefaultScreen | ( | ) | const |
Extracts and returns the default (startup) screen that was specified in the command line.
Returns: A number representing the default (startup) screen. 0 (Zero) if nothing present.
IMPORT_C TPtrC | DocumentName | ( | ) | const |
Gets the document name from the launch information.
Returns: 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.
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 is returned from NumberOfEnvironmentSlotsForPublicUse(), (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(), User::GetDesParameter(), etc, depending on the type of the object in that environment slot.
Parameter | Description |
---|---|
aIndex | The logical index of the public environment-slot. This must be greater than or equal to zero, and less than the value returned from NumberOfEnvironmentSlotsForPublicUse(). |
Returns: The physical index of an environment-slot in the local process.
IMPORT_C TPtrC | ExecutableName | ( | ) | const |
Gets the executable name from the launch information.
Returns: A pointer descriptor representing the executable name.
IMPORT_C TInt | GetCommandLineFromProcessEnvironment | ( | CApaCommandLine *& | aCommandLine | ) | [static] |
Constructs a command line object.
If command line information is provided in the environment-slots it creates command line object from process environment-slots, else creates it from the information returned by User::CommandLine().
It can be called from a context where there is no CTrapCleanup.
Calling this function more than once in a process is not supported and will result in an empty command line being returned. If an application wants to inspect any part of its command line, it should override CEikAppUi::ProcessCommandParametersL(CApaCommandLine& aCommandLine) and call the base class implementation if required.
See also: CEikAppUi::ProcessCommandParametersL(CApaCommandLine& aCommandLine).
Parameter | Description |
---|---|
aCommandLine | On return, a pointer to a newly constructed command line object. |
Returns: KErrNone, if successful; otherwise one of the other system-wide error codes.
IMPORT_C void | GetFileByHandleL | ( | RFile & | aFile | ) | const |
Opens (by handle) the file that was passed into SetFileByHandleL by the process launching the local application.
On entering this function, aFile must be non-open. It is recommended that aFile is pushed onto the cleanup-stack (via CleanupClosePushL()) before this function is called.
Parameter | Description |
---|---|
aFile | The file object to be set up from the handle passed into the application. The caller has the responsibility to Close() this object, even if this function leaves. |
IMPORT_C CApaCommandLine * | NewL | ( | ) | [static] |
Creates an empty command line object.
Returns: A pointer to the new command line object.
IMPORT_C CApaCommandLine * | NewLC | ( | ) | [static] |
Creates an empty command line object, and puts a pointer to it onto the cleanup stack.
Returns: A pointer to the new command line object.
IMPORT_C TInt | NumberOfEnvironmentSlotsForPublicUse | ( | ) | [static] |
The number of process environment-slot available for public use.
IMPORT_C TPtrC8 | OpaqueData | ( | ) | const |
Gets the opaque-data from the launch information.
See the description of SetOpaqueDataL. By default, this attribute is an empty descriptor.
See also: SetOpaqueDataL
Returns: An 8-bit pointer descriptor representing the opaque-data.
IMPORT_C TProcessId | ParentProcessId | ( | ) | const |
Gets the Parent Process ID of the Child Process launched with this command line.
See the description of SetParentProcessId.
See also: SetParentProcessId
Returns: The Parent Process ID.
IMPORT_C TInt | ParentWindowGroupID | ( | ) | const |
Returns the ID of the parent window-group - the application should create its own window-group as a child of this parent.
Returns: The ID of the parent window-group - the application should create its window-group as a child off this .
IMPORT_C TUint | ServerRequired | ( | ) | const |
Gets the server differentiator.
See the description of SetServerRequiredL.
See also: SetServerRequiredL
See also: REikAppServiceBase::LaunchAppL()
Returns: The non-zero differentiator for the server, else zero indicating a server is not required.
IMPORT_C void | SetAppStartupInstrumentationEventIdBaseL | ( | TInt | aEventIdBase | ) |
IMPORT_C void | SetCommandL | ( | TApaCommand | aCommand | ) |
Sets the command code.
The command code is used to indicate how an application is to be launched.
See also: TApaCommand
Parameter | Description |
---|---|
aCommand | The command code. |
IMPORT_C void | SetDefaultScreenL | ( | TInt | aDefaultScreenNumber | ) |
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).
Parameter | Description |
---|---|
aDefaultScreenNumber | The number of the default (startup) screen. |
IMPORT_C void | SetDocumentNameL | ( | const TDesC & | aDocName | ) |
Sets the document name from the specified descriptor.
If the document name has embedded spaces, then it must be enclosed within quotation marks.
Parameter | Description |
---|---|
aDocName | A descriptor containing the document name. |
IMPORT_C void | SetExecutableNameL | ( | const TDesC & | aAppName | ) |
Sets the executable name from the specified descriptor.
Parameter | Description |
---|---|
aAppName | A descriptor containing the executable name. |
IMPORT_C void | SetFileByHandleL | ( | const RFile & | aFile | ) |
Sets the file to be passed into the application (by handle). This will then be retrieved by that application-process calling GetFileByHandleL().
Parameter | Description |
---|---|
aFile | The file object to be passed into the application. No transfer of this object's ownership takes place in this function. |
IMPORT_C void | SetOpaqueDataL | ( | const TDesC8 & | aOpaqueData | ) |
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).
Parameter | Description |
---|---|
aOpaqueData | An 8-bit descriptor containing the opaque-data. |
IMPORT_C void | SetParentProcessId | ( | TProcessId | aProcessId | ) |
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.
Parameter | Description |
---|---|
aProcessId | The Process ID. |
IMPORT_C void | SetParentWindowGroupID | ( | TInt | aParentWindowGroupID | ) |
Sets the ID of the parent window-group - the application should create its own window-group as a child off this parent.
Parameter | Description |
---|---|
aParentWindowGroupID | The ID of the parent window-group - the application should create its window-group as a child off this parent. |
IMPORT_C void | SetProcessEnvironmentL | ( | RProcess & | aProcess | ) | const |
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).
create the process and load the executable (RProcess::Create()),
create the command line object (CApaCommandLine::NewLC()), and set it up using the various setter functions, for instance SetDocumentNameL(),
call SetProcessEnvironmentL() to assign the command line to the process,
call Resume() on the process.
Note that this sequence of steps bypasses the application architecture, and is not recommended. RApaLsSession::StartApp() is the recommended way to launch an application with a command line.
See also: RApaLsSession::StartApp()
Parameter | Description |
---|---|
aProcess | The process to which the command line is assigned. |
IMPORT_C void | SetServerNotRequiredL | ( | ) |
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
IMPORT_C void | SetServerRequiredL | ( | TUint | aServerDifferentiator | ) |
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.
See also: REikAppServiceBase::LaunchAppL()
Parameter | Description |
---|---|
aServerDifferentiator | A differentiator for the required server. |
IMPORT_C void | SetTailEndL | ( | const TDesC8 & | aTailEnd | ) |
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.
Parameter | Description |
---|---|
aTailEnd | An 8 bit descriptor containing the trailing data. |
IMPORT_C TPtrC8 | TailEnd | ( | ) | const |
Gets the trailing data from the launch information.
See the description of SetTailEndL.
See also: SetTailEndL
Returns: A pointer descriptor representing the trailing data. If the launch information contains no trailing data, then the pointer descriptor has zero length.