os/textandloc/fontservices/textshaperplugin/source/shaper.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2006-2009 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: 
    15 * Abstract base class from which all shapers drive.
    16 *
    17 */
    18 
    19 
    20 /**
    21  @file 
    22  @internalComponent
    23 */
    24 
    25 // Symbian includes
    26 #include <openfont.h>
    27 
    28 // ICU includes 
    29 #include "LETypes.h"
    30 #include "LayoutEngine.h"
    31 #include "SymbianFontInstance.h"
    32 #include "IcuLayoutEngine.h"
    33 #include <ecom/ecom.h>
    34 #include <ecom/implementationproxy.h>
    35 
    36 
    37 class CIcuShaperFactory: public CShaperFactory
    38 	{
    39 public:
    40 	static CIcuShaperFactory* NewL();
    41 	virtual ~CIcuShaperFactory();
    42 
    43    /**
    44 	Factory function to create an instance of shaper object
    45     @param aBitmapFont The font that requires shaping
    46     @param aScript Isic standard script code
    47     @param aLanguage Isic standard language code
    48     @param aHeap The heap to be used by the shaper
    49     @return KErrNone if successful else a system wide error code
    50     */
    51 	virtual CShaper* NewShaperL(CBitmapFont* aBitmapFont, TInt aScript, TInt aLanguage, RHeap* aHeap);
    52 
    53 private:
    54 	CIcuShaperFactory();
    55 
    56 	};
    57 
    58 
    59 CIcuShaperFactory* CIcuShaperFactory::NewL()
    60 	{
    61 	CIcuShaperFactory* r = new(ELeave) CIcuShaperFactory;
    62 	return r;
    63 	}
    64 
    65 CIcuShaperFactory::CIcuShaperFactory()
    66 	{
    67 	}
    68 
    69 CIcuShaperFactory::~CIcuShaperFactory()
    70 	{
    71 	
    72 	}
    73 
    74 
    75 CShaper* CIcuShaperFactory::NewShaperL(CBitmapFont* aBitmapFont, TInt aScript, TInt aLanguage, RHeap* aHeap)
    76 	{
    77 	return CIcuLayoutEngine::NewL(aBitmapFont, aScript, aLanguage, aHeap);
    78 	} 
    79 
    80 void* CShaperFactory::ExtendedInterface(TUid /*aInterfaceId*/)
    81 	{
    82 	return 0;
    83 	}
    84 
    85 // Exported proxy for instantiation method resolution
    86 // Define the interface UIDs
    87 const TImplementationProxy ImplementationTable[] = 
    88 	{
    89 		IMPLEMENTATION_PROXY_ENTRY(0x10279727,	CIcuShaperFactory::NewL)
    90 	};
    91 
    92 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
    93 	{
    94 	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
    95 
    96 	return ImplementationTable;
    97 	}