1.1 --- a/epoc32/include/prnsetup.h Tue Mar 16 16:12:26 2010 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,168 +0,0 @@
1.4 -// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 -// All rights reserved.
1.6 -// This component and the accompanying materials are made available
1.7 -// 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
1.8 -// which accompanies this distribution, and is available
1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 -//
1.11 -// Initial Contributors:
1.12 -// Nokia Corporation - initial contribution.
1.13 -//
1.14 -// Contributors:
1.15 -//
1.16 -// Description:
1.17 -//
1.18 -
1.19 -#ifndef __PRNSETUP_H__
1.20 -#define __PRNSETUP_H__
1.21 -
1.22 -#if !defined(__E32STD_H__)
1.23 -#include <e32std.h>
1.24 -#endif
1.25 -#if !defined(__E32BASE_H__)
1.26 -#include <e32base.h>
1.27 -#endif
1.28 -#if !defined(__FLDBLTIN_H__)
1.29 -#include <fldbltin.h>
1.30 -#endif
1.31 -#if !defined(__PRNINF_H__)
1.32 -#include <prninf.h>
1.33 -#endif
1.34 -
1.35 -/** @publishedPartner */
1.36 -const TInt KErrMorePages=4747; // Leave with this error code to print extra pages in PrintBandL
1.37 -
1.38 -/** @internalTechnology */
1.39 -_LIT( KDefaultPrinterDriverPath, "\\resource\\printers\\" );
1.40 -
1.41 -// Classes defined //
1.42 -class CPrintSetup;
1.43 -//
1.44 -
1.45 -// Forward Reference
1.46 -class CPreviewProcess;
1.47 -class CPrintProcess;
1.48 -class CPdrModelList;
1.49 -class CPdrDevice;
1.50 -class CHeaderFooter;
1.51 -class TPageSpec;
1.52 -class RReadStream;
1.53 -class RWriteStream;
1.54 -class MPageRegionPrinter;
1.55 -class RFs;
1.56 -class CPrinterDriver;
1.57 -class CPrinterDriverUI;
1.58 -//
1.59 -
1.60 -class CPrintSetup : public CBase, private MFieldPageNumInfo
1.61 -/** Print setup information.
1.62 -
1.63 -This class stores the information needed to set up, start and stop a print
1.64 -job. This includes the target printer device, the page margins and
1.65 -the header and footer. The page specification, (page orientation and page
1.66 -dimensions) can be set via the printer device.
1.67 -
1.68 -Print setup information is associated with a document and is stored as part
1.69 -of the persistent form of the document. Print parameters on the other hand,
1.70 -(class TPrintParameters) are associated with a particular print request,
1.71 -not with the document itself, so are not part of the print setup information.
1.72 -
1.73 -@publishedAll
1.74 -@released */
1.75 - {
1.76 -public:
1.77 - IMPORT_C static CPrintSetup* NewL();
1.78 - IMPORT_C virtual ~CPrintSetup();
1.79 - //
1.80 - // printer model selection/control functions
1.81 - IMPORT_C void AddPrinterDriverDirL(const TDesC& aDriverDir);
1.82 - IMPORT_C CPrinterModelList* ModelNameListL(RFs& aFs);
1.83 - IMPORT_C void FreeModelList();
1.84 - IMPORT_C void CreatePrinterDeviceL(TInt aModelIndex); // requires ModelList to exist
1.85 - IMPORT_C void CreatePrinterDeviceL(TUid aModelUid,RFs& aFs);
1.86 - IMPORT_C CPrinterDevice* PrinterDevice()const;
1.87 - IMPORT_C CPrinterDriverUI* CreatePrinterDriverUIL(); // ownership is transfered to the caller
1.88 - //
1.89 - // print functions
1.90 - IMPORT_C void EndPrint();
1.91 - IMPORT_C TInt StartPrintL(const TPrintParameters& aPrintParams,MPageRegionPrinter& aBodyPrinter,
1.92 - CPrinterPort* aPort,MPrintProcessObserver* anObserver);
1.93 - IMPORT_C TInt StartPreviewPrintL(const TPrintParameters& aPrintParams,MPageRegionPrinter& aBodyPrinter,
1.94 - MPrintProcessObserver* anObserver,CGraphicsDevice& aPreviewDev,const TRect& aHeaderRectInPixels,
1.95 - const TRect& aFooterRectInPixels,TInt aNumBands);
1.96 - //
1.97 - // accessors
1.98 - inline CHeaderFooter* Header()const;
1.99 - inline CHeaderFooter* Footer()const;
1.100 - //
1.101 - // persistence
1.102 - IMPORT_C TStreamId StoreL(CStreamStore& aStore)const;
1.103 - IMPORT_C void RestoreL(const CStreamStore& aStore,TStreamId aStreamId,const MFieldFileNameInfo* aFileNameInfo=NULL,const MFieldNumPagesInfo* aNumPagesInfo=NULL,MPictureFactory* aFactory=NULL);
1.104 - IMPORT_C void StoreComponentsL(CStreamStore& aStore,CStoreMap& aMap)const;
1.105 - IMPORT_C void RestoreComponentsL(const CStreamStore& aStore,const MFieldFileNameInfo* aFileNameInfo=NULL,const MFieldNumPagesInfo* aNumPagesInfo=NULL,MPictureFactory* aFactory=NULL);
1.106 - IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
1.107 - IMPORT_C void InternalizeL(RReadStream& aStream);
1.108 - //
1.109 -private:
1.110 - CPrintSetup();
1.111 - void ConstructL();
1.112 - void DoStartPrintL(const TPrintParameters& aPrintParams,MPageRegionPrinter& aBodyPrinter,MPrintProcessObserver* aObserver,CPrinterPort* aPort);
1.113 - void InitializePrintingL(CGraphicsDevice* aPrinterDev,const TPrintParameters& aPrintParams,MPrintProcessObserver* aObserver);
1.114 - void InitializePrintingL(const TPrintParameters& aPrintParams,MPrintProcessObserver* aObserver,
1.115 - const TRect& aHeaderRectInPixels,const TRect& aFooterRectInPixels);
1.116 - // from MFieldPageNumInfo
1.117 - TInt UpdateFieldPageNum()const;
1.118 -public:
1.119 - // Info regarding print setup etc.
1.120 - /** The header and footer offset and the width of the four margins.
1.121 -
1.122 - All measurements are in twips.
1.123 -
1.124 - @see TPageMargins */
1.125 - TPageMargins iPageMarginsInTwips;
1.126 - /** The number of the first page in the document.
1.127 -
1.128 - This value is used for printing or displaying page numbering. Note that all
1.129 - other page numbering is zero indexed, to preserve independence from user-defined
1.130 - page numbering. */
1.131 - TInt iNumOfFirstPage; // value to start page numbering at
1.132 -private:
1.133 - enum {
1.134 - ENumberFirstPage = 0x0001,
1.135 - };
1.136 -private:
1.137 - CHeaderFooter* iHeader;
1.138 - CHeaderFooter* iFooter;
1.139 - CPrinterDriver* iPrinterDriver; // the target printer driver
1.140 - CPreviewProcess* iPrintProcess;
1.141 - CPdrModelList* iModelList;
1.142 - MPrintProcessObserver* iPrintObserver;
1.143 - TPrintParameters iPrintParams; // not persisted
1.144 - CArrayFixSeg<TFileName>* iDriverDirList;
1.145 - };
1.146 -
1.147 -
1.148 -//
1.149 -// inlines
1.150 -//
1.151 -
1.152 -inline CHeaderFooter* CPrintSetup::Header()const
1.153 -/** Gets the header.
1.154 -
1.155 -The CPrintSetup object owns the header and footer. CPrintSetup implements
1.156 -the MFieldPageNumInfo interface, which allows page numbering to be easily
1.157 -added to fields.
1.158 -
1.159 -@return The header. */
1.160 - { return iHeader; }
1.161 -
1.162 -inline CHeaderFooter* CPrintSetup::Footer()const
1.163 -/** Gets the footer.
1.164 -
1.165 -@return The footer. */
1.166 - { return iFooter; }
1.167 -
1.168 -
1.169 -
1.170 -
1.171 -#endif