pkiutilities/securitydialognotifier/src/securitydialogmain.cpp
author hgs
Fri, 20 Aug 2010 11:27:50 +0300
changeset 48 6ed68423b759
permissions -rw-r--r--
201033_01
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
48
6ed68423b759 201033_01
hgs
parents:
diff changeset
     1
/*
6ed68423b759 201033_01
hgs
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
6ed68423b759 201033_01
hgs
parents:
diff changeset
     3
* All rights reserved.
6ed68423b759 201033_01
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
6ed68423b759 201033_01
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
6ed68423b759 201033_01
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
6ed68423b759 201033_01
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
6ed68423b759 201033_01
hgs
parents:
diff changeset
     8
*
6ed68423b759 201033_01
hgs
parents:
diff changeset
     9
* Initial Contributors:
6ed68423b759 201033_01
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
6ed68423b759 201033_01
hgs
parents:
diff changeset
    11
*
6ed68423b759 201033_01
hgs
parents:
diff changeset
    12
* Contributors:
6ed68423b759 201033_01
hgs
parents:
diff changeset
    13
*
6ed68423b759 201033_01
hgs
parents:
diff changeset
    14
* Description:  Security Dialog notifier entry point
6ed68423b759 201033_01
hgs
parents:
diff changeset
    15
*
6ed68423b759 201033_01
hgs
parents:
diff changeset
    16
*/
6ed68423b759 201033_01
hgs
parents:
diff changeset
    17
6ed68423b759 201033_01
hgs
parents:
diff changeset
    18
#include "securitydialognotifier.h"         // CSecurityDialogNotifier
6ed68423b759 201033_01
hgs
parents:
diff changeset
    19
#include <ecom/implementationproxy.h>       // TImplementationProxy definition
6ed68423b759 201033_01
hgs
parents:
diff changeset
    20
6ed68423b759 201033_01
hgs
parents:
diff changeset
    21
const TInt KNumberOfImplementations = 1;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    22
6ed68423b759 201033_01
hgs
parents:
diff changeset
    23
6ed68423b759 201033_01
hgs
parents:
diff changeset
    24
// ----------------------------------------------------------------------------
6ed68423b759 201033_01
hgs
parents:
diff changeset
    25
// CreateNotifiersL()
6ed68423b759 201033_01
hgs
parents:
diff changeset
    26
// ----------------------------------------------------------------------------
6ed68423b759 201033_01
hgs
parents:
diff changeset
    27
//
6ed68423b759 201033_01
hgs
parents:
diff changeset
    28
void CreateNotifiersL( CArrayPtr<MEikSrvNotifierBase2>& aNotifierArray )
6ed68423b759 201033_01
hgs
parents:
diff changeset
    29
    {
6ed68423b759 201033_01
hgs
parents:
diff changeset
    30
    CSecurityDialogNotifier* notifier = CSecurityDialogNotifier::NewL();
6ed68423b759 201033_01
hgs
parents:
diff changeset
    31
    CleanupStack::PushL( notifier );
6ed68423b759 201033_01
hgs
parents:
diff changeset
    32
    aNotifierArray.AppendL( notifier );
6ed68423b759 201033_01
hgs
parents:
diff changeset
    33
    CleanupStack::Pop( notifier );
6ed68423b759 201033_01
hgs
parents:
diff changeset
    34
    }
6ed68423b759 201033_01
hgs
parents:
diff changeset
    35
6ed68423b759 201033_01
hgs
parents:
diff changeset
    36
// ----------------------------------------------------------------------------
6ed68423b759 201033_01
hgs
parents:
diff changeset
    37
// NotifierArray()
6ed68423b759 201033_01
hgs
parents:
diff changeset
    38
// ----------------------------------------------------------------------------
6ed68423b759 201033_01
hgs
parents:
diff changeset
    39
//
6ed68423b759 201033_01
hgs
parents:
diff changeset
    40
CArrayPtr<MEikSrvNotifierBase2>* NotifierArray()
6ed68423b759 201033_01
hgs
parents:
diff changeset
    41
    {
6ed68423b759 201033_01
hgs
parents:
diff changeset
    42
    CArrayPtr<MEikSrvNotifierBase2>* notifierArray =
6ed68423b759 201033_01
hgs
parents:
diff changeset
    43
        new CArrayPtrFlat<MEikSrvNotifierBase2>( KNumberOfImplementations );
6ed68423b759 201033_01
hgs
parents:
diff changeset
    44
    if( notifierArray )
6ed68423b759 201033_01
hgs
parents:
diff changeset
    45
        {
6ed68423b759 201033_01
hgs
parents:
diff changeset
    46
        TRAPD( err, CreateNotifiersL( *notifierArray ) );
6ed68423b759 201033_01
hgs
parents:
diff changeset
    47
        if( err )
6ed68423b759 201033_01
hgs
parents:
diff changeset
    48
            {
6ed68423b759 201033_01
hgs
parents:
diff changeset
    49
            TInt count = notifierArray->Count();
6ed68423b759 201033_01
hgs
parents:
diff changeset
    50
            while( count-- )
6ed68423b759 201033_01
hgs
parents:
diff changeset
    51
                {
6ed68423b759 201033_01
hgs
parents:
diff changeset
    52
                (*notifierArray)[ count ]->Release();
6ed68423b759 201033_01
hgs
parents:
diff changeset
    53
                }
6ed68423b759 201033_01
hgs
parents:
diff changeset
    54
            delete notifierArray;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    55
            notifierArray = NULL;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    56
            }
6ed68423b759 201033_01
hgs
parents:
diff changeset
    57
        }
6ed68423b759 201033_01
hgs
parents:
diff changeset
    58
    return notifierArray;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    59
    }
6ed68423b759 201033_01
hgs
parents:
diff changeset
    60
6ed68423b759 201033_01
hgs
parents:
diff changeset
    61
// ----------------------------------------------------------------------------
6ed68423b759 201033_01
hgs
parents:
diff changeset
    62
// Provides a key value pair table, that ECOM uses to identify
6ed68423b759 201033_01
hgs
parents:
diff changeset
    63
// the correct construction function for the requested interface.
6ed68423b759 201033_01
hgs
parents:
diff changeset
    64
// ----------------------------------------------------------------------------
6ed68423b759 201033_01
hgs
parents:
diff changeset
    65
//
6ed68423b759 201033_01
hgs
parents:
diff changeset
    66
const TImplementationProxy ImplementationTable[] =
6ed68423b759 201033_01
hgs
parents:
diff changeset
    67
    {
6ed68423b759 201033_01
hgs
parents:
diff changeset
    68
    // UID is the implementation uid defined in .rss file
6ed68423b759 201033_01
hgs
parents:
diff changeset
    69
    IMPLEMENTATION_PROXY_ENTRY( 0x101F883C, NotifierArray )
6ed68423b759 201033_01
hgs
parents:
diff changeset
    70
    };
6ed68423b759 201033_01
hgs
parents:
diff changeset
    71
6ed68423b759 201033_01
hgs
parents:
diff changeset
    72
// ----------------------------------------------------------------------------
6ed68423b759 201033_01
hgs
parents:
diff changeset
    73
// Main entry function used to return an instance of the proxy table.
6ed68423b759 201033_01
hgs
parents:
diff changeset
    74
// ----------------------------------------------------------------------------
6ed68423b759 201033_01
hgs
parents:
diff changeset
    75
//
6ed68423b759 201033_01
hgs
parents:
diff changeset
    76
EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
6ed68423b759 201033_01
hgs
parents:
diff changeset
    77
    {
6ed68423b759 201033_01
hgs
parents:
diff changeset
    78
    aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
6ed68423b759 201033_01
hgs
parents:
diff changeset
    79
    return ImplementationTable;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    80
    }