Update contrib.
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
22 class CFbsBitmapDevice;
28 enum TBandingDirection
40 class CBandedDevice : public CGraphicsDevice
43 IMPORT_C ~CBandedDevice();
44 IMPORT_C static CBandedDevice* NewL(TRect aRectInPixels, TSize aKPixelSizeInTwips, TDisplayMode aDisplayMode, TBandingDirection aBandingDirection = EBandingTopToBottom, TInt aScanLinesPerBand = 0);
46 IMPORT_C TInt HorizontalTwipsToPixels(TInt aTwips) const;
47 IMPORT_C TInt VerticalTwipsToPixels(TInt aTwips) const;
48 IMPORT_C TInt HorizontalPixelsToTwips(TInt aPixels) const;
49 IMPORT_C TInt VerticalPixelsToTwips(TInt aPixels) const;
50 IMPORT_C virtual TInt GetNearestFontInTwips(CFont*& aFont, const TFontSpec& aFontSpec);
51 IMPORT_C virtual TInt GetNearestFontToDesignHeightInTwips(CFont*& aFont, const TFontSpec& aFontSpec);
52 IMPORT_C virtual TInt GetNearestFontToMaxHeightInTwips(CFont*& aFont, const TFontSpec& aFontSpec, TInt aMaxHeight);
53 IMPORT_C void ReleaseFont(CFont* aFont);
55 IMPORT_C TDisplayMode DisplayMode() const;
56 IMPORT_C TSize SizeInPixels() const;
57 IMPORT_C TSize SizeInTwips() const;
58 IMPORT_C TInt CreateContext(CGraphicsContext*& aGC);
59 IMPORT_C TInt NumTypefaces() const;
60 IMPORT_C void TypefaceSupport(TTypefaceSupport& aTypefaceSupport, TInt aTypefaceIndex) const;
61 IMPORT_C TInt FontHeightInTwips(TInt aTypefaceIndex, TInt aHeightIndex) const;
62 IMPORT_C void PaletteAttributes(TBool& aModifiable, TInt& aNumEntries) const;
63 IMPORT_C void SetPalette(CPalette* aPalette);
64 IMPORT_C TInt GetPalette(CPalette*& aPalette) const;
66 IMPORT_C TInt NumBands() const;
67 IMPORT_C TInt NextBand();
68 IMPORT_C TRect BandRect() const;
69 IMPORT_C TPoint FullOriginToBandOrigin(const TPoint& aPoint) const;
70 IMPORT_C void Reset();
72 inline TBandingDirection BandingDirection() const {return iBandingDirection;}
73 inline CFbsBitmap* BandBitmap() const {return iBandBitmap;}
76 CBandedDevice(TRect aRectInPixels, TBandingDirection aBandingDirection, TInt aScanLinesPerBand);
77 void ConstructL(TDisplayMode aDisplayMode, TSize aKPixelSizeInTwips);
80 TRect iFullRectInPixels;
81 TInt iScanLinesPerBand;
83 CFbsBitmap* iBandBitmap;
84 CFbsBitmapDevice* iBandBitmapDevice;
86 TBandingDirection iBandingDirection;