os/graphics/printingservices/printerdriversupport/inc/BANDDEV.H
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
#ifndef BANDDEV_H
sl@0
    17
#define BANDDEV_H
sl@0
    18
sl@0
    19
#include <e32std.h>
sl@0
    20
#include <gdi.h>
sl@0
    21
sl@0
    22
class CFbsBitmapDevice;
sl@0
    23
class CFbsBitGc;
sl@0
    24
sl@0
    25
/**
sl@0
    26
 @publishedAll
sl@0
    27
*/
sl@0
    28
enum TBandingDirection
sl@0
    29
	{
sl@0
    30
	EBandingTopToBottom,
sl@0
    31
	EBandingBottomToTop,
sl@0
    32
	EBandingLeftToRight,
sl@0
    33
	EBandingRightToLeft
sl@0
    34
	};
sl@0
    35
sl@0
    36
/**
sl@0
    37
 @publishedAll
sl@0
    38
 @released 
sl@0
    39
 */
sl@0
    40
class CBandedDevice : public CGraphicsDevice
sl@0
    41
	{
sl@0
    42
public:
sl@0
    43
	IMPORT_C ~CBandedDevice();
sl@0
    44
	IMPORT_C static CBandedDevice* NewL(TRect aRectInPixels, TSize aKPixelSizeInTwips, TDisplayMode aDisplayMode, TBandingDirection aBandingDirection = EBandingTopToBottom, TInt aScanLinesPerBand = 0);
sl@0
    45
sl@0
    46
	IMPORT_C TInt HorizontalTwipsToPixels(TInt aTwips) const;
sl@0
    47
	IMPORT_C TInt VerticalTwipsToPixels(TInt aTwips) const;
sl@0
    48
	IMPORT_C TInt HorizontalPixelsToTwips(TInt aPixels) const;
sl@0
    49
	IMPORT_C TInt VerticalPixelsToTwips(TInt aPixels) const;
sl@0
    50
	IMPORT_C virtual TInt GetNearestFontInTwips(CFont*& aFont, const TFontSpec& aFontSpec);
sl@0
    51
	IMPORT_C virtual TInt GetNearestFontToDesignHeightInTwips(CFont*& aFont, const TFontSpec& aFontSpec);
sl@0
    52
	IMPORT_C virtual TInt GetNearestFontToMaxHeightInTwips(CFont*& aFont, const TFontSpec& aFontSpec, TInt aMaxHeight);
sl@0
    53
	IMPORT_C void ReleaseFont(CFont* aFont);
sl@0
    54
sl@0
    55
	IMPORT_C TDisplayMode DisplayMode() const;
sl@0
    56
	IMPORT_C TSize SizeInPixels() const;
sl@0
    57
	IMPORT_C TSize SizeInTwips() const;
sl@0
    58
	IMPORT_C TInt CreateContext(CGraphicsContext*& aGC);
sl@0
    59
	IMPORT_C TInt NumTypefaces() const;
sl@0
    60
	IMPORT_C void TypefaceSupport(TTypefaceSupport& aTypefaceSupport, TInt aTypefaceIndex) const;
sl@0
    61
	IMPORT_C TInt FontHeightInTwips(TInt aTypefaceIndex, TInt aHeightIndex) const;
sl@0
    62
	IMPORT_C void PaletteAttributes(TBool& aModifiable, TInt& aNumEntries) const;
sl@0
    63
	IMPORT_C void SetPalette(CPalette* aPalette);
sl@0
    64
	IMPORT_C TInt GetPalette(CPalette*& aPalette) const;
sl@0
    65
sl@0
    66
	IMPORT_C TInt NumBands() const;
sl@0
    67
	IMPORT_C TInt NextBand();
sl@0
    68
	IMPORT_C TRect BandRect() const;
sl@0
    69
	IMPORT_C TPoint FullOriginToBandOrigin(const TPoint& aPoint) const;
sl@0
    70
	IMPORT_C void Reset();
sl@0
    71
sl@0
    72
	inline TBandingDirection BandingDirection() const {return iBandingDirection;}
sl@0
    73
	inline CFbsBitmap* BandBitmap() const {return iBandBitmap;}
sl@0
    74
sl@0
    75
private:
sl@0
    76
	CBandedDevice(TRect aRectInPixels, TBandingDirection aBandingDirection, TInt aScanLinesPerBand);
sl@0
    77
	void ConstructL(TDisplayMode aDisplayMode, TSize aKPixelSizeInTwips);
sl@0
    78
sl@0
    79
private:
sl@0
    80
	TRect iFullRectInPixels;
sl@0
    81
	TInt iScanLinesPerBand;
sl@0
    82
	TInt iBandIndex;
sl@0
    83
	CFbsBitmap* iBandBitmap;
sl@0
    84
	CFbsBitmapDevice* iBandBitmapDevice;
sl@0
    85
	CFbsBitGc* iClearGc;
sl@0
    86
	TBandingDirection iBandingDirection;
sl@0
    87
	};
sl@0
    88
sl@0
    89
#endif