textrendering/textformatting/inc/FRMPRINT.H
changeset 0 1fb32624e06b
equal deleted inserted replaced
-1:000000000000 0:1fb32624e06b
       
     1 /*
       
     2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __FRMPRINT_H__
       
    20 #define __FRMPRINT_H__
       
    21 
       
    22 #include <e32std.h>
       
    23 #include <frmtlay.h>
       
    24 
       
    25 /**
       
    26 @publishedAll
       
    27 @released
       
    28 */ 
       
    29 class CTextPageRegionPrinter : public CBase	, public MPageRegionPrinter
       
    30 
       
    31 	{
       
    32 public:
       
    33 	IMPORT_C static CTextPageRegionPrinter* NewL(MLayDoc* aLayDoc,CPrinterDevice* aPrinterDevice);
       
    34 	IMPORT_C ~CTextPageRegionPrinter();
       
    35 	IMPORT_C void SetPageList(const CArrayFix<TInt>* aPageList);
       
    36 	IMPORT_C void SetPrinterDevice(CPrinterDevice* aPrinterDevice);
       
    37 	IMPORT_C void SetDocument(MLayDoc *aDoc); // Used for replacing document
       
    38 	IMPORT_C void SetPrintPreview(TBool aPrintPreview);
       
    39 	IMPORT_C void SetPageSpecInTwips(const TPageSpec& aPageSpec);  // Physical size of page.
       
    40 	IMPORT_C void SetPageMarginsInTwips(const TMargins& aPageMargins); // Default are all zero.
       
    41 	IMPORT_C void SetTextMarginWidthsInTwips(TInt aLabelMarginWidth,TInt aGutterMarginWidth); // label margin &c (if any)
       
    42 	IMPORT_C void SetFirstPageOfDoc(TInt aFirstPage);	// possible offset depending on document - Default is 1
       
    43 	IMPORT_C void PrintBandL(CGraphicsDevice* aLayoutDevice,TInt aPageNo
       
    44 															,const TBandAttributes& aBandInPixels);
       
    45 	//deprecated 7.0 
       
    46 	IMPORT_C void SetParagraphFillTextOnly(TBool aFillTextOnly);
       
    47 private:
       
    48 	CTextPageRegionPrinter();
       
    49 	void ConstructL(MLayDoc* aLayDoc,CPrinterDevice* aPrinterDevice);
       
    50 	void PrintBand2L(CGraphicsDevice* aLayoutDevice,TInt aPageNo,const TBandAttributes& aBandInPixels);
       
    51 	void SetFormatAndImageDevices();
       
    52 	void SetPageL(TInt aNextPage);
       
    53 	TRect ViewRectInTwips() const;
       
    54 	TInt LayoutWidthInTwips() const;
       
    55 	TInt LabelMarginWidthInPixels() const;
       
    56 	TInt TextStartXInPixels() const;
       
    57 	void SetPageTextHeight();
       
    58 	void LeaveL(TInt aErr);
       
    59 private:
       
    60 	CTextLayout* iLayout; // 'HAS' relationship
       
    61 	CPrinterDevice* iPrinterDevice;
       
    62 	CGraphicsDevice* iImageDevice;
       
    63 	CGraphicsContext* iGc;
       
    64 	CGraphicsContext* iPictureGc;
       
    65 	TDrawTextLayoutContext iDrawTextLayoutContext;
       
    66 	const CArrayFix<TInt>* iPageList;	// 'USES' relationship. Destroyed by application
       
    67 	TSize iPageSizeInTwips; // In Twips
       
    68 	TMargins iPageMarginsInTwips;	// In twips
       
    69 	TInt iGutterMarginWidthInTwips;   // Gap between labels and text proper - in twips
       
    70 	TInt iLabelMarginWidthInTwips;	   // In twips
       
    71 	TInt iCurrentPage;
       
    72 	TInt iFirstPage;
       
    73 	TInt iTopPageDocPos;
       
    74 	TInt iPageTextHeightInPixels; 
       
    75 	TBool iPrintPreview;
       
    76 	};
       
    77 
       
    78 #endif