epoc32/include/coefontprovider.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/coefontprovider.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/coefontprovider.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,68 @@
     1.4 -coefontprovider.h
     1.5 +// Copyright (c) 1997-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.9 +// which accompanies this distribution, and is available
    1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 +//
    1.19 +
    1.20 +#ifndef __COEFONTPROVIDER_H__
    1.21 +#define __COEFONTPROVIDER_H__
    1.22 +
    1.23 +#include <e32base.h>
    1.24 +#include <e32def.h>
    1.25 +#include <coefont.h>
    1.26 +#include <coemain.h>
    1.27 +#include <coeaui.h>
    1.28 +#include <coecntss.h>
    1.29 +
    1.30 +/** A helper object designed to make obtaining a font easier, taking into account
    1.31 +zoom factors.
    1.32 +
    1.33 +@publishedAll
    1.34 +@released
    1.35 +*/
    1.36 +class CCoeFontProvider : public CBase 
    1.37 +        { 
    1.38 +public:        // life 
    1.39 +        IMPORT_C static CCoeFontProvider* NewL(); 
    1.40 +        IMPORT_C static CCoeFontProvider* NewL(const TDesC& aTypefaceName); 
    1.41 +        ~CCoeFontProvider(); 
    1.42 +public:        // methods 
    1.43 +        IMPORT_C const CFont& Font(const TCoeFont& aFont, const TZoomFactor& aZoomFactor) const; 
    1.44 +public:        // properties                 
    1.45 +        IMPORT_C void SetTypeface(const TTypeface aTypeface); 
    1.46 +        IMPORT_C void UseSystemTypeface(); 
    1.47 +        IMPORT_C TTypeface Typeface() const;
    1.48 +public:			//but not exported
    1.49 +		void RefetchPixelMappingL();
    1.50 +
    1.51 +private: 
    1.52 +        CCoeFontProvider(const TDesC& aTypefaceName); 
    1.53 +        void ConstructL(); 
    1.54 +        void ReleaseAllFonts(); 
    1.55 +private: 
    1.56 +        class TFont 
    1.57 +                { 
    1.58 +        public: 
    1.59 +                TFont(const TCoeFont& aFontSpec, TInt aZoomFactor, const CFont* aFont = NULL); 
    1.60 +                static TInt Compare(const TFont& aFirst, const TFont& aSecond); 
    1.61 +        public: 
    1.62 +                const TCoeFont iCoeFont; 
    1.63 +                const TInt iZoomFactor; 
    1.64 +                const CFont* iFont; 
    1.65 +                }; 
    1.66 +private: 
    1.67 +        mutable RArray<TFont> iFonts; 
    1.68 +        TTypeface iTypeface; 
    1.69 +        RArray<TInt> iLogicalToPixelSizes; 
    1.70 +        }; 
    1.71 +
    1.72 +#endif	// __COEFONTPROVIDER_H__