CApaCommandLine Class Reference
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.
Constructor & Destructor Documentation
CApaCommandLine()
CApaCommandLine | ( | ) | [private] |
Private c'tor - initialize using NewLC()
~CApaCommandLine()
IMPORT_C | ~CApaCommandLine | ( | ) | |
Destructor. Frees resources owned by the object prior to deletion.
Member Functions Documentation
AppStartupInstrumentationEventIdBase()
IMPORT_C TInt | AppStartupInstrumentationEventIdBase | ( | ) | const |
Command()
Gets the command code from the launch information.
See the description of SetCommandL.
SetCommandL TApaCommand
ConstructCmdLineFromMessageL(const RMessage2 &)
IMPORT_C void | ConstructCmdLineFromMessageL | ( | const RMessage2 & | aMessage | ) | |
Acts as a second constructor and completes a commandline object from the aMessage object.
DebugMemFail()
IMPORT_C TInt | DebugMemFail | ( | ) | const |
DefaultScreen()
IMPORT_C TInt | DefaultScreen | ( | ) | const |
Extracts and returns the default (startup) screen that was specified in the command line.
DoGetCommandLineFromProcessEnvironmentL()
void | DoGetCommandLineFromProcessEnvironmentL | ( | ) | [private] |
DoGetParametersFromCommandLineString(const TDesC &)
TInt
| DoGetParametersFromCommandLineString | ( | const TDesC & | aCmdLine | ) | [private] |
DocumentName()
IMPORT_C TPtrC | DocumentName | ( | ) | const |
Gets the document name from the launch information.
EnvironmentSlotForPublicUse(TInt)
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.
Parameters
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(). |
ExecutableName()
IMPORT_C TPtrC | ExecutableName | ( | ) | const |
Gets the executable name from the launch information.
ExternalizeL(RWriteStream &)
GetCommandLineFromProcessEnvironment(CApaCommandLine *&)
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).
Parameters
CApaCommandLine *& aCommandLine | On return, a pointer to a newly constructed command line object. |
GetFileByHandleL(RFile &)
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.
Parameters
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. |
GetIpcArgsLC(TIpcArgs &)
IMPORT_C void | GetIpcArgsLC | ( | TIpcArgs & | aIpcArgs | ) | const |
InternalizeL(RReadStream &)
IsDefaultScreenSet()
IMPORT_C TBool | IsDefaultScreenSet | ( | ) | const |
NameOfExecutable(const TDesC &, TInt &)
HBufC * | NameOfExecutable | ( | const TDesC & | aCmdLine, |
| TInt & | aEndDocNameOffset |
| ) | [private, static] |
Get the name of the executable from the command line string.
Parameters
const TDesC & aCmdLine | |
TInt & aEndDocNameOffset | |
NewL()
Creates an empty command line object.
NewLC()
Creates an empty command line object, and puts a pointer to it onto the cleanup stack.
NumberOfEnvironmentSlotsForPublicUse()
IMPORT_C TInt | NumberOfEnvironmentSlotsForPublicUse | ( | ) | [static] |
The number of process environment-slot available for public use.
OpaqueData()
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.
SetOpaqueDataL
ParentProcessId()
Gets the Parent Process ID of the Child Process launched with this command line.
See the description of SetParentProcessId.
SetParentProcessId
ParentWindowGroupID()
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.
ServerRequired()
IMPORT_C TUint | ServerRequired | ( | ) | const |
Gets the server differentiator.
See the description of SetServerRequiredL.
SetServerRequiredL REikAppServiceBase::LaunchAppL()
SetAppStartupInstrumentationEventIdBaseL(TInt)
IMPORT_C void | SetAppStartupInstrumentationEventIdBaseL | ( | TInt | aEventIdBase | ) | |
SetCommandL(TApaCommand)
Sets the command code.
The command code is used to indicate how an application is to be launched.
TApaCommand
SetDebugMemFailL(TInt)
IMPORT_C void | SetDebugMemFailL | ( | TInt | aDebugMemFail | ) | |
SetDefaultScreenL(TInt)
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).
Parameters
TInt aDefaultScreenNumber | The number of the default (startup) screen. |
SetDocumentNameL(const TDesC &)
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.
Parameters
const TDesC & aDocName | A descriptor containing the document name. |
SetExecutableNameL(const TDesC &)
IMPORT_C void | SetExecutableNameL | ( | const TDesC & | aAppName | ) | |
Sets the executable name from the specified descriptor.
Parameters
const TDesC & aAppName | A descriptor containing the executable name. |
SetFileByHandleL(const RFile &)
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().
Parameters
const RFile & aFile | The file object to be passed into the application. No transfer of this object's ownership takes place in this function. |
SetOpaqueDataL(const TDesC8 &)
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).
Parameters
const TDesC8 & aOpaqueData | An 8-bit descriptor containing the opaque-data. |
SetParentProcessId(TProcessId)
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.
SetParentWindowGroupID(TInt)
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.
Parameters
TInt aParentWindowGroupID | The ID of the parent window-group - the application should create its window-group as a child off this parent. |
SetProcessEnvironmentL(RProcess &)
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).
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() is the recommended way to launch an application with a command line.
Parameters
RProcess & aProcess | The process to which the command line is assigned. |
SetServerDifferentiatorL(TUint)
void | SetServerDifferentiatorL | ( | TUint | aServerDifferentiator | ) | [private] |
REikAppServiceBase::LaunchAppL()
Parameters
TUint aServerDifferentiator | |
SetServerNotRequiredL()
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
SetServerRequiredL(TUint)
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()
Parameters
TUint aServerDifferentiator | A differentiator for the required server. |
SetTailEndL(const TDesC8 &)
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.
Parameters
const TDesC8 & aTailEnd | An 8 bit descriptor containing the trailing data. |
StreamableAttributesLC()
HBufC8 * | StreamableAttributesLC | ( | ) | const [private] |
StripQuotes(const TDesC &)
TPtrC
| StripQuotes | ( | const TDesC & | aDes | ) | [private, static] |
Strip all quates from the string.
TailEnd()
Gets the trailing data from the launch information.
See the description of SetTailEndL.
SetTailEndL
Member Enumerations Documentation
Member Data Documentation
TInt
iAppStartupInstrumentationEventIdBase
TInt
| iAppStartupInstrumentationEventIdBase | [private] |
TInt
iDebugMemFail
TInt
| iDebugMemFail | [private] |
TInt
iDefaultScreenNumber
TInt
| iDefaultScreenNumber | [private] |
RBuf
iDocumentName
RBuf
| iDocumentName | [private] |
RBuf
iExecutableName
RBuf
| iExecutableName | [private] |
RBuf8
iOpaqueData
RBuf8
| iOpaqueData | [private] |
TProcessId
iParentProcessId
TInt
iParentWindowGroupID
TInt
| iParentWindowGroupID | [private] |
TUint
iServerDifferentiator
TUint
| iServerDifferentiator | [private] |
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.