williamr@2
|
1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@2
|
4 |
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@2
|
6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
//
|
williamr@2
|
15 |
|
williamr@2
|
16 |
#if !defined(__APACMDLN_H__)
|
williamr@2
|
17 |
#define __APACMDLN_H__
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#if !defined(__E32BASE_H__)
|
williamr@2
|
20 |
#include <e32base.h>
|
williamr@2
|
21 |
#endif
|
williamr@2
|
22 |
|
williamr@2
|
23 |
#if !defined(__APADEF_H__)
|
williamr@2
|
24 |
#include <apadef.h>
|
williamr@2
|
25 |
#endif
|
williamr@2
|
26 |
|
williamr@2
|
27 |
#if !defined(__F32FILE_H__)
|
williamr@2
|
28 |
#include <f32file.h>
|
williamr@2
|
29 |
#endif
|
williamr@2
|
30 |
|
williamr@2
|
31 |
#if !defined(__S32STRM_H__)
|
williamr@2
|
32 |
#include <s32strm.h>
|
williamr@2
|
33 |
#endif
|
williamr@2
|
34 |
|
williamr@2
|
35 |
|
williamr@2
|
36 |
class CApaCommandLine : public CBase
|
williamr@2
|
37 |
/** Information for launching an application.
|
williamr@2
|
38 |
|
williamr@2
|
39 |
This is often referred to as a command line and contains:
|
williamr@2
|
40 |
|
williamr@2
|
41 |
the name of an application EXE to be launched,
|
williamr@2
|
42 |
|
williamr@2
|
43 |
a document name,
|
williamr@2
|
44 |
|
williamr@2
|
45 |
a command code that defines the way the application is launched
|
williamr@2
|
46 |
|
williamr@2
|
47 |
trailing data; the structure of this depends on the application to be launched.
|
williamr@2
|
48 |
|
williamr@2
|
49 |
The information is held in a buffer implemented by a heap descriptor.
|
williamr@2
|
50 |
|
williamr@2
|
51 |
@publishedAll
|
williamr@2
|
52 |
@released */
|
williamr@2
|
53 |
{
|
williamr@2
|
54 |
public:
|
williamr@2
|
55 |
// construction/destruction
|
williamr@2
|
56 |
IMPORT_C static CApaCommandLine* NewL();
|
williamr@2
|
57 |
IMPORT_C static CApaCommandLine* NewLC();
|
williamr@2
|
58 |
IMPORT_C ~CApaCommandLine();
|
williamr@2
|
59 |
|
williamr@2
|
60 |
// Getting/setting the CApaCommandLine to/from process environment-slots
|
williamr@2
|
61 |
IMPORT_C void SetProcessEnvironmentL(RProcess& aProcess) const;
|
williamr@2
|
62 |
IMPORT_C static TInt GetCommandLineFromProcessEnvironment(CApaCommandLine*& aCommandLine);
|
williamr@2
|
63 |
|
williamr@2
|
64 |
// Getting/setting the CApaCommandLine to/from a server IPC-message
|
williamr@2
|
65 |
IMPORT_C void GetIpcArgsLC(TIpcArgs& aIpcArgs) const;
|
williamr@2
|
66 |
IMPORT_C void ConstructCmdLineFromMessageL(const RMessage2& aMessage);
|
williamr@2
|
67 |
|
williamr@2
|
68 |
// operations on the document name
|
williamr@2
|
69 |
IMPORT_C void SetDocumentNameL(const TDesC& aDocName);
|
williamr@2
|
70 |
IMPORT_C TPtrC DocumentName() const;
|
williamr@2
|
71 |
|
williamr@2
|
72 |
// operations on the executable name
|
williamr@2
|
73 |
IMPORT_C void SetExecutableNameL(const TDesC& aAppName);
|
williamr@2
|
74 |
IMPORT_C TPtrC ExecutableName() const;
|
williamr@2
|
75 |
|
williamr@2
|
76 |
IMPORT_C void SetOpaqueDataL(const TDesC8& aOpaqueData);
|
williamr@2
|
77 |
IMPORT_C TPtrC8 OpaqueData() const;
|
williamr@2
|
78 |
|
williamr@2
|
79 |
// operations on the tail end
|
williamr@2
|
80 |
IMPORT_C void SetTailEndL(const TDesC8& aTailEnd);
|
williamr@2
|
81 |
IMPORT_C TPtrC8 TailEnd() const;
|
williamr@2
|
82 |
|
williamr@2
|
83 |
// operations on the command
|
williamr@2
|
84 |
IMPORT_C void SetCommandL(TApaCommand aCommand);
|
williamr@2
|
85 |
IMPORT_C TApaCommand Command() const;
|
williamr@2
|
86 |
|
williamr@2
|
87 |
// operations on the parent process id
|
williamr@2
|
88 |
IMPORT_C void SetParentProcessId(TProcessId aProcessId);
|
williamr@2
|
89 |
IMPORT_C TProcessId ParentProcessId() const;
|
williamr@2
|
90 |
|
williamr@2
|
91 |
// operations on the file passed by handle
|
williamr@2
|
92 |
IMPORT_C void SetFileByHandleL(const RFile& aFile);
|
williamr@2
|
93 |
IMPORT_C void GetFileByHandleL(RFile& aFile) const;
|
williamr@2
|
94 |
public:
|
williamr@2
|
95 |
|
williamr@2
|
96 |
// operations on the server requirement/differentiator number - 0 means no server, non-zero sets the differentiator for the server name
|
williamr@2
|
97 |
IMPORT_C void SetServerNotRequiredL();
|
williamr@2
|
98 |
IMPORT_C void SetServerRequiredL(TUint aServerDifferentiator);
|
williamr@2
|
99 |
IMPORT_C TUint ServerRequired() const;
|
williamr@2
|
100 |
|
williamr@2
|
101 |
// operations to support starting an application with a specific screen number
|
williamr@2
|
102 |
IMPORT_C void SetDefaultScreenL(TInt aDefaultScreenNumber);
|
williamr@2
|
103 |
IMPORT_C TInt DefaultScreen() const;
|
williamr@2
|
104 |
IMPORT_C TBool IsDefaultScreenSet() const;
|
williamr@2
|
105 |
|
williamr@2
|
106 |
// Operations to support window chaining
|
williamr@2
|
107 |
IMPORT_C void SetParentWindowGroupID(TInt aParentWindowGroupID);
|
williamr@2
|
108 |
IMPORT_C TInt ParentWindowGroupID() const;
|
williamr@2
|
109 |
|
williamr@2
|
110 |
// operations to support passing memory-allocation failure settings in to applications
|
williamr@2
|
111 |
IMPORT_C void SetDebugMemFailL(TInt aDebugMemFail);
|
williamr@2
|
112 |
IMPORT_C TInt DebugMemFail() const;
|
williamr@2
|
113 |
|
williamr@2
|
114 |
// operations to support the instrumentation (i.e. profiling) of application startup
|
williamr@2
|
115 |
IMPORT_C void SetAppStartupInstrumentationEventIdBaseL(TInt aEventIdBase);
|
williamr@2
|
116 |
IMPORT_C TInt AppStartupInstrumentationEventIdBase() const;
|
williamr@2
|
117 |
|
williamr@2
|
118 |
IMPORT_C static TInt EnvironmentSlotForPublicUse(TInt aIndex);
|
williamr@2
|
119 |
|
williamr@2
|
120 |
private:
|
williamr@2
|
121 |
struct SOption
|
williamr@2
|
122 |
{
|
williamr@2
|
123 |
const TDesC* iToken;
|
williamr@2
|
124 |
TInt* iResult;
|
williamr@2
|
125 |
TRadix iRadix;
|
williamr@2
|
126 |
HBufC8* iHBufC8Result;
|
williamr@2
|
127 |
};
|
williamr@2
|
128 |
|
williamr@2
|
129 |
private:
|
williamr@2
|
130 |
CApaCommandLine();
|
williamr@2
|
131 |
void SetServerDifferentiatorL(TUint aServerDifferentiator);
|
williamr@2
|
132 |
void ExternalizeL(RWriteStream& aStream) const;
|
williamr@2
|
133 |
void InternalizeL(RReadStream& aStream);
|
williamr@2
|
134 |
HBufC8* StreamableAttributesLC() const;
|
williamr@2
|
135 |
void GetCommandLineFromProcessEnvironmentL();
|
williamr@2
|
136 |
TInt Parse(const TDesC& aCmdLine);
|
williamr@2
|
137 |
TPtrC StripQuotes(const TDesC& aDes) const;
|
williamr@2
|
138 |
|
williamr@2
|
139 |
private:
|
williamr@2
|
140 |
enum
|
williamr@2
|
141 |
{
|
williamr@2
|
142 |
EEnvironmentSlotUnused=0,
|
williamr@2
|
143 |
|
williamr@2
|
144 |
EEnvironmentSlotMain=1,
|
williamr@2
|
145 |
EEnvironmentSlotFsSession=2,
|
williamr@2
|
146 |
EEnvironmentSlotFile=3,
|
williamr@2
|
147 |
|
williamr@2
|
148 |
EFirstEnvironmentSlotForPublicUse=8,
|
williamr@2
|
149 |
ENumberOfEnvironmentSlotsForPublicUse=4
|
williamr@2
|
150 |
};
|
williamr@2
|
151 |
|
williamr@2
|
152 |
enum
|
williamr@2
|
153 |
{
|
williamr@2
|
154 |
EIpcSlotMain=0,
|
williamr@2
|
155 |
EIpcSlotFsSession=1,
|
williamr@2
|
156 |
EIpcSlotFile=2
|
williamr@2
|
157 |
};
|
williamr@2
|
158 |
public:
|
williamr@2
|
159 |
enum
|
williamr@2
|
160 |
{
|
williamr@2
|
161 |
EIpcFirstFreeSlot=3
|
williamr@2
|
162 |
};
|
williamr@2
|
163 |
private:
|
williamr@2
|
164 |
HBufC* iDocumentName;
|
williamr@2
|
165 |
HBufC* iExecutableName;
|
williamr@2
|
166 |
HBufC8* iOpaqueData;
|
williamr@2
|
167 |
HBufC8* iTailEnd;
|
williamr@2
|
168 |
TApaCommand iCommand;
|
williamr@2
|
169 |
TUint iServerDifferentiator;
|
williamr@2
|
170 |
TInt iDefaultScreenNumber;
|
williamr@2
|
171 |
TInt iParentWindowGroupID;
|
williamr@2
|
172 |
TInt iDebugMemFail;
|
williamr@2
|
173 |
TInt iAppStartupInstrumentationEventIdBase;
|
williamr@2
|
174 |
RFile iFile;
|
williamr@2
|
175 |
TProcessId iParentProcessId;
|
williamr@2
|
176 |
};
|
williamr@2
|
177 |
|
williamr@2
|
178 |
#endif
|