phoneapp/phoneuiview/inc/c3dringingtoneinterface.inl
branchRCL_3
changeset 25 5266b1f337bd
parent 0 5f000ab63145
child 26 8baf28733c3d
equal deleted inserted replaced
24:41a7f70b3818 25:5266b1f337bd
       
     1 /*
       
     2 * Copyright (c) 2005,2007 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:  Inline functions for C3DRingingToneInterface class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include    <ECom/ECom.h>
       
    22 
       
    23 // CONSTANTS
       
    24 _LIT8( KCoUtlResolverData, "default" );
       
    25 
       
    26 
       
    27 // ============================ MEMBER FUNCTIONS ===============================
       
    28  
       
    29 // -----------------------------------------------------------------------------
       
    30 // C3DRingingToneInterface::NewL
       
    31 // ECom is used to create instance.
       
    32 // -----------------------------------------------------------------------------
       
    33 //
       
    34 inline C3DRingingToneInterface* C3DRingingToneInterface::NewL( TUid /*aImplementationUid*/ )
       
    35     {
       
    36     
       
    37     const TUid K3DRingingToneInterfaceDefinitionUid = 
       
    38         { K3DRingingToneInterfaceUid };
       
    39 
       
    40     TEComResolverParams params;
       
    41     params.SetDataType( KCoUtlResolverData );
       
    42     params.SetWildcardMatch( EFalse );
       
    43  
       
    44     RImplInfoPtrArray pluginArray;
       
    45     //List all plugins which implement C3DRingingToneInterface
       
    46     REComSession::ListImplementationsL( K3DRingingToneInterfaceDefinitionUid, pluginArray );
       
    47 
       
    48     if( pluginArray.Count() )
       
    49         {
       
    50         TAny* ptr = 
       
    51             REComSession::CreateImplementationL(
       
    52                 K3DRingingToneInterfaceDefinitionUid,
       
    53                 _FOFF( C3DRingingToneInterface, iDtor_ID_Key ), 
       
    54                 NULL,
       
    55                 params );
       
    56  
       
    57         pluginArray.ResetAndDestroy(); 
       
    58         return reinterpret_cast< C3DRingingToneInterface* >( ptr );
       
    59         }
       
    60     else
       
    61         {
       
    62         return NULL;
       
    63         }   
       
    64     }
       
    65 
       
    66 
       
    67 // -----------------------------------------------------------------------------
       
    68 // C3DRingingToneInterface::~C3DRingingToneInterface
       
    69 // ECom is used to delete instance..
       
    70 // REComSession::FinalClose() in the application which loads this plugin
       
    71 // -----------------------------------------------------------------------------
       
    72 
       
    73 inline C3DRingingToneInterface::~C3DRingingToneInterface()
       
    74     {
       
    75     REComSession::DestroyedImplementation( iDtor_ID_Key );
       
    76     }
       
    77 
       
    78         
       
    79 //  End of File