classicui_plat/avkon_testability_api/inc/TasTraversePluginInterface.inl
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 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:  Avkon traverse ECom plugin interface definition.  
       
    15 *               Implementation for ECom instantiation functionality.
       
    16 *
       
    17 */
       
    18 
       
    19 // SYSTEm INCLUDE
       
    20 #include <ecom/implementationinformation.h>
       
    21 
       
    22 // USER INCLUDES
       
    23 #include "AknTasPluginInterface.h"
       
    24 
       
    25 // Interface's (abstract base class's) static factory method implementation.
       
    26 // Asks ECOM plugin framework to instantiate appropriate concret plugin
       
    27 // implementation.
       
    28 inline CTasTraversePluginInterface*
       
    29 CTasTraversePluginInterface::NewL(const TDesC8& aTraverseObjectName, CAknTasPluginInterface * aAknTasPluginInterface )
       
    30     {
       
    31     // This NewL uses default resolver, which just compares given
       
    32     // aTraverseObjectName and default_data string in the implementation
       
    33     // resource file.
       
    34 
       
    35     // Define options, how the default resolver will find appropriate
       
    36     // implementation.
       
    37     TEComResolverParams resolverParams;
       
    38     resolverParams.SetDataType(aTraverseObjectName);
       
    39     resolverParams.SetWildcardMatch(ETrue);     // Allow wildcard matching
       
    40 
       
    41     // Find implementation for our interface.
       
    42     // - KTasTraversePluginInterfaceUid is the UID of our custom ECOM
       
    43     //   interface. It is defined in TasTraversePluginInterface.h
       
    44     // - This call will leave, if the plugin architecture cannot find
       
    45     //   implementation.
       
    46     // - The returned pointer points to one of our interface implementation
       
    47     //   instances.
       
    48     TAny* ptr = REComSession::CreateImplementationL(
       
    49         KTasTraversePluginInterfaceUid,
       
    50         _FOFF(CTasTraversePluginInterface,iImplementation),
       
    51                 // _FOFF specifies offset of iImplementation so that
       
    52                 // ECOM framework can update its value.
       
    53         resolverParams);
       
    54 
       
    55     // The type of TAny* ptr should be CTasTraversePluginInterface.
       
    56     CTasTraversePluginInterface* traverseInterface = REINTERPRET_CAST(CTasTraversePluginInterface*, ptr);
       
    57     
       
    58     // Set the CAknTasPluginInterface pointer
       
    59     traverseInterface->iAknTasPluginInterface = aAknTasPluginInterface;
       
    60     traverseInterface->iAknTasTraverseObjectName.Set( aTraverseObjectName);
       
    61    
       
    62     
       
    63     return traverseInterface;
       
    64     }
       
    65 
       
    66 
       
    67 inline CTasTraversePluginInterface::~CTasTraversePluginInterface()
       
    68     {
       
    69     REComSession::DestroyedImplementation( iImplementation );
       
    70     }
       
    71 
       
    72 
       
    73 // End of File