eventsui/eventshandlerui/eventsnotifier/evtinfonote/src/evtinfonoteinterface.cpp
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     1 /*
       
     2 * Copyright (c) 2008 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:  Interface class for Events Info Note DLL
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // System Includes
       
    20 #include <eikenv.h>
       
    21 #include <eiknotapi.h>
       
    22 
       
    23 // User Includes
       
    24 #include "evtinfonote.h"
       
    25 #include "evtdebug.h"
       
    26 
       
    27 // Constant Definitions
       
    28 
       
    29 // CONSTANTS
       
    30 const TInt KEvtInfoNoteArrayIncrement = 2;
       
    31 
       
    32 
       
    33 // ----------------------- Local Functions -----------------------------------
       
    34 
       
    35 // ---------------------------------------------------------
       
    36 // LOCAL_C void CreateEventsInfoNoteNotifiersL
       
    37 // Instantiates all the components of Events Info Note
       
    38 // notifiers
       
    39 // ---------------------------------------------------------
       
    40 LOCAL_C void CreateEventsInfoNoteNotifiersL( 
       
    41                     CArrayPtrFlat< MEikSrvNotifierBase2 >* aNotifiers )
       
    42     {      
       
    43     // Create the Trigger Event fire info note
       
    44     CEvtInfoNote* infoNote = CEvtInfoNote::NewL();
       
    45     CleanupStack::PushL( infoNote );
       
    46     aNotifiers->AppendL( infoNote );
       
    47     CleanupStack::Pop( infoNote );  
       
    48     }
       
    49 
       
    50 // ------------------------- Global Functions -----------------------------------
       
    51 
       
    52 // ---------------------------------------------------------
       
    53 // EXPORT_C CArrayPtr< MEikSrvNotifierBase2 >* NotifierArray
       
    54 // Polymorphic DLL entry point
       
    55 // ---------------------------------------------------------
       
    56 
       
    57 EXPORT_C CArrayPtr< MEikSrvNotifierBase2 >* NotifierArray()
       
    58     {
       
    59 	EVTUIDEBUG( "+ CEvtInfoNoteInterface::NotifierArray" );
       
    60     CArrayPtrFlat< MEikSrvNotifierBase2 >* notifiers = NULL;
       
    61 	TRAPD( err, notifiers = 
       
    62 	           new CArrayPtrFlat< MEikSrvNotifierBase2 >( KEvtInfoNoteArrayIncrement ));
       
    63 	if ( !err && notifiers )
       
    64     	{
       
    65     	TRAPD( err, CreateEventsInfoNoteNotifiersL( notifiers ));
       
    66     	if( err )
       
    67         	{
       
    68         	TInt count = notifiers->Count();
       
    69         	while( count-- )
       
    70         	    {
       
    71         	    ( *notifiers )[ count ]->Release();
       
    72         	    }           	
       
    73         	delete notifiers;
       
    74         	notifiers = NULL;
       
    75         	}   	    
       
    76     	}           
       
    77 	EVTUIDEBUG( "- CEvtInfoNoteInterface::NotifierArray" );
       
    78     return notifiers;
       
    79     }