|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: bsprocessstarter.h |
|
15 * |
|
16 */ |
|
17 #ifndef __PROCESSSTARTER_H__ |
|
18 #define __PROCESSSTARTER_H__ |
|
19 |
|
20 #include <e32std.h> |
|
21 class TProcessStartupParam; |
|
22 |
|
23 |
|
24 |
|
25 /** |
|
26 * Generic process starter. |
|
27 */ |
|
28 class BSProcessStarter |
|
29 { |
|
30 public: // New methods |
|
31 |
|
32 static void FullExePathForClienLocation( |
|
33 const TDesC& aExeName, |
|
34 TFileName& aFullExePath ); |
|
35 |
|
36 static TInt StartInstance( |
|
37 const TDesC& aFullExePath, |
|
38 const TDesC& aCommand, |
|
39 const TArray< TProcessStartupParam >* aParams ); |
|
40 |
|
41 static TInt ConnectToServer( |
|
42 const TDesC& aFullExePath, |
|
43 const TDesC& aCommand, |
|
44 const TArray< TProcessStartupParam >* aParams, |
|
45 RSessionBase& aSessionToConnect, |
|
46 const TDesC& aServerName, |
|
47 const TVersion& aClientVersion, |
|
48 TInt aAsyncMessageSlots ); |
|
49 |
|
50 |
|
51 |
|
52 private: // Helpers |
|
53 static TInt DoStartInstance( |
|
54 const TDesC& aFullExePath, |
|
55 const TDesC& aCommand, |
|
56 const TArray< TProcessStartupParam >* aParams ); |
|
57 |
|
58 static TInt ApplyParameters( |
|
59 const TArray< TProcessStartupParam >* aParams, |
|
60 RProcess& aProcess ); |
|
61 |
|
62 }; |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 /** |
|
68 * Generic process startup parameters. |
|
69 */ |
|
70 class TProcessStartupParam |
|
71 { |
|
72 public: |
|
73 |
|
74 TProcessStartupParam(); |
|
75 void Set( TInt aSlot, const RHandleBase& aHandle ); |
|
76 void Set( TInt aSlot, const RSubSessionBase& aSubSession ); |
|
77 void Set( TInt aSlot, const TDesC16& aDes ); |
|
78 void Set( TInt aSlot, const TDesC8& aDes ); |
|
79 void Set( TInt aSlot, TInt aInt ); |
|
80 TInt ApplyParam( RProcess& aProcess ) const; |
|
81 |
|
82 |
|
83 |
|
84 private: //data |
|
85 |
|
86 enum TParamType{ EUnknown, EHandle, ESubSession, |
|
87 EDes16, EDes8, EInt }; |
|
88 |
|
89 TParamType iType; |
|
90 TInt iSlot; |
|
91 const RHandleBase* iHandle; |
|
92 const RSubSessionBase* iSubSession; |
|
93 TPtrC16 iDes16; |
|
94 TPtrC8 iDes8; |
|
95 TInt iInt; |
|
96 }; |
|
97 |
|
98 |
|
99 #endif // __PROCESSSTARTER_H__ |
|
100 |
|
101 |
|
102 //END OF FILE |
|
103 |
|
104 |