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