epoc32/include/mw/apacmdln.h
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/mw/apacmdln.h	Wed Mar 31 12:27:01 2010 +0100
     1.3 @@ -0,0 +1,178 @@
     1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// 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
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#if !defined(__APACMDLN_H__)
    1.20 +#define __APACMDLN_H__
    1.21 +
    1.22 +#if !defined(__E32BASE_H__)
    1.23 +#include <e32base.h>
    1.24 +#endif
    1.25 +
    1.26 +#if !defined(__APADEF_H__)
    1.27 +#include <apadef.h>
    1.28 +#endif
    1.29 +
    1.30 +#if !defined(__F32FILE_H__)
    1.31 +#include <f32file.h>
    1.32 +#endif
    1.33 +
    1.34 +#if !defined(__S32STRM_H__)
    1.35 +#include <s32strm.h>
    1.36 +#endif
    1.37 +
    1.38 +
    1.39 +class CApaCommandLine : public CBase
    1.40 +/** Information for launching an application.
    1.41 +
    1.42 +This is often referred to as a command line and contains:
    1.43 +
    1.44 +the name of an application EXE to be launched,
    1.45 +
    1.46 +a document name,
    1.47 +
    1.48 +a command code that defines the way the application is launched
    1.49 +
    1.50 +trailing data; the structure of this depends on the application to be launched.
    1.51 +
    1.52 +The information is held in a buffer implemented by a heap descriptor. 
    1.53 +
    1.54 +@publishedAll
    1.55 +@released */
    1.56 +	{
    1.57 +public:
    1.58 +	// construction/destruction
    1.59 +	IMPORT_C static CApaCommandLine* NewL();
    1.60 +	IMPORT_C static CApaCommandLine* NewLC();
    1.61 +	IMPORT_C ~CApaCommandLine();
    1.62 +
    1.63 +	// Getting/setting the CApaCommandLine to/from process environment-slots
    1.64 +	IMPORT_C void SetProcessEnvironmentL(RProcess& aProcess) const;
    1.65 +	IMPORT_C static TInt GetCommandLineFromProcessEnvironment(CApaCommandLine*& aCommandLine);
    1.66 +
    1.67 +	// Getting/setting the CApaCommandLine to/from a server IPC-message
    1.68 +	IMPORT_C void GetIpcArgsLC(TIpcArgs& aIpcArgs) const;
    1.69 +	IMPORT_C void ConstructCmdLineFromMessageL(const RMessage2& aMessage);
    1.70 +
    1.71 +	// operations on the document name
    1.72 +	IMPORT_C void SetDocumentNameL(const TDesC& aDocName);
    1.73 +	IMPORT_C TPtrC DocumentName() const;
    1.74 +
    1.75 +	// operations on the executable name
    1.76 +	IMPORT_C void SetExecutableNameL(const TDesC& aAppName);
    1.77 +	IMPORT_C TPtrC ExecutableName() const;
    1.78 +	
    1.79 +	IMPORT_C void SetOpaqueDataL(const TDesC8& aOpaqueData);
    1.80 +	IMPORT_C TPtrC8 OpaqueData() const;
    1.81 +
    1.82 +	// operations on the tail end
    1.83 +	IMPORT_C void SetTailEndL(const TDesC8& aTailEnd);
    1.84 +	IMPORT_C TPtrC8 TailEnd() const;
    1.85 +
    1.86 +	// operations on the command
    1.87 +	IMPORT_C void SetCommandL(TApaCommand aCommand);
    1.88 +	IMPORT_C TApaCommand Command() const;
    1.89 +
    1.90 +	// operations on the parent process id
    1.91 +	IMPORT_C void SetParentProcessId(TProcessId aProcessId);
    1.92 +	IMPORT_C TProcessId ParentProcessId() const;
    1.93 +
    1.94 +	// operations on the file passed by handle
    1.95 +	IMPORT_C void SetFileByHandleL(const RFile& aFile);
    1.96 +	IMPORT_C void GetFileByHandleL(RFile& aFile) const;
    1.97 +public:
    1.98 +
    1.99 +	// operations on the server requirement/differentiator number - 0 means no server, non-zero sets the differentiator for the server name
   1.100 +	IMPORT_C void SetServerNotRequiredL();
   1.101 +	IMPORT_C void SetServerRequiredL(TUint aServerDifferentiator);
   1.102 +	IMPORT_C TUint ServerRequired() const;
   1.103 +
   1.104 +	// operations to support starting an application with a specific screen number
   1.105 +	IMPORT_C void SetDefaultScreenL(TInt aDefaultScreenNumber);
   1.106 +	IMPORT_C TInt DefaultScreen() const;
   1.107 +	IMPORT_C TBool IsDefaultScreenSet() const;
   1.108 +
   1.109 +	// Operations to support window chaining
   1.110 +	IMPORT_C void SetParentWindowGroupID(TInt aParentWindowGroupID);
   1.111 +	IMPORT_C TInt ParentWindowGroupID() const;
   1.112 +
   1.113 +	// operations to support passing memory-allocation failure settings in to applications
   1.114 +	IMPORT_C void SetDebugMemFailL(TInt aDebugMemFail);
   1.115 +	IMPORT_C TInt DebugMemFail() const;
   1.116 +
   1.117 +	// operations to support the instrumentation (i.e. profiling) of application startup
   1.118 +	IMPORT_C void SetAppStartupInstrumentationEventIdBaseL(TInt aEventIdBase);
   1.119 +	IMPORT_C TInt AppStartupInstrumentationEventIdBase() const;
   1.120 +
   1.121 +	IMPORT_C static TInt EnvironmentSlotForPublicUse(TInt aIndex);
   1.122 +
   1.123 +private:
   1.124 +	struct SOption
   1.125 +		{
   1.126 +		const TDesC* iToken;
   1.127 +		TInt* iResult;
   1.128 +		TRadix iRadix;
   1.129 +		HBufC8* iHBufC8Result;
   1.130 +		};
   1.131 +
   1.132 +private:
   1.133 +	CApaCommandLine();
   1.134 +	void SetServerDifferentiatorL(TUint aServerDifferentiator);
   1.135 +	void ExternalizeL(RWriteStream& aStream) const;
   1.136 +	void InternalizeL(RReadStream& aStream);
   1.137 +	HBufC8* StreamableAttributesLC() const;
   1.138 +	void GetCommandLineFromProcessEnvironmentL();
   1.139 +	TInt Parse(const TDesC& aCmdLine);
   1.140 +	TPtrC StripQuotes(const TDesC& aDes) const;
   1.141 +
   1.142 +private:
   1.143 +	enum
   1.144 +		{
   1.145 +		EEnvironmentSlotUnused=0,
   1.146 +
   1.147 +		EEnvironmentSlotMain=1,
   1.148 +		EEnvironmentSlotFsSession=2,
   1.149 +		EEnvironmentSlotFile=3,
   1.150 +
   1.151 +		EFirstEnvironmentSlotForPublicUse=8,
   1.152 +		ENumberOfEnvironmentSlotsForPublicUse=4
   1.153 +		};
   1.154 +
   1.155 +	enum
   1.156 +		{
   1.157 +		EIpcSlotMain=0,
   1.158 +		EIpcSlotFsSession=1,
   1.159 +		EIpcSlotFile=2
   1.160 +		};
   1.161 +public:
   1.162 +	enum
   1.163 +		{
   1.164 +		EIpcFirstFreeSlot=3
   1.165 +		};
   1.166 +private:
   1.167 +	HBufC* iDocumentName;
   1.168 +	HBufC* iExecutableName;
   1.169 +	HBufC8* iOpaqueData;
   1.170 +	HBufC8* iTailEnd;
   1.171 +	TApaCommand iCommand;
   1.172 +	TUint iServerDifferentiator;
   1.173 +	TInt iDefaultScreenNumber;
   1.174 +	TInt iParentWindowGroupID;
   1.175 +	TInt iDebugMemFail;
   1.176 +	TInt iAppStartupInstrumentationEventIdBase;
   1.177 +	RFile iFile;
   1.178 +	TProcessId iParentProcessId;
   1.179 +	};
   1.180 +
   1.181 +#endif