pkiutilities/securitydialognotifier/src/securitydialogmain.cpp
changeset 48 6ed68423b759
equal deleted inserted replaced
44:eb08ec9af6e4 48:6ed68423b759
       
     1 /*
       
     2 * Copyright (c) 2010 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:  Security Dialog notifier entry point
       
    15 *
       
    16 */
       
    17 
       
    18 #include "securitydialognotifier.h"         // CSecurityDialogNotifier
       
    19 #include <ecom/implementationproxy.h>       // TImplementationProxy definition
       
    20 
       
    21 const TInt KNumberOfImplementations = 1;
       
    22 
       
    23 
       
    24 // ----------------------------------------------------------------------------
       
    25 // CreateNotifiersL()
       
    26 // ----------------------------------------------------------------------------
       
    27 //
       
    28 void CreateNotifiersL( CArrayPtr<MEikSrvNotifierBase2>& aNotifierArray )
       
    29     {
       
    30     CSecurityDialogNotifier* notifier = CSecurityDialogNotifier::NewL();
       
    31     CleanupStack::PushL( notifier );
       
    32     aNotifierArray.AppendL( notifier );
       
    33     CleanupStack::Pop( notifier );
       
    34     }
       
    35 
       
    36 // ----------------------------------------------------------------------------
       
    37 // NotifierArray()
       
    38 // ----------------------------------------------------------------------------
       
    39 //
       
    40 CArrayPtr<MEikSrvNotifierBase2>* NotifierArray()
       
    41     {
       
    42     CArrayPtr<MEikSrvNotifierBase2>* notifierArray =
       
    43         new CArrayPtrFlat<MEikSrvNotifierBase2>( KNumberOfImplementations );
       
    44     if( notifierArray )
       
    45         {
       
    46         TRAPD( err, CreateNotifiersL( *notifierArray ) );
       
    47         if( err )
       
    48             {
       
    49             TInt count = notifierArray->Count();
       
    50             while( count-- )
       
    51                 {
       
    52                 (*notifierArray)[ count ]->Release();
       
    53                 }
       
    54             delete notifierArray;
       
    55             notifierArray = NULL;
       
    56             }
       
    57         }
       
    58     return notifierArray;
       
    59     }
       
    60 
       
    61 // ----------------------------------------------------------------------------
       
    62 // Provides a key value pair table, that ECOM uses to identify
       
    63 // the correct construction function for the requested interface.
       
    64 // ----------------------------------------------------------------------------
       
    65 //
       
    66 const TImplementationProxy ImplementationTable[] =
       
    67     {
       
    68     // UID is the implementation uid defined in .rss file
       
    69     IMPLEMENTATION_PROXY_ENTRY( 0x101F883C, NotifierArray )
       
    70     };
       
    71 
       
    72 // ----------------------------------------------------------------------------
       
    73 // Main entry function used to return an instance of the proxy table.
       
    74 // ----------------------------------------------------------------------------
       
    75 //
       
    76 EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
       
    77     {
       
    78     aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
       
    79     return ImplementationTable;
       
    80     }