lafagnosticuifoundation/animation/src/Animator.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "Animator.h"
       
    17 #include "AnimationMixins.h"
       
    18 
       
    19 #include <ecom/ecomresolverparams.h>
       
    20 #include <ecom/ecom.h>
       
    21 
       
    22 /** Locates and constructs an animator.
       
    23 
       
    24 The MAnimationDrawer passed as an argument returns a string through the
       
    25 function AnimatorDataType.  If a matching animator plugin can be found then
       
    26 it will be loaded and constructed.
       
    27 
       
    28 @param aRenderer The MAnimationDrawer implementation for the animator to use.
       
    29 @return The new animator.*/
       
    30 EXPORT_C CAnimator* CAnimator::NewL(MAnimationDrawer* aRenderer)
       
    31 	{
       
    32 	__ASSERT_ALWAYS(aRenderer != NULL, User::Leave(KErrArgument));
       
    33     TEComResolverParams resolverParams; 
       
    34     resolverParams.SetDataType(aRenderer->AnimatorDataType());
       
    35     TAny* ptr = REComSession::CreateImplementationL(KAnimatorInterfaceUid, _FOFF(CAnimator,iDtor_ID_Key), aRenderer, resolverParams);
       
    36     return reinterpret_cast<CAnimator*>(ptr);
       
    37 	}
       
    38 
       
    39 /** Destructor.*/
       
    40 EXPORT_C CAnimator::~CAnimator()
       
    41 	{
       
    42 	REComSession::DestroyedImplementation(iDtor_ID_Key);
       
    43 	}