|
1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 |
|
17 // System includes |
|
18 // |
|
19 #include <ecom/ecom.h> |
|
20 |
|
21 /** |
|
22 Data type name for WSP Transport Handler |
|
23 @publishedAll |
|
24 @released |
|
25 */ |
|
26 _LIT8(KDataTypeName, "wsp-transport-handler"); |
|
27 |
|
28 |
|
29 inline |
|
30 CWspTransportHandler* CWspTransportHandler::NewL(RStringPool aStringPool, |
|
31 MSecurityPolicy* aSecurityPolicy, |
|
32 MWspCOSessionCallback& aSessionCB, |
|
33 MWspProxyInfoProvider& aProxyInfoProv, |
|
34 MWspCapabilityProvider& aCapProv, |
|
35 MWspSessionHeadersProvider& aSessHdrProv) |
|
36 { |
|
37 // CWspTransportHandler ECOM Interface UID = 101F4482 |
|
38 const TUid KUidWspTrHndInterface = {0x101F4482}; |
|
39 |
|
40 // Set up a structure containing the instantiation parameters |
|
41 SInstantiationParams initParams; |
|
42 initParams.iStringPool = &aStringPool; |
|
43 initParams.iSecurityPolicy = aSecurityPolicy; |
|
44 initParams.iSessionCB = &aSessionCB; |
|
45 initParams.iProxyInfoProv = &aProxyInfoProv; |
|
46 initParams.iCapProv = &aCapProv; |
|
47 initParams.iSessHdrProv = &aSessHdrProv; |
|
48 |
|
49 // Set up the parameters which allow ECOM's resolver to pick the right implementation |
|
50 TEComResolverParams resParams; |
|
51 resParams.SetDataType(KDataTypeName()); |
|
52 |
|
53 // Get the instantiation. Allow ECOM to use the default resolver. Pass in the init params. |
|
54 TAny* ptr = REComSession::CreateImplementationL(KUidWspTrHndInterface, |
|
55 _FOFF(CWspTransportHandler, iDtor_ID_Key), |
|
56 REINTERPRET_CAST(TAny*, &initParams), |
|
57 resParams); |
|
58 |
|
59 return REINTERPRET_CAST(CWspTransportHandler*, ptr); |
|
60 } |
|
61 |
|
62 inline |
|
63 CWspTransportHandler::~CWspTransportHandler() |
|
64 { |
|
65 REComSession::DestroyedImplementation(iDtor_ID_Key); |
|
66 } |
|
67 |
|
68 inline |
|
69 CWspTransportHandler::CWspTransportHandler(RStringPool aStringPool, |
|
70 MSecurityPolicy* aSecurityPolicy, |
|
71 MWspCOSessionCallback& aSessionCB, |
|
72 MWspProxyInfoProvider& aProxyInfoProv, |
|
73 MWspCapabilityProvider& aCapProv, |
|
74 MWspSessionHeadersProvider& aSessHdrProv) |
|
75 : iStringPool(aStringPool), iSecurityPolicy(aSecurityPolicy), |
|
76 iSessionCB(aSessionCB), iProxyInfoProv(aProxyInfoProv), iCapProv(aCapProv), |
|
77 iSessHdrProv(aSessHdrProv) |
|
78 { |
|
79 } |