|
1 /* |
|
2 * Copyright (c) 2005 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 the License "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: EAP and WLAN authentication protocols. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // Interface's (abstract base class's) static factory method implementation. |
|
20 // Asks ECOM plugin framework to instantiate appropriate concret plugin |
|
21 // implementation. |
|
22 inline CEapVpnInterface* CEapVpnInterface::NewL(MAbsEapVpnInterface* aCaller, TBool aClient) |
|
23 { |
|
24 // Parameters for the implementation |
|
25 TAbsEapVpnInterfaceParams params; |
|
26 params.iCaller = aCaller; |
|
27 params.iClient = aClient; |
|
28 // Find implementation for our interface. |
|
29 // - KCEapVpnInterfaceUid is the UID of our custom ECOM |
|
30 // interface. |
|
31 // - This call will leave, if the plugin architecture cannot find |
|
32 // implementation. |
|
33 // - The returned pointer points to one of our interface implementation |
|
34 // instances. |
|
35 TAny* interface = REComSession::CreateImplementationL ( |
|
36 KCEapVpnInterfaceImplementationUid, _FOFF (CEapVpnInterface, iDtor_ID_Key), (TAny*) ¶ms); |
|
37 |
|
38 return reinterpret_cast <CEapVpnInterface*> (interface); |
|
39 } |
|
40 |
|
41 // Interface's (abstract base class's) static factory method implementation. |
|
42 // Asks ECOM plugin framework to instantiate appropriate concret plugin |
|
43 // implementation. |
|
44 inline CEapVpnInterface* CEapVpnInterface::NewL(const TDesC8& aType, MAbsEapVpnInterface* aCaller, TBool aClient) |
|
45 { |
|
46 TEComResolverParams resolverParams; |
|
47 // Only one interface type |
|
48 // Remove these lines and uncomment line resolverParams.SetDataType (aType); |
|
49 // if you really have many possible intance types |
|
50 // --------------------------------------- |
|
51 (void) aType; |
|
52 _LIT8 (KEapPluginText,"EAPVPNIF"); |
|
53 resolverParams.SetDataType (KEapPluginText); |
|
54 // --------------------------------------- |
|
55 // +++++++++++++++++++++++++++++++++++++++ |
|
56 //resolverParams.SetDataType (aType); |
|
57 // +++++++++++++++++++++++++++++++++++++++ |
|
58 resolverParams.SetWildcardMatch (ETrue); |
|
59 |
|
60 // Parameters for the implementation |
|
61 TAbsEapVpnInterfaceParams params; |
|
62 params.iCaller = aCaller; |
|
63 params.iClient = aClient; |
|
64 // Find implementation for our interface. |
|
65 // - KCEapVpnInterfaceUid is the UID of our custom ECOM |
|
66 // interface. It is defined in EComInterfaceDefinition.h |
|
67 // - This call will leave, if the plugin architecture cannot find |
|
68 // implementation. |
|
69 // - The returned pointer points to one of our interface implementation |
|
70 // instances. |
|
71 TAny* interface = REComSession::CreateImplementationL (KCEapVpnInterfaceUid, |
|
72 _FOFF (CEapVpnInterface, iDtor_ID_Key), (TAny*) ¶ms, resolverParams, KCEapVpnInterfaceResolverUid); |
|
73 |
|
74 return reinterpret_cast <CEapVpnInterface*> (interface); |
|
75 } |
|
76 |
|
77 // Interface's (abstract base class's) destructor |
|
78 inline CEapVpnInterface::~CEapVpnInterface() |
|
79 { |
|
80 // If in the NewL some memory is reserved for member data, it must be |
|
81 // released here. This interface does not have any instance variables so |
|
82 // no need to delete anything. |
|
83 |
|
84 // Inform the ECOM framework that this specific instance of the |
|
85 // interface has been destroyed. |
|
86 REComSession::DestroyedImplementation (iDtor_ID_Key); |
|
87 } |
|
88 |
|
89 // Interface's (abstract base class's) constructor |
|
90 inline CEapVpnInterface::CEapVpnInterface() |
|
91 : CActive(CActive::EPriorityStandard) |
|
92 { |
|
93 iDtor_ID_Key.Uid(0); |
|
94 } |
|
95 |
|
96 // End |