locationsystemui/locationsysui/locverifier/src/lpddllmain.cpp
branchRCL_3
changeset 44 2b4ea9893b66
parent 42 02ba3f1733c6
child 45 6b6920c56e2f
equal deleted inserted replaced
42:02ba3f1733c6 44:2b4ea9893b66
     1 /*
       
     2 * Copyright (c) 2002 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:  Dll entry point and plugin creation functions.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "lpddllmain.h"
       
    21 #include "lpdverifierplugin.h"
       
    22 #include <e32base.h>
       
    23 #include <eiknotapi.h>
       
    24 
       
    25 // ============================= LOCAL FUNCTIONS ===============================
       
    26 
       
    27 LOCAL_C void CreateNotifiersL( 
       
    28     CArrayPtrFlat<MEikSrvNotifierBase2>* aNotifiers )
       
    29     {
       
    30     CLpdVerifierPlugin* notifier = CLpdVerifierPlugin::NewL();
       
    31     CleanupStack::PushL( notifier );
       
    32     aNotifiers->AppendL( notifier->NotifierBase() );
       
    33     CleanupStack::Pop( notifier ); // Do not destroy. This is handled by the FW.
       
    34     }
       
    35 
       
    36 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
    37 
       
    38 EXPORT_C CArrayPtr<MEikSrvNotifierBase2>* NotifierArray()
       
    39     {
       
    40     CArrayPtrFlat<MEikSrvNotifierBase2>* notifiers =
       
    41         new CArrayPtrFlat<MEikSrvNotifierBase2>( 1 );
       
    42     if ( notifiers )
       
    43         {
       
    44         TRAPD( err, CreateNotifiersL( notifiers ) );
       
    45         if ( err )
       
    46             { // release any notifiers we have created
       
    47             TInt count = notifiers->Count();
       
    48             while ( --count >= 0 )
       
    49                 {
       
    50                 ( *notifiers )[count]->Release();
       
    51                 }
       
    52             delete notifiers;
       
    53             notifiers = NULL;
       
    54             }
       
    55         }
       
    56     return notifiers;
       
    57     }
       
    58 
       
    59 
       
    60 // End of File