sl@0: /* sl@0: * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: #ifndef __FRMPRINT_H__ sl@0: #define __FRMPRINT_H__ sl@0: sl@0: #include sl@0: #include sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: class CTextPageRegionPrinter : public CBase , public MPageRegionPrinter sl@0: sl@0: { sl@0: public: sl@0: IMPORT_C static CTextPageRegionPrinter* NewL(MLayDoc* aLayDoc,CPrinterDevice* aPrinterDevice); sl@0: IMPORT_C ~CTextPageRegionPrinter(); sl@0: IMPORT_C void SetPageList(const CArrayFix* aPageList); sl@0: IMPORT_C void SetPrinterDevice(CPrinterDevice* aPrinterDevice); sl@0: IMPORT_C void SetDocument(MLayDoc *aDoc); // Used for replacing document sl@0: IMPORT_C void SetPrintPreview(TBool aPrintPreview); sl@0: IMPORT_C void SetPageSpecInTwips(const TPageSpec& aPageSpec); // Physical size of page. sl@0: IMPORT_C void SetPageMarginsInTwips(const TMargins& aPageMargins); // Default are all zero. sl@0: IMPORT_C void SetTextMarginWidthsInTwips(TInt aLabelMarginWidth,TInt aGutterMarginWidth); // label margin &c (if any) sl@0: IMPORT_C void SetFirstPageOfDoc(TInt aFirstPage); // possible offset depending on document - Default is 1 sl@0: IMPORT_C void PrintBandL(CGraphicsDevice* aLayoutDevice,TInt aPageNo sl@0: ,const TBandAttributes& aBandInPixels); sl@0: //deprecated 7.0 sl@0: IMPORT_C void SetParagraphFillTextOnly(TBool aFillTextOnly); sl@0: private: sl@0: CTextPageRegionPrinter(); sl@0: void ConstructL(MLayDoc* aLayDoc,CPrinterDevice* aPrinterDevice); sl@0: void PrintBand2L(CGraphicsDevice* aLayoutDevice,TInt aPageNo,const TBandAttributes& aBandInPixels); sl@0: void SetFormatAndImageDevices(); sl@0: void SetPageL(TInt aNextPage); sl@0: TRect ViewRectInTwips() const; sl@0: TInt LayoutWidthInTwips() const; sl@0: TInt LabelMarginWidthInPixels() const; sl@0: TInt TextStartXInPixels() const; sl@0: void SetPageTextHeight(); sl@0: void LeaveL(TInt aErr); sl@0: private: sl@0: CTextLayout* iLayout; // 'HAS' relationship sl@0: CPrinterDevice* iPrinterDevice; sl@0: CGraphicsDevice* iImageDevice; sl@0: CGraphicsContext* iGc; sl@0: CGraphicsContext* iPictureGc; sl@0: TDrawTextLayoutContext iDrawTextLayoutContext; sl@0: const CArrayFix* iPageList; // 'USES' relationship. Destroyed by application sl@0: TSize iPageSizeInTwips; // In Twips sl@0: TMargins iPageMarginsInTwips; // In twips sl@0: TInt iGutterMarginWidthInTwips; // Gap between labels and text proper - in twips sl@0: TInt iLabelMarginWidthInTwips; // In twips sl@0: TInt iCurrentPage; sl@0: TInt iFirstPage; sl@0: TInt iTopPageDocPos; sl@0: TInt iPageTextHeightInPixels; sl@0: TBool iPrintPreview; sl@0: }; sl@0: sl@0: #endif