os/textandloc/fontservices/textshaperplugin/source/shaper.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/textandloc/fontservices/textshaperplugin/source/shaper.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,97 @@
     1.4 +/*
     1.5 +* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description: 
    1.18 +* Abstract base class from which all shapers drive.
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +/**
    1.24 + @file 
    1.25 + @internalComponent
    1.26 +*/
    1.27 +
    1.28 +// Symbian includes
    1.29 +#include <openfont.h>
    1.30 +
    1.31 +// ICU includes 
    1.32 +#include "LETypes.h"
    1.33 +#include "LayoutEngine.h"
    1.34 +#include "SymbianFontInstance.h"
    1.35 +#include "IcuLayoutEngine.h"
    1.36 +#include <ecom/ecom.h>
    1.37 +#include <ecom/implementationproxy.h>
    1.38 +
    1.39 +
    1.40 +class CIcuShaperFactory: public CShaperFactory
    1.41 +	{
    1.42 +public:
    1.43 +	static CIcuShaperFactory* NewL();
    1.44 +	virtual ~CIcuShaperFactory();
    1.45 +
    1.46 +   /**
    1.47 +	Factory function to create an instance of shaper object
    1.48 +    @param aBitmapFont The font that requires shaping
    1.49 +    @param aScript Isic standard script code
    1.50 +    @param aLanguage Isic standard language code
    1.51 +    @param aHeap The heap to be used by the shaper
    1.52 +    @return KErrNone if successful else a system wide error code
    1.53 +    */
    1.54 +	virtual CShaper* NewShaperL(CBitmapFont* aBitmapFont, TInt aScript, TInt aLanguage, RHeap* aHeap);
    1.55 +
    1.56 +private:
    1.57 +	CIcuShaperFactory();
    1.58 +
    1.59 +	};
    1.60 +
    1.61 +
    1.62 +CIcuShaperFactory* CIcuShaperFactory::NewL()
    1.63 +	{
    1.64 +	CIcuShaperFactory* r = new(ELeave) CIcuShaperFactory;
    1.65 +	return r;
    1.66 +	}
    1.67 +
    1.68 +CIcuShaperFactory::CIcuShaperFactory()
    1.69 +	{
    1.70 +	}
    1.71 +
    1.72 +CIcuShaperFactory::~CIcuShaperFactory()
    1.73 +	{
    1.74 +	
    1.75 +	}
    1.76 +
    1.77 +
    1.78 +CShaper* CIcuShaperFactory::NewShaperL(CBitmapFont* aBitmapFont, TInt aScript, TInt aLanguage, RHeap* aHeap)
    1.79 +	{
    1.80 +	return CIcuLayoutEngine::NewL(aBitmapFont, aScript, aLanguage, aHeap);
    1.81 +	} 
    1.82 +
    1.83 +void* CShaperFactory::ExtendedInterface(TUid /*aInterfaceId*/)
    1.84 +	{
    1.85 +	return 0;
    1.86 +	}
    1.87 +
    1.88 +// Exported proxy for instantiation method resolution
    1.89 +// Define the interface UIDs
    1.90 +const TImplementationProxy ImplementationTable[] = 
    1.91 +	{
    1.92 +		IMPLEMENTATION_PROXY_ENTRY(0x10279727,	CIcuShaperFactory::NewL)
    1.93 +	};
    1.94 +
    1.95 +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
    1.96 +	{
    1.97 +	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
    1.98 +
    1.99 +	return ImplementationTable;
   1.100 +	}