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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __FRMPRINT_H__
17 #define __FRMPRINT_H__
26 class CTextPageRegionPrinter : public CBase , public MPageRegionPrinter
30 IMPORT_C static CTextPageRegionPrinter* NewL(MLayDoc* aLayDoc,CPrinterDevice* aPrinterDevice);
31 IMPORT_C ~CTextPageRegionPrinter();
32 IMPORT_C void SetPageList(const CArrayFix<TInt>* aPageList);
33 IMPORT_C void SetPrinterDevice(CPrinterDevice* aPrinterDevice);
34 IMPORT_C void SetDocument(MLayDoc *aDoc); // Used for replacing document
35 IMPORT_C void SetPrintPreview(TBool aPrintPreview);
36 IMPORT_C void SetPageSpecInTwips(const TPageSpec& aPageSpec); // Physical size of page.
37 IMPORT_C void SetPageMarginsInTwips(const TMargins& aPageMargins); // Default are all zero.
38 IMPORT_C void SetTextMarginWidthsInTwips(TInt aLabelMarginWidth,TInt aGutterMarginWidth); // label margin &c (if any)
39 IMPORT_C void SetFirstPageOfDoc(TInt aFirstPage); // possible offset depending on document - Default is 1
40 IMPORT_C void PrintBandL(CGraphicsDevice* aLayoutDevice,TInt aPageNo
41 ,const TBandAttributes& aBandInPixels);
43 IMPORT_C void SetParagraphFillTextOnly(TBool aFillTextOnly);
45 CTextPageRegionPrinter();
46 void ConstructL(MLayDoc* aLayDoc,CPrinterDevice* aPrinterDevice);
47 void PrintBand2L(CGraphicsDevice* aLayoutDevice,TInt aPageNo,const TBandAttributes& aBandInPixels);
48 void SetFormatAndImageDevices();
49 void SetPageL(TInt aNextPage);
50 TRect ViewRectInTwips() const;
51 TInt LayoutWidthInTwips() const;
52 TInt LabelMarginWidthInPixels() const;
53 TInt TextStartXInPixels() const;
54 void SetPageTextHeight();
55 void LeaveL(TInt aErr);
57 CTextLayout* iLayout; // 'HAS' relationship
58 CPrinterDevice* iPrinterDevice;
59 CGraphicsDevice* iImageDevice;
60 CGraphicsContext* iGc;
61 CGraphicsContext* iPictureGc;
62 TDrawTextLayoutContext iDrawTextLayoutContext;
63 const CArrayFix<TInt>* iPageList; // 'USES' relationship. Destroyed by application
64 TSize iPageSizeInTwips; // In Twips
65 TMargins iPageMarginsInTwips; // In twips
66 TInt iGutterMarginWidthInTwips; // Gap between labels and text proper - in twips
67 TInt iLabelMarginWidthInTwips; // In twips
71 TInt iPageTextHeightInPixels;