idlehomescreen/xmluirendering/renderingplugins/xnanimationfactory/src/xnanimationfactory.cpp
changeset 4 4d54b72983ae
equal deleted inserted replaced
3:fb3763350a08 4:4d54b72983ae
       
     1 /*
       
     2 * Copyright (c) 2002-2006 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:  Implementation for factory creating container for Active Idle plugins.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <coecntrl.h>
       
    21 #include <barsread.h>
       
    22 
       
    23 #include "xntype.h"
       
    24 #include "xncomponent.h"
       
    25 #include "xnnodepluginif.h"
       
    26 #include "xnanimationfactory.h"
       
    27 #include "xnanimationadapter.h"
       
    28 #include "xnanimation.h"
       
    29 #include <aisystemuids.hrh>
       
    30 
       
    31 // ============================ MEMBER FUNCTIONS ===============================
       
    32 
       
    33 
       
    34 _LIT8(KXnAnimation, "animation");
       
    35 // -----------------------------------------------------------------------------
       
    36 // CXnAnimationFactory::MakeXnComponentL
       
    37 // -----------------------------------------------------------------------------
       
    38 //
       
    39 
       
    40 MXnComponentFactory::TXnComponentFactoryResponse CXnAnimationFactory::MakeXnComponentL( 
       
    41                                         CXnNodePluginIf& aNode,
       
    42                                         CXnComponent*& aTargetComponent
       
    43 										)
       
    44     {
       
    45     MXnComponentFactory::TXnComponentFactoryResponse retVal = MXnComponentFactory::EXnFactoryResponseComponentNotSupported;
       
    46     // Check that the given type of a control is parent (or ancestor) of this control
       
    47     if (aNode.Type()->Type() == KXnAnimation)
       
    48         {
       
    49         aTargetComponent = CXnAnimation::NewL();
       
    50         retVal = MXnComponentFactory::EXnFactoryResponseComponentConstructed;
       
    51 	    }
       
    52     return retVal;
       
    53     }
       
    54 
       
    55 // -----------------------------------------------------------------------------
       
    56 // CXnAnimationFactory::MakeXnControlAdapterL
       
    57 // -----------------------------------------------------------------------------
       
    58 //
       
    59 
       
    60 CXnControlAdapter* CXnAnimationFactory::MakeXnControlAdapterL( 
       
    61                                         CXnNodePluginIf& aNode,
       
    62                                         CXnControlAdapter* /*aParent*/
       
    63 										)
       
    64     {
       
    65     return CXnAnimationAdapter::NewL(aNode);
       
    66     }
       
    67 
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // CXnAnimationFactory::NewL
       
    71 // Two-phased constructor.
       
    72 // -----------------------------------------------------------------------------
       
    73 //
       
    74 CXnAnimationFactory* CXnAnimationFactory::NewL()
       
    75     {
       
    76     CXnAnimationFactory* self = new( ELeave ) CXnAnimationFactory;
       
    77     
       
    78     CleanupStack::PushL( self );
       
    79     self->ConstructL();
       
    80     CleanupStack::Pop();
       
    81 
       
    82     return self;
       
    83     }
       
    84 
       
    85 // -----------------------------------------------------------------------------
       
    86 // CXnAnimationFactory::CXnAnimationFactory
       
    87 // C++ default constructor can NOT contain any code, that
       
    88 // might leave.
       
    89 // -----------------------------------------------------------------------------
       
    90 //
       
    91 CXnAnimationFactory::CXnAnimationFactory()
       
    92     {
       
    93     }
       
    94 
       
    95 // -----------------------------------------------------------------------------
       
    96 // CXnAnimationFactory::~CXnAnimationFactory
       
    97 // Destructor.
       
    98 // -----------------------------------------------------------------------------
       
    99 //
       
   100 CXnAnimationFactory::~CXnAnimationFactory()
       
   101     {
       
   102     }
       
   103 
       
   104 // -----------------------------------------------------------------------------
       
   105 // CXnAnimationFactory::ConstructL
       
   106 // Symbian 2nd phase constructor can leave.
       
   107 // -----------------------------------------------------------------------------
       
   108 //
       
   109 void CXnAnimationFactory::ConstructL()
       
   110     {
       
   111     }
       
   112 
       
   113 
       
   114 // Define the interface UIDs
       
   115 const TImplementationProxy ImplementationTable[] =
       
   116     {
       
   117     #ifdef __EABI__ 
       
   118     	IMPLEMENTATION_PROXY_ENTRY(AI3_UID_RENDERING_PLUGIN_ANIMATIONFACTORY_IMPLEMENTATION, CXnAnimationFactory::NewL)
       
   119     #else
       
   120         {{AI3_UID_RENDERING_PLUGIN_ANIMATIONFACTORY_IMPLEMENTATION}, CXnAnimationFactory::NewL}
       
   121     #endif
       
   122     };
       
   123 
       
   124 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
       
   125     {
       
   126     aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
       
   127 
       
   128     return ImplementationTable;
       
   129     }