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