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