class CApaCommandLine : public CBase |
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.
Private Member Functions | |
---|---|
CApaCommandLine () | |
void | DoGetCommandLineFromProcessEnvironmentL () |
TInt | DoGetParametersFromCommandLineString (const TDesC &) |
void | ExternalizeL ( RWriteStream &) |
void | InternalizeL ( RReadStream &) |
HBufC * | NameOfExecutable (const TDesC &, TInt &) |
void | SetServerDifferentiatorL ( TUint ) |
HBufC8 * | StreamableAttributesLC () |
TPtrC | StripQuotes (const TDesC &) |
Public Member Enumerations | |
---|---|
enum | anonymous { EIpcFirstFreeSlot = 3 } |
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.
IMPORT_C void | ConstructCmdLineFromMessageL | ( | const RMessage2 & | aMessage | ) |
Acts as a second constructor and completes a commandline object from the aMessage object.
const RMessage2 & aMessage |
IMPORT_C TInt | DefaultScreen | ( | ) | const |
Extracts and returns the default (startup) screen that was specified in the command line.
void | DoGetCommandLineFromProcessEnvironmentL | ( | ) | [private] |
TInt | DoGetParametersFromCommandLineString | ( | const TDesC & | aCmdLine | ) | [private] |
const TDesC & aCmdLine |
IMPORT_C TPtrC | DocumentName | ( | ) | const |
Gets the document name from the launch information.
IMPORT_C TInt | EnvironmentSlotForPublicUse | ( | TInt | aIndex | ) | [static] |
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.
TInt 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(). |
IMPORT_C TPtrC | ExecutableName | ( | ) | const |
Gets the executable name from the launch information.
void | ExternalizeL | ( | RWriteStream & | aStream | ) | const [private] |
RWriteStream & aStream |
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.
CEikAppUi::ProcessCommandParametersL(CApaCommandLine& aCommandLine).
CApaCommandLine *& aCommandLine | On return, a pointer to a newly constructed command line object. |
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.
RFile & 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 void | GetIpcArgsLC | ( | TIpcArgs & | aIpcArgs | ) | const |
TIpcArgs & aIpcArgs |
void | InternalizeL | ( | RReadStream & | aStream | ) | [private] |
RReadStream & aStream |
HBufC * | NameOfExecutable | ( | const TDesC & | aCmdLine, |
TInt & | aEndDocNameOffset | |||
) | [private, static] |
Get the name of the executable from the command line string.
IMPORT_C CApaCommandLine * | NewLC | ( | ) | [static] |
Creates an empty command line object, and puts a pointer to it onto the cleanup stack.
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.
IMPORT_C TProcessId | ParentProcessId | ( | ) | const |
Gets the Parent Process ID of the Child Process launched with this command line.
See the description of SetParentProcessId.
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.
IMPORT_C TUint | ServerRequired | ( | ) | const |
Gets the server differentiator.
See the description of SetServerRequiredL.
SetServerRequiredL REikAppServiceBase::LaunchAppL()
IMPORT_C void | SetAppStartupInstrumentationEventIdBaseL | ( | TInt | aEventIdBase | ) |
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.
TApaCommand aCommand | The command code. |
IMPORT_C void | SetDebugMemFailL | ( | TInt | aDebugMemFail | ) |
TInt aDebugMemFail |
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).
TInt 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.
const TDesC & aDocName | A descriptor containing the document name. |
IMPORT_C void | SetExecutableNameL | ( | const TDesC & | aAppName | ) |
Sets the executable name from the specified descriptor.
const TDesC & 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() .
const RFile & 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).
const TDesC8 & 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.
TProcessId 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.
TInt 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.
RProcess & aProcess | The process to which the command line is assigned. |
void | SetServerDifferentiatorL | ( | TUint | aServerDifferentiator | ) | [private] |
REikAppServiceBase::LaunchAppL()
TUint aServerDifferentiator |
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. 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.
REikAppServiceBase::LaunchAppL()
TUint 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.
const TDesC8 & aTailEnd | An 8 bit descriptor containing the trailing data. |
TPtrC | StripQuotes | ( | const TDesC & | aDes | ) | [private, static] |
Strip all quates from the string.
const TDesC & aDes |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.