meetingrequest/mrpolicy/inc/cmrpolicyresolver.inl
branchRCL_3
changeset 12 4ce476e64c59
equal deleted inserted replaced
11:0396474f30f5 12:4ce476e64c59
       
     1 /*
       
     2 * Copyright (c) 2007-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 "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 definition for MR policy resolver ECom interface
       
    15 *
       
    16 */
       
    17 
       
    18 #include <e32def.h>
       
    19 #include <ecom/ecom.h>
       
    20 #include "esmrinternaluid.h"
       
    21 
       
    22 inline CMRPolicyResolver* CMRPolicyResolver::NewL( TESMRCalendarEventType aType )
       
    23     {
       
    24     TAny* impl = NULL;
       
    25     
       
    26     switch ( aType )
       
    27         {
       
    28         case EESMREventTypeAppt:
       
    29         case EESMREventTypeETodo:
       
    30         case EESMREventTypeEEvent:
       
    31         case EESMREventTypeEReminder:
       
    32         case EESMREventTypeEAnniv:
       
    33             {
       
    34             impl = REComSession::CreateImplementationL(
       
    35                     TUid::Uid( KMRCalEntryPolicyImplementationUID ), 
       
    36                     _FOFF( CMRPolicyResolver, iDtor_ID_Key ) );
       
    37             break;
       
    38             }
       
    39         case EESMREventTypeMeetingRequest:
       
    40             {
       
    41             impl = REComSession::CreateImplementationL(
       
    42                     TUid::Uid( KMREntryPolicyImplementationUID ), 
       
    43                     _FOFF( CMRPolicyResolver, iDtor_ID_Key ) );
       
    44             break;
       
    45             }
       
    46         default:
       
    47             {
       
    48             ASSERT( EFalse ); // ASSERT for debug builds
       
    49             User::Leave( KErrNotSupported );
       
    50             }
       
    51         }
       
    52     
       
    53     return static_cast< CMRPolicyResolver* >( impl );
       
    54     }
       
    55 
       
    56 inline CMRPolicyResolver::~CMRPolicyResolver()
       
    57     {
       
    58     REComSession::DestroyedImplementation( iDtor_ID_Key );
       
    59     }