os/graphics/printingservices/printerdriversupport/inc/BANDDEV.H
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #ifndef BANDDEV_H
    17 #define BANDDEV_H
    18 
    19 #include <e32std.h>
    20 #include <gdi.h>
    21 
    22 class CFbsBitmapDevice;
    23 class CFbsBitGc;
    24 
    25 /**
    26  @publishedAll
    27 */
    28 enum TBandingDirection
    29 	{
    30 	EBandingTopToBottom,
    31 	EBandingBottomToTop,
    32 	EBandingLeftToRight,
    33 	EBandingRightToLeft
    34 	};
    35 
    36 /**
    37  @publishedAll
    38  @released 
    39  */
    40 class CBandedDevice : public CGraphicsDevice
    41 	{
    42 public:
    43 	IMPORT_C ~CBandedDevice();
    44 	IMPORT_C static CBandedDevice* NewL(TRect aRectInPixels, TSize aKPixelSizeInTwips, TDisplayMode aDisplayMode, TBandingDirection aBandingDirection = EBandingTopToBottom, TInt aScanLinesPerBand = 0);
    45 
    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);
    54 
    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;
    65 
    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();
    71 
    72 	inline TBandingDirection BandingDirection() const {return iBandingDirection;}
    73 	inline CFbsBitmap* BandBitmap() const {return iBandBitmap;}
    74 
    75 private:
    76 	CBandedDevice(TRect aRectInPixels, TBandingDirection aBandingDirection, TInt aScanLinesPerBand);
    77 	void ConstructL(TDisplayMode aDisplayMode, TSize aKPixelSizeInTwips);
    78 
    79 private:
    80 	TRect iFullRectInPixels;
    81 	TInt iScanLinesPerBand;
    82 	TInt iBandIndex;
    83 	CFbsBitmap* iBandBitmap;
    84 	CFbsBitmapDevice* iBandBitmapDevice;
    85 	CFbsBitGc* iClearGc;
    86 	TBandingDirection iBandingDirection;
    87 	};
    88 
    89 #endif