author | William Roberts <williamr@symbian.org> |
Wed, 31 Mar 2010 12:33:34 +0100 | |
branch | Symbian3 |
changeset 4 | 837f303aceeb |
parent 3 | e1b950c65cb4 |
permissions | -rw-r--r-- |
williamr@2 | 1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
williamr@2 | 2 |
// All rights reserved. |
williamr@2 | 3 |
// This component and the accompanying materials are made available |
williamr@4 | 4 |
// under the terms of "Eclipse Public License v1.0" |
williamr@2 | 5 |
// which accompanies this distribution, and is available |
williamr@4 | 6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html". |
williamr@2 | 7 |
// |
williamr@2 | 8 |
// Initial Contributors: |
williamr@2 | 9 |
// Nokia Corporation - initial contribution. |
williamr@2 | 10 |
// |
williamr@2 | 11 |
// Contributors: |
williamr@2 | 12 |
// |
williamr@2 | 13 |
// Description: |
williamr@2 | 14 |
// |
williamr@2 | 15 |
|
williamr@2 | 16 |
#ifndef __COEFONTPROVIDER_H__ |
williamr@2 | 17 |
#define __COEFONTPROVIDER_H__ |
williamr@2 | 18 |
|
williamr@2 | 19 |
#include <e32base.h> |
williamr@2 | 20 |
#include <e32def.h> |
williamr@2 | 21 |
#include <coefont.h> |
williamr@2 | 22 |
#include <coemain.h> |
williamr@2 | 23 |
#include <coeaui.h> |
williamr@4 | 24 |
|
williamr@4 | 25 |
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
williamr@2 | 26 |
#include <coecntss.h> |
williamr@4 | 27 |
#endif //SYMBIAN_ENABLE_SPLIT_HEADERS |
williamr@2 | 28 |
|
williamr@2 | 29 |
/** A helper object designed to make obtaining a font easier, taking into account |
williamr@2 | 30 |
zoom factors. |
williamr@2 | 31 |
|
williamr@2 | 32 |
@publishedAll |
williamr@2 | 33 |
@released |
williamr@2 | 34 |
*/ |
williamr@2 | 35 |
class CCoeFontProvider : public CBase |
williamr@2 | 36 |
{ |
williamr@2 | 37 |
public: // life |
williamr@2 | 38 |
IMPORT_C static CCoeFontProvider* NewL(); |
williamr@2 | 39 |
IMPORT_C static CCoeFontProvider* NewL(const TDesC& aTypefaceName); |
williamr@2 | 40 |
~CCoeFontProvider(); |
williamr@2 | 41 |
public: // methods |
williamr@2 | 42 |
IMPORT_C const CFont& Font(const TCoeFont& aFont, const TZoomFactor& aZoomFactor) const; |
williamr@2 | 43 |
public: // properties |
williamr@2 | 44 |
IMPORT_C void SetTypeface(const TTypeface aTypeface); |
williamr@2 | 45 |
IMPORT_C void UseSystemTypeface(); |
williamr@2 | 46 |
IMPORT_C TTypeface Typeface() const; |
williamr@2 | 47 |
public: //but not exported |
williamr@2 | 48 |
void RefetchPixelMappingL(); |
williamr@2 | 49 |
|
williamr@2 | 50 |
private: |
williamr@2 | 51 |
CCoeFontProvider(const TDesC& aTypefaceName); |
williamr@2 | 52 |
void ConstructL(); |
williamr@2 | 53 |
void ReleaseAllFonts(); |
williamr@2 | 54 |
private: |
williamr@2 | 55 |
class TFont |
williamr@2 | 56 |
{ |
williamr@2 | 57 |
public: |
williamr@2 | 58 |
TFont(const TCoeFont& aFontSpec, TInt aZoomFactor, const CFont* aFont = NULL); |
williamr@2 | 59 |
static TInt Compare(const TFont& aFirst, const TFont& aSecond); |
williamr@2 | 60 |
public: |
williamr@2 | 61 |
const TCoeFont iCoeFont; |
williamr@2 | 62 |
const TInt iZoomFactor; |
williamr@2 | 63 |
const CFont* iFont; |
williamr@2 | 64 |
}; |
williamr@2 | 65 |
private: |
williamr@2 | 66 |
mutable RArray<TFont> iFonts; |
williamr@2 | 67 |
TTypeface iTypeface; |
williamr@2 | 68 |
RArray<TInt> iLogicalToPixelSizes; |
williamr@2 | 69 |
}; |
williamr@2 | 70 |
|
williamr@2 | 71 |
#endif // __COEFONTPROVIDER_H__ |