|
1 /* |
|
2 * Copyright (c) 2001-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 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: Implementation of ecom plugin |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: tr1cfwln#9 % |
|
20 */ |
|
21 |
|
22 // INCLUDE FILES |
|
23 #include "eapnotifierdialoguiddefs.h" |
|
24 |
|
25 #include <ecom/implementationproxy.h> |
|
26 #include <AknNotifierWrapper.h> // link against aknnotifierwrapper.lib |
|
27 |
|
28 |
|
29 // CONSTANTS |
|
30 const TInt KMyPriority = MEikSrvNotifierBase2::ENotifierPriorityLow; |
|
31 const TInt KArrayGranularity = 4; |
|
32 |
|
33 |
|
34 // --------------------------------------------------------- |
|
35 // CleanupArray() |
|
36 // --------------------------------------------------------- |
|
37 // |
|
38 void CleanupArray( TAny* aArray ) |
|
39 { |
|
40 CArrayPtrFlat<MEikSrvNotifierBase2>* |
|
41 subjects = static_cast<CArrayPtrFlat<MEikSrvNotifierBase2>*>( aArray ); |
|
42 TInt lastInd = subjects->Count()-1; |
|
43 for ( TInt i = lastInd; i >= 0; i-- ) |
|
44 { |
|
45 subjects->At( i )->Release(); |
|
46 } |
|
47 |
|
48 delete subjects; |
|
49 } |
|
50 |
|
51 |
|
52 // --------------------------------------------------------- |
|
53 // DoCreateNotifierArrayL() |
|
54 // --------------------------------------------------------- |
|
55 // |
|
56 CArrayPtr<MEikSrvNotifierBase2>* DoCreateNotifierArrayL() |
|
57 { |
|
58 CArrayPtrFlat<MEikSrvNotifierBase2>* subjects = |
|
59 new ( ELeave )CArrayPtrFlat<MEikSrvNotifierBase2>( KArrayGranularity ); |
|
60 |
|
61 CleanupStack::PushL( TCleanupItem( CleanupArray, subjects ) ); |
|
62 |
|
63 // Create Wrappers |
|
64 CAknCommonNotifierWrapper* master = NULL; |
|
65 |
|
66 // EAP-MSCHAPv2 |
|
67 _LIT( KMsChapv2NotifierPluginName, "mschapv2notifdlg.dll" ); |
|
68 master = CAknCommonNotifierWrapper::NewL( KUidMsChapv2Dialog, |
|
69 KUidMsChapv2Dialog, |
|
70 KMyPriority, |
|
71 KMsChapv2NotifierPluginName, |
|
72 1 ); |
|
73 |
|
74 CleanupStack::PushL( master ); |
|
75 subjects->AppendL( master ); |
|
76 CleanupStack::Pop( master ); |
|
77 |
|
78 |
|
79 |
|
80 // EAP-GTC |
|
81 _LIT( KGtcNotifierPluginName, "gtcnotifdlg.dll" ); |
|
82 |
|
83 // Session owning notifier(if default implementation is enough) |
|
84 master = CAknCommonNotifierWrapper::NewL( KUidGtcDialog, |
|
85 KUidGtcDialog, |
|
86 KMyPriority, |
|
87 KGtcNotifierPluginName, |
|
88 1 ); // we don't use synch reply |
|
89 |
|
90 CleanupStack::PushL( master ); |
|
91 subjects->AppendL( master ); |
|
92 CleanupStack::Pop( master ); |
|
93 |
|
94 |
|
95 // PAP |
|
96 _LIT( KPapNotifierPluginName, "papnotifdlg.dll" ); |
|
97 master = CAknCommonNotifierWrapper::NewL( KUidPapDialog, |
|
98 KUidPapDialog, |
|
99 KMyPriority, |
|
100 KPapNotifierPluginName, |
|
101 1 ); |
|
102 |
|
103 CleanupStack::PushL( master ); |
|
104 subjects->AppendL( master ); |
|
105 CleanupStack::Pop( master ); |
|
106 |
|
107 |
|
108 |
|
109 #ifdef FF_WLAN_EXTENSIONS |
|
110 |
|
111 // EAP-LEAP |
|
112 _LIT( KLeapNotifierPluginName, "leapnotifdlg.dll" ); |
|
113 master = CAknCommonNotifierWrapper::NewL( KUidLeapDialog, |
|
114 KUidLeapDialog, |
|
115 KMyPriority, |
|
116 KLeapNotifierPluginName, |
|
117 1 ); |
|
118 |
|
119 CleanupStack::PushL( master ); |
|
120 subjects->AppendL( master ); |
|
121 CleanupStack::Pop( master ); |
|
122 |
|
123 #endif |
|
124 |
|
125 CleanupStack::Pop(); // array cleanup |
|
126 |
|
127 return subjects; |
|
128 } |
|
129 |
|
130 |
|
131 // --------------------------------------------------------- |
|
132 // NotifierArray() |
|
133 // --------------------------------------------------------- |
|
134 // |
|
135 CArrayPtr<MEikSrvNotifierBase2>* NotifierArray() |
|
136 // old Lib main entry point |
|
137 { |
|
138 CArrayPtr<MEikSrvNotifierBase2>* array = 0; |
|
139 TRAP_IGNORE( array = DoCreateNotifierArrayL() ); |
|
140 return array; |
|
141 } |
|
142 |
|
143 |
|
144 // --------------------------------------------------------- |
|
145 // ImplementationTable |
|
146 // --------------------------------------------------------- |
|
147 // |
|
148 const TImplementationProxy ImplementationTable[] = |
|
149 { |
|
150 #ifdef __EABI__ |
|
151 {{0x2000cf2f}, ( TFuncPtr )NotifierArray} |
|
152 #else |
|
153 {{0x2000cf2f}, NotifierArray} |
|
154 #endif |
|
155 }; |
|
156 |
|
157 // --------------------------------------------------------- |
|
158 // ImplementationGroupProxy |
|
159 // entry point |
|
160 // --------------------------------------------------------- |
|
161 // |
|
162 EXPORT_C const TImplementationProxy* ImplementationGroupProxy( |
|
163 TInt& aTableCount ) |
|
164 { |
|
165 aTableCount = sizeof( ImplementationTable ) / |
|
166 sizeof( TImplementationProxy ) ; |
|
167 return ImplementationTable; |
|
168 } |
|
169 |
|
170 |
|
171 // End of File |