2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
19 #ifndef __FRMPRINT_H__
20 #define __FRMPRINT_H__
29 class CTextPageRegionPrinter : public CBase , public MPageRegionPrinter
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);
46 IMPORT_C void SetParagraphFillTextOnly(TBool aFillTextOnly);
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);
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
74 TInt iPageTextHeightInPixels;