Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
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.
19 #if !defined(__E32STD_H__)
22 #if !defined(__GDI_H__)
25 #if !defined(__FLDBASE_H__)
32 class TPrintParameters;
34 class MPrintProcessObserver;
40 class CParaFormatLayer;
41 class CCharFormatLayer;
42 class MFieldFileNameInfo;
43 class MFieldPageNumInfo;
44 class MFieldNumPagesInfo;
48 class TPrintParameters
51 This data is associated with a particular print request, not with the document
52 to be printed, so is separate from the print setup information.
54 An object of this class is passed to CPrintSetup::StartPrintL() and to CPrintSetup::StartPreviewPrintL().
61 IMPORT_C TPrintParameters(); // sets to 1,0,0
63 /** The number of copies to print. */
65 /** The first page to be printed.
67 This value should be less than or equal to iLastPage. Zero indicates the first page
70 /** The last page to be printed.
72 This value should be greater than or equal to iFirstPage. Zero indicates the first
73 page in the document. */
80 Page margins are accessed via the public iPageMarginsInTwips member of class
81 CPrintSetup. A single margin settings object applies throughout a document,
82 so that gutter margins are not supported.
84 If the document contains headers and footers, they are located within the
85 top and bottom margins respectively.
91 IMPORT_C void InternalizeL(RReadStream& aStream);
92 IMPORT_C void ExternalizeL(RWriteStream& aStream)const;
94 /** The distance between the top of the header and the top of the page in twips
97 This must be less than the height of the top margin to ensure that the header
100 /** The distance between the top of the footer and the top of the bottom margin
103 This must be less than the height of the bottom margin to ensure that the
104 footer is visible. */
106 /** The widths of each of the four margins in twips or pixels.
112 class CHeaderFooter : public CBase, private MTextFieldFactory
113 /** A document header or footer.
115 The header is located in the top page margin and the footer in the
116 bottom page margin. No more than one header or footer can exist in a document.
118 CHeaderFooter derives from MTextFieldFactory. This allows the insertion of
119 various fields, including page number, current date or time and filename.
121 Rich text manipulation and formatting functions can be accessed through
122 the rich text object which is owned by the header/footer.
124 The header and footer are retrieved using the CPrintSetup::Header() and Footer()
125 functions and they are stored and restored together with the rest of the print
132 IMPORT_C static CHeaderFooter* NewL();
133 IMPORT_C virtual ~CHeaderFooter();
135 IMPORT_C void CreateTextL();
136 IMPORT_C void SetFirstPageToPrintTo(TInt aPageNum); // allows the first few pages of a doc not to have a header on them
137 inline TInt FirstPageToPrintTo()const; // relative to the first page being numbered 0
140 IMPORT_C TStreamId StoreL(CStreamStore& aStore)const;
141 IMPORT_C void RestoreL(const CStreamStore& aStore,TStreamId aStreamId,MPictureFactory* aFactory);
142 IMPORT_C void StoreComponentsL(CStreamStore& aStore,CStoreMap& aMap)const;
143 IMPORT_C void RestoreComponentsL(const CStreamStore& aStore,MPictureFactory* aFactory);
144 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
145 IMPORT_C void InternalizeL(RReadStream& aStream);
148 IMPORT_C CRichText* Text()const;
149 IMPORT_C CParaFormatLayer* ParaFormat()const;
150 IMPORT_C CCharFormatLayer* CharFormat()const;
151 IMPORT_C void SetText(CRichText* aText); // takes ownership
152 IMPORT_C void SetParaFormat(CParaFormatLayer* aParaFormat); // takes ownership
153 IMPORT_C void SetCharFormat(CCharFormatLayer* aCharFormat); // takes ownership
156 IMPORT_C void SetFileNameInfo(const MFieldFileNameInfo& aFileNameInfo); // call if you want headers/footers to support filename fields
157 IMPORT_C void SetNumPagesInfo(const MFieldNumPagesInfo& aNumPagesInfo); // call if you want headers/footers to support "total number of pages" fields
158 inline MFieldFileNameInfo* FileNameFieldInfo()const;
159 inline MFieldNumPagesInfo* NumPagesFieldInfo()const;
161 void SetPageNumInfo(const MFieldPageNumInfo& aPageNumInfo); // called by CPrintSetup
164 void CreateFormatLayersL();
165 // from MTextFieldFactory
166 CTextField* NewFieldL(TUid aFieldType);
168 TInt iFirstPageToPrintTo; // relative to the first page being numbered 0
169 MFieldFileNameInfo* iFileNameInfo;
170 MFieldPageNumInfo* iPageNumInfo;
171 MFieldNumPagesInfo* iNumPagesInfo;
172 CRichText* iText; // RichText Doc Handle
173 CParaFormatLayer* iParaLayer;
174 CCharFormatLayer* iCharLayer;
176 enum { ETextExists = 0x0001 };
179 class MPrintProcessObserver
180 /** Print progress and status notification interface class.
182 The notification functions are called before, during and after a print or
183 print preview operation, to give notification of its progress.
185 The print process observer will often be the GUI's standard print progress
186 or print preview dialog.
188 An object of a class which implements this interface may be passed as a parameter
189 to CPrintSetup::StartPrintL(), or to CPrintSetup::StartPreviewPrintL().
195 /** Notifies that a print or print preview operation is about to begin.
197 It may be used to display information about the document to be printed. It
198 is called once, immediately before printing or print previewing begins.
200 When subclassing, add variables to store initialisation information as required.
202 @param aPrintParams The parameters for the print job. */
203 virtual void NotifyPrintStarted(TPrintParameters aPrintParams)=0;
204 /** Notifies that a band is about to be printed.
206 It may be used to display print progress information, including the current
207 page number. It is called immediately before each band is printed.
209 @param aPercentageOfPagePrinted The percentage of the page that has been printed.
210 @param aCurrentPageNum The number of the page currently being printed.
211 @param aCurrentCopyNum The number of the copy currently being printed (if multiple
212 copies are being printed). */
213 virtual void NotifyBandPrinted(TInt aPercentageOfPagePrinted, TInt aCurrentPageNum, TInt aCurrentCopyNum)=0;
214 /** Notifies that the print or print preview operation has completed.
216 It may be used to display information about how the operation completed, for
217 example any errors that occurred. It is called once, immediately after the
218 print job terminates.
220 @param anErrorCode KErrNone if the print job completed successfully, otherwise
221 another of the system-wide error codes. */
222 virtual void NotifyPrintEnded(TInt anErrorCode)=0;
231 inline TInt CHeaderFooter::FirstPageToPrintTo()const
232 /** Gets the first page on which the header or footer is to be printed.
234 Page numbering begins at zero.
236 @return The number of the first page on which the header or footer is to be
238 { return iFirstPageToPrintTo; }
240 inline MFieldFileNameInfo* CHeaderFooter::FileNameFieldInfo()const
241 /** Gets the object which implements the MFieldFileNameInfo interface, as set by
244 @return The object which implements the MFieldFileNameInfo interface. */
245 { return iFileNameInfo; }
247 inline MFieldNumPagesInfo* CHeaderFooter::NumPagesFieldInfo()const
248 /** Gets the object which implements the MFieldNumPagesInfo interface, as set by
251 @return The object which implements the MFieldNumPagesInfo interface. */
252 { return iNumPagesInfo; }