|
1 /* |
|
2 * Copyright (c) 2004 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: Methods for BT notifier Ecom Plugins entry point |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <implementationproxy.h> |
|
20 #include <AknNotifierWrapper.h> // link against aknnotifierwrapper.lib |
|
21 #include <btmanclient.h> |
|
22 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
23 #include <btextnotifiers.h> // define btninqnotifer uid |
|
24 #else |
|
25 #include <btextnotifiers.h> // define btninqnotifer uid |
|
26 #include <btextnotifierspartner.h> // define btninqnotifer uid |
|
27 #endif |
|
28 #include <btnotif.h> // notifier id for power mode setting |
|
29 |
|
30 // @todo remove this declaration once both stack and UI layers are in codeline |
|
31 const TUid KBTUserConfirmationNotifierUidCopyForWrapper={0x2002E224}; |
|
32 |
|
33 |
|
34 const TInt KMaxSynchReplyBufLength = 256; //what should be? |
|
35 |
|
36 const TUid KBTInquiryChannel = {0x00000601}; // Channel for inquiry notifier |
|
37 const TUid KBTAuthorisationChannel = {0x00000602}; // Channel for authorisation notifier |
|
38 const TUid KBTAuthenticationChannel = {0x00000603}; // Channel for PIN query notifier |
|
39 const TUid KBTObexPINChannel = {0x00000605}; // Channel for OBEX PIN notifier |
|
40 const TUid KBTPowerModeChannel = {0x00000606}; // Channel for power mode notifier |
|
41 const TUid KBTPairedDeviceSettingChannel = {0x00000610}; // Channel for Visibility timeout notifier |
|
42 |
|
43 const TInt KBTInquiryPriority = MEikSrvNotifierBase2::ENotifierPriorityVHigh; |
|
44 const TInt KBTAuthorisationPriority = MEikSrvNotifierBase2::ENotifierPriorityVHigh; |
|
45 const TInt KBTAuthenticationPriority = MEikSrvNotifierBase2::ENotifierPriorityVHigh; |
|
46 const TInt KBTObexPinPriority = MEikSrvNotifierBase2::ENotifierPriorityVHigh; |
|
47 const TInt KBTPowerModePriority = MEikSrvNotifierBase2::ENotifierPriorityVHigh; |
|
48 const TInt KBTGenericInfoNotifierPriority = MEikSrvNotifierBase2::ENotifierPriorityHigh; |
|
49 const TInt KBTGenericQueryNotifierPriority = MEikSrvNotifierBase2::ENotifierPriorityHigh; |
|
50 const TInt KBTNumericComparisonPriority = MEikSrvNotifierBase2::ENotifierPriorityVHigh; // for SSP |
|
51 const TInt KBTPasskeyEntryNotifierPriority = MEikSrvNotifierBase2::ENotifierPriorityVHigh; // for SSP |
|
52 const TInt KBTUserConfirmationNotifierPriority = MEikSrvNotifierBase2::ENotifierPriorityVHigh; // for SSP |
|
53 const TInt KBTPairedDeviceSettingPriority = MEikSrvNotifierBase2::ENotifierPriorityVHigh; |
|
54 const TInt KBTEnterpriseItSecurityInfoNotifierPriority = MEikSrvNotifierBase2::ENotifierPriorityHigh; |
|
55 |
|
56 const TInt KBTNotifierArrayIncrement = 8; |
|
57 |
|
58 void CleanupArray(TAny* aArray) |
|
59 { |
|
60 CArrayPtrFlat<MEikSrvNotifierBase2>* |
|
61 subjects=static_cast<CArrayPtrFlat<MEikSrvNotifierBase2>*>(aArray); |
|
62 TInt lastInd = subjects->Count()-1; |
|
63 for (TInt i=lastInd; i >= 0; i--) |
|
64 subjects->At(i)->Release(); |
|
65 delete subjects; |
|
66 } |
|
67 |
|
68 CArrayPtr<MEikSrvNotifierBase2>* DoCreateNotifierArrayL() |
|
69 { |
|
70 |
|
71 CArrayPtrFlat<MEikSrvNotifierBase2>* subjects= |
|
72 new (ELeave)CArrayPtrFlat<MEikSrvNotifierBase2>(KBTNotifierArrayIncrement); |
|
73 |
|
74 CleanupStack::PushL(TCleanupItem(CleanupArray, subjects)); |
|
75 |
|
76 // Create Wrappers |
|
77 |
|
78 // Session owning notifier(if default implementation is enough) |
|
79 |
|
80 CAknCommonNotifierWrapper* master = |
|
81 CAknCommonNotifierWrapper::NewL( KDeviceSelectionNotifierUid, |
|
82 KBTInquiryChannel, |
|
83 KBTInquiryPriority, |
|
84 _L("BTNotif.dll"), |
|
85 KMaxSynchReplyBufLength); |
|
86 |
|
87 CleanupStack::PushL( master ); |
|
88 subjects->AppendL( master ); |
|
89 CleanupStack::Pop( master ); |
|
90 |
|
91 // Notifiers using masters session |
|
92 CAknNotifierWrapperLight* notif = NULL; |
|
93 notif = new (ELeave) CAknNotifierWrapperLight(*master, |
|
94 KBTManAuthNotifierUid, |
|
95 KBTAuthorisationChannel, |
|
96 KBTAuthorisationPriority); |
|
97 CleanupStack::PushL( notif ); |
|
98 subjects->AppendL( notif ); |
|
99 CleanupStack::Pop( notif ); |
|
100 |
|
101 notif = new (ELeave) CAknNotifierWrapperLight(*master, |
|
102 KBTPinCodeEntryNotifierUid, |
|
103 KBTAuthenticationChannel, |
|
104 KBTAuthenticationPriority); |
|
105 CleanupStack::PushL( notif ); |
|
106 subjects->AppendL( notif ); |
|
107 CleanupStack::Pop( notif ); |
|
108 |
|
109 notif = new (ELeave) CAknNotifierWrapperLight(*master, |
|
110 KBTObexPasskeyQueryNotifierUid, |
|
111 KBTObexPINChannel, |
|
112 KBTObexPinPriority); |
|
113 CleanupStack::PushL( notif ); |
|
114 subjects->AppendL( notif ); |
|
115 CleanupStack::Pop( notif ); |
|
116 |
|
117 notif = new (ELeave) CAknNotifierWrapperLight(*master, |
|
118 KPowerModeSettingNotifierUid, |
|
119 KBTPowerModeChannel, |
|
120 KBTPowerModePriority); |
|
121 CleanupStack::PushL( notif ); |
|
122 subjects->AppendL( notif ); |
|
123 CleanupStack::Pop( notif ); |
|
124 |
|
125 notif = new (ELeave) CAknNotifierWrapperLight(*master, |
|
126 KBTGenericInfoNotifierUid, |
|
127 KBTGenericInfoNotifierUid, |
|
128 KBTGenericInfoNotifierPriority); |
|
129 CleanupStack::PushL( notif ); |
|
130 subjects->AppendL( notif ); |
|
131 CleanupStack::Pop( notif ); |
|
132 |
|
133 notif = new (ELeave) CAknNotifierWrapperLight(*master, |
|
134 KBTGenericQueryNotifierUid, |
|
135 KBTGenericQueryNotifierUid, |
|
136 KBTGenericQueryNotifierPriority); |
|
137 CleanupStack::PushL( notif ); |
|
138 subjects->AppendL( notif ); |
|
139 CleanupStack::Pop( notif ); |
|
140 |
|
141 notif = new (ELeave) CAknNotifierWrapperLight(*master, |
|
142 KPbapAuthNotifierUid, |
|
143 KBTObexPINChannel, |
|
144 KBTObexPinPriority); |
|
145 CleanupStack::PushL( notif ); |
|
146 subjects->AppendL( notif ); |
|
147 CleanupStack::Pop( notif ); |
|
148 |
|
149 notif = new (ELeave) CAknNotifierWrapperLight(*master, |
|
150 KBTPairedDeviceSettingNotifierUid, |
|
151 KBTPairedDeviceSettingChannel, |
|
152 KBTPairedDeviceSettingPriority); |
|
153 CleanupStack::PushL( notif ); |
|
154 subjects->AppendL( notif ); |
|
155 CleanupStack::Pop( notif ); |
|
156 |
|
157 notif = new (ELeave) CAknNotifierWrapperLight(*master, |
|
158 KBTNumericComparisonNotifierUid, |
|
159 KBTNumericComparisonNotifierUid, |
|
160 KBTNumericComparisonPriority); |
|
161 CleanupStack::PushL( notif ); |
|
162 subjects->AppendL( notif ); |
|
163 CleanupStack::Pop( notif ); |
|
164 |
|
165 notif = new (ELeave) CAknNotifierWrapperLight(*master, |
|
166 KBTPasskeyDisplayNotifierUid, |
|
167 KBTPasskeyDisplayNotifierUid, |
|
168 KBTPasskeyEntryNotifierPriority); |
|
169 CleanupStack::PushL( notif ); |
|
170 subjects->AppendL( notif ); |
|
171 CleanupStack::Pop( notif ); |
|
172 |
|
173 notif = new (ELeave) CAknNotifierWrapperLight(*master, |
|
174 KBTUserConfirmationNotifierUidCopyForWrapper, |
|
175 KBTUserConfirmationNotifierUidCopyForWrapper, |
|
176 KBTUserConfirmationNotifierPriority); |
|
177 CleanupStack::PushL( notif ); |
|
178 subjects->AppendL( notif ); |
|
179 CleanupStack::Pop( notif ); |
|
180 |
|
181 notif = new (ELeave) CAknNotifierWrapperLight(*master, |
|
182 KBTEnterpriseItSecurityInfoNotifierUid, |
|
183 KBTEnterpriseItSecurityInfoNotifierUid, |
|
184 KBTEnterpriseItSecurityInfoNotifierPriority); |
|
185 |
|
186 CleanupStack::PushL( notif ); |
|
187 subjects->AppendL( notif ); |
|
188 CleanupStack::Pop( notif ); |
|
189 |
|
190 CleanupStack::Pop(); // array cleanup |
|
191 return(subjects); |
|
192 } |
|
193 |
|
194 |
|
195 CArrayPtr<MEikSrvNotifierBase2>* NotifierArray() |
|
196 // old Lib main entry point |
|
197 { |
|
198 |
|
199 CArrayPtr<MEikSrvNotifierBase2>* array = 0; |
|
200 TRAPD(ignore, array = DoCreateNotifierArrayL()); |
|
201 if (ignore != KErrNone) |
|
202 { |
|
203 ignore = KErrNone; |
|
204 } |
|
205 return array; |
|
206 } |
|
207 |
|
208 const TImplementationProxy ImplementationTable[] = |
|
209 { |
|
210 #ifdef __EABI__ |
|
211 {{0x101FD690},(TFuncPtr)NotifierArray} |
|
212 #else |
|
213 {{0x101FD690},NotifierArray} |
|
214 #endif |
|
215 }; |
|
216 |
|
217 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) |
|
218 { |
|
219 |
|
220 aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy) ; |
|
221 return ImplementationTable; |
|
222 } |
|
223 |