|
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 base plugin. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 |
|
21 #include "wifiprotplugin.h" |
|
22 #include "wifiprotdlgsplugin.h" |
|
23 |
|
24 |
|
25 // CONSTANTS |
|
26 |
|
27 LOCAL_D const TInt KPluginGranularity = 4; |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 |
|
31 LOCAL_C void CreateNotifiersL( |
|
32 CArrayPtrFlat<MEikSrvNotifierBase2>* aNotifiers ); |
|
33 |
|
34 // -------------------------------------------------------------------------- |
|
35 // NotifierArray() |
|
36 // Lib main entry point |
|
37 // -------------------------------------------------------------------------- |
|
38 // |
|
39 EXPORT_C CArrayPtr<MEikSrvNotifierBase2>* NotifierArray() |
|
40 { |
|
41 |
|
42 CArrayPtrFlat<MEikSrvNotifierBase2>* array = NULL; |
|
43 TRAPD(err, array = new (ELeave) |
|
44 CArrayPtrFlat<MEikSrvNotifierBase2>( KPluginGranularity )); |
|
45 if (err || array == NULL) |
|
46 { |
|
47 return array; |
|
48 } |
|
49 TRAPD( err1, CreateNotifiersL( array ) ); |
|
50 if( err1 ) |
|
51 { |
|
52 TInt count = array->Count(); |
|
53 while( count-- ) |
|
54 { |
|
55 (*array)[count]->Release(); |
|
56 } |
|
57 delete array; |
|
58 array = NULL; |
|
59 } |
|
60 |
|
61 return( array ); |
|
62 } |
|
63 |
|
64 // -------------------------------------------------------------------------- |
|
65 // CreateNotifiersL() |
|
66 // -------------------------------------------------------------------------- |
|
67 // |
|
68 LOCAL_C void CreateNotifiersL( |
|
69 CArrayPtrFlat<MEikSrvNotifierBase2>* aNotifiers ) |
|
70 { |
|
71 MEikSrvNotifierBase2 *serNotify; |
|
72 TBool resourceFileResponsible = ETrue; |
|
73 |
|
74 serNotify = CWiFiProtDlgsPlugin::NewL( resourceFileResponsible ); |
|
75 CleanupStack::PushL( serNotify ); |
|
76 aNotifiers->AppendL( serNotify ); |
|
77 CleanupStack::Pop( serNotify ); |
|
78 } |
|
79 |
|
80 // End of File |