diff -r 666f914201fb -r 2fe1408b6811 epoc32/include/coefontprovider.h --- a/epoc32/include/coefontprovider.h Tue Nov 24 13:55:44 2009 +0000 +++ b/epoc32/include/coefontprovider.h Tue Mar 16 16:12:26 2010 +0000 @@ -1,1 +1,68 @@ -coefontprovider.h +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members +// which accompanies this distribution, and is available +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +#ifndef __COEFONTPROVIDER_H__ +#define __COEFONTPROVIDER_H__ + +#include +#include +#include +#include +#include +#include + +/** A helper object designed to make obtaining a font easier, taking into account +zoom factors. + +@publishedAll +@released +*/ +class CCoeFontProvider : public CBase + { +public: // life + IMPORT_C static CCoeFontProvider* NewL(); + IMPORT_C static CCoeFontProvider* NewL(const TDesC& aTypefaceName); + ~CCoeFontProvider(); +public: // methods + IMPORT_C const CFont& Font(const TCoeFont& aFont, const TZoomFactor& aZoomFactor) const; +public: // properties + IMPORT_C void SetTypeface(const TTypeface aTypeface); + IMPORT_C void UseSystemTypeface(); + IMPORT_C TTypeface Typeface() const; +public: //but not exported + void RefetchPixelMappingL(); + +private: + CCoeFontProvider(const TDesC& aTypefaceName); + void ConstructL(); + void ReleaseAllFonts(); +private: + class TFont + { + public: + TFont(const TCoeFont& aFontSpec, TInt aZoomFactor, const CFont* aFont = NULL); + static TInt Compare(const TFont& aFirst, const TFont& aSecond); + public: + const TCoeFont iCoeFont; + const TInt iZoomFactor; + const CFont* iFont; + }; +private: + mutable RArray iFonts; + TTypeface iTypeface; + RArray iLogicalToPixelSizes; + }; + +#endif // __COEFONTPROVIDER_H__