1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/printingservices/printerdriversupport/inc/BANDDEV.H Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,89 @@
1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#ifndef BANDDEV_H
1.20 +#define BANDDEV_H
1.21 +
1.22 +#include <e32std.h>
1.23 +#include <gdi.h>
1.24 +
1.25 +class CFbsBitmapDevice;
1.26 +class CFbsBitGc;
1.27 +
1.28 +/**
1.29 + @publishedAll
1.30 +*/
1.31 +enum TBandingDirection
1.32 + {
1.33 + EBandingTopToBottom,
1.34 + EBandingBottomToTop,
1.35 + EBandingLeftToRight,
1.36 + EBandingRightToLeft
1.37 + };
1.38 +
1.39 +/**
1.40 + @publishedAll
1.41 + @released
1.42 + */
1.43 +class CBandedDevice : public CGraphicsDevice
1.44 + {
1.45 +public:
1.46 + IMPORT_C ~CBandedDevice();
1.47 + IMPORT_C static CBandedDevice* NewL(TRect aRectInPixels, TSize aKPixelSizeInTwips, TDisplayMode aDisplayMode, TBandingDirection aBandingDirection = EBandingTopToBottom, TInt aScanLinesPerBand = 0);
1.48 +
1.49 + IMPORT_C TInt HorizontalTwipsToPixels(TInt aTwips) const;
1.50 + IMPORT_C TInt VerticalTwipsToPixels(TInt aTwips) const;
1.51 + IMPORT_C TInt HorizontalPixelsToTwips(TInt aPixels) const;
1.52 + IMPORT_C TInt VerticalPixelsToTwips(TInt aPixels) const;
1.53 + IMPORT_C virtual TInt GetNearestFontInTwips(CFont*& aFont, const TFontSpec& aFontSpec);
1.54 + IMPORT_C virtual TInt GetNearestFontToDesignHeightInTwips(CFont*& aFont, const TFontSpec& aFontSpec);
1.55 + IMPORT_C virtual TInt GetNearestFontToMaxHeightInTwips(CFont*& aFont, const TFontSpec& aFontSpec, TInt aMaxHeight);
1.56 + IMPORT_C void ReleaseFont(CFont* aFont);
1.57 +
1.58 + IMPORT_C TDisplayMode DisplayMode() const;
1.59 + IMPORT_C TSize SizeInPixels() const;
1.60 + IMPORT_C TSize SizeInTwips() const;
1.61 + IMPORT_C TInt CreateContext(CGraphicsContext*& aGC);
1.62 + IMPORT_C TInt NumTypefaces() const;
1.63 + IMPORT_C void TypefaceSupport(TTypefaceSupport& aTypefaceSupport, TInt aTypefaceIndex) const;
1.64 + IMPORT_C TInt FontHeightInTwips(TInt aTypefaceIndex, TInt aHeightIndex) const;
1.65 + IMPORT_C void PaletteAttributes(TBool& aModifiable, TInt& aNumEntries) const;
1.66 + IMPORT_C void SetPalette(CPalette* aPalette);
1.67 + IMPORT_C TInt GetPalette(CPalette*& aPalette) const;
1.68 +
1.69 + IMPORT_C TInt NumBands() const;
1.70 + IMPORT_C TInt NextBand();
1.71 + IMPORT_C TRect BandRect() const;
1.72 + IMPORT_C TPoint FullOriginToBandOrigin(const TPoint& aPoint) const;
1.73 + IMPORT_C void Reset();
1.74 +
1.75 + inline TBandingDirection BandingDirection() const {return iBandingDirection;}
1.76 + inline CFbsBitmap* BandBitmap() const {return iBandBitmap;}
1.77 +
1.78 +private:
1.79 + CBandedDevice(TRect aRectInPixels, TBandingDirection aBandingDirection, TInt aScanLinesPerBand);
1.80 + void ConstructL(TDisplayMode aDisplayMode, TSize aKPixelSizeInTwips);
1.81 +
1.82 +private:
1.83 + TRect iFullRectInPixels;
1.84 + TInt iScanLinesPerBand;
1.85 + TInt iBandIndex;
1.86 + CFbsBitmap* iBandBitmap;
1.87 + CFbsBitmapDevice* iBandBitmapDevice;
1.88 + CFbsBitGc* iClearGc;
1.89 + TBandingDirection iBandingDirection;
1.90 + };
1.91 +
1.92 +#endif