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