![Symbian Developer Library](../../../../a_stock/images/mainheading.gif)
![]() |
![]() |
|
class CHeaderFooter : public CBase, private MTextFieldFactory;
A document header or footer.
The header is located in the top page margin and the footer in the bottom page margin. No more than one header or footer can exist in a document.
CHeaderFooter derives from MTextFieldFactory
. This allows the insertion of various fields, including page number, current date or time and filename.
Rich text manipulation and formatting functions can be accessed through the rich text object which is owned by the header/footer.
The header and footer are retrieved using the CPrintSetup::Header()const
and Footer() functions and they are stored and restored together with the rest of the print setup information.
MTextFieldFactory
- No description.
CBase
-
Base class for all classes to be instantiated on the heap.
CHeaderFooter
- A document header or footer.
Defined in CHeaderFooter
:
CharFormat()const
Gets the character format layer upon which the header or footer's character form...CreateTextL()
Allocates and constructs the rich text object owned by the header or footer.ExternalizeL(RWriteStream &)const
Externalises this object's text content and global format layers to a write stre...FileNameFieldInfo()const
Gets the object which implements the MFieldFileNameInfo interface, as set by CHe...FirstPageToPrintTo()const
Gets the first page on which the header or footer is to be printed.InternalizeL(RReadStream &)
Internalises this object's text content and global format layers from a read str...NewFieldL(TUid)
Implementations of this function should create a field of the type specified, re...NewL()
Allocates and constructs an uninitialised CHeaderFooter object.NumPagesFieldInfo()const
Gets the object which implements the MFieldNumPagesInfo interface, as set by CHe...ParaFormat()const
Gets the paragraph format layer which is owned by the header or footer.RestoreComponentsL(const CStreamStore &,MPictureFactory *)
Restores this object's components from a stream store.RestoreL(const CStreamStore &,TStreamId,MPictureFactory *)
Restores this object and all associated components from a stream store.SetCharFormat(CCharFormatLayer *)
Sets the format layer upon which the header or footer's character formatting is ...SetFileNameInfo(const MFieldFileNameInfo &)
Sets an object to update the document's filename.SetFirstPageToPrintTo(TInt)
Sets the first page on which the header or footer is to be printed, allowing hea...SetNumPagesInfo(const MFieldNumPagesInfo &)
Sets an object to update the total number of pages.SetParaFormat(CParaFormatLayer *)
Sets the format layer upon which the header or footer's paragraph formatting is ...SetText(CRichText *)
Sets the rich text object which is owned by the header or footer.StoreComponentsL(CStreamStore &,CStoreMap &)const
Stores this object's components to a stream store, specifying a stream store and...StoreL(CStreamStore &)const
Stores a CHeaderFooter object and all associated components to a stream store.Text()const
Gets the rich text object owned by this header or footer.~CHeaderFooter()
Destructor.Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.Extension_(TUint,TAny *&,TAny *)
Extension function operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...IMPORT_C static CHeaderFooter* NewL();
Allocates and constructs an uninitialised CHeaderFooter object.
|
IMPORT_C virtual ~CHeaderFooter();
Destructor.
This frees all resources owned by the CHeaderFooter object, prior to its destruction.
IMPORT_C void CreateTextL();
Allocates and constructs the rich text object owned by the header or footer.
The object's formatting is based on default values. If the header or footer's rich text object has already been allocated, the object is deleted and replaced by the one created by this function. So, calling this function causes a header or footer to lose all its existing text content, fields and formatting.
IMPORT_C void SetFirstPageToPrintTo(TInt aPageNum);
Sets the first page on which the header or footer is to be printed, allowing headers and footers to be omitted from the beginning of a document.
Page numbering begins at zero.
|
inline TInt FirstPageToPrintTo() const;
Gets the first page on which the header or footer is to be printed.
Page numbering begins at zero.
|
IMPORT_C TStreamId StoreL(CStreamStore &aStore) const;
Stores a CHeaderFooter object and all associated components to a stream store.
Components include rich text-specific formatting, fields and pictures.
|
|
|
IMPORT_C void RestoreL(const CStreamStore &aStore, TStreamId aStreamId, MPictureFactory *aFactory);
Restores this object and all associated components from a stream store.
Components include fields and pictures.
|
IMPORT_C void StoreComponentsL(CStreamStore &aStore, CStoreMap &aMap) const;
Stores this object's components to a stream store, specifying a stream store and store map.
Components include fields and pictures.
This function does not store the text content or global formatting of the header and footer, so it may need to be accompanied
by a call to CHeaderFooter::ExternalizeL(RWriteStream &)const
.
|
IMPORT_C void RestoreComponentsL(const CStreamStore &aStore, MPictureFactory *aFactory);
Restores this object's components from a stream store.
Components include fields and pictures.
This function does not restore the text content or global formatting of the header and footer, so it may need to be accompanied
by a call to CHeaderFooter::InternalizeL(RReadStream &)
.
|
IMPORT_C void ExternalizeL(RWriteStream &aStream) const;
Externalises this object's text content and global format layers to a write stream.
The object's components are not externalised. The presence of this function means that the standard templated operator<<(RWriteStream &,const T &)
(defined in s32strm.h
) is available to externalise objects of this class.
This function does not store any fields, pictures or rich text-specific formatting, so may need to be accompanied by a call
to CHeaderFooter::StoreComponentsL(CStreamStore &,CStoreMap &)const
.
|
IMPORT_C void InternalizeL(RReadStream &aStream);
Internalises this object's text content and global format layers from a read stream.
The presence of this function means that the standard templated operator>>(RReadStream &,T &)
(defined in s32strm.h
) is available to internalise objects of this class.
This function does not restore any fields, pictures or rich text-specific formatting, so may need to be accompanied by a call
to CHeaderFooter::RestoreComponentsL(const CStreamStore &,MPictureFactory *)
.
|
IMPORT_C CRichText* Text() const;
Gets the rich text object owned by this header or footer.
Through this object, rich text, fields and pictures can be inserted. This function can also be used to find out whether the
rich text component is NULL, in which case a call to CHeaderFooter::CreateTextL()
or CHeaderFooter::SetText(CRichText *)
may be necessary.
|
IMPORT_C CParaFormatLayer* ParaFormat() const;
Gets the paragraph format layer which is owned by the header or footer.
The header or footer's paragraph formatting is based upon this layer.
|
IMPORT_C CCharFormatLayer* CharFormat() const;
Gets the character format layer upon which the header or footer's character formatting is based.
|
IMPORT_C void SetText(CRichText *aText);
Sets the rich text object which is owned by the header or footer.
The character and paragraph format layers upon which the header or footer's formatting is based are not updated by this function,
so you may also need to call CHeaderFooter::SetParaFormat(CParaFormatLayer *)
and CHeaderFooter::SetCharFormat(CCharFormatLayer *)
, specifying the paragraph and character format layers referenced by aText.
Ownership of aText is transferred to this object.
Any existing rich text object is replaced, but is not deleted by this function.
|
IMPORT_C void SetParaFormat(CParaFormatLayer *aParaFormat);
Sets the format layer upon which the header or footer's paragraph formatting is based.
Ownership of aParaFormat is transferred to this object.
Any existing paragraph format layer is replaced, but not deleted by this function.
|
IMPORT_C void SetCharFormat(CCharFormatLayer *aCharFormat);
Sets the format layer upon which the header or footer's character formatting is based.
Ownership of aCharFormat is transferred to this object.
Any existing character format layer is replaced, but not deleted by this function.
|
IMPORT_C void SetFileNameInfo(const MFieldFileNameInfo &aFileNameInfo);
Sets an object to update the document's filename.
If the header or footer supports filename fields, use this function to set an object that implements the MFieldFileNameInfo
interface.
|
IMPORT_C void SetNumPagesInfo(const MFieldNumPagesInfo &aNumPagesInfo);
Sets an object to update the total number of pages.
If the header or footer supports total number of pages fields, use this function to set up an object that implements the MFieldNumPagesInfo
interface.
|
inline MFieldFileNameInfo* FileNameFieldInfo() const;
Gets the object which implements the MFieldFileNameInfo
interface, as set by CHeaderFooter::SetFileNameInfo(const MFieldFileNameInfo &)
.
|
inline MFieldNumPagesInfo* NumPagesFieldInfo() const;
Gets the object which implements the MFieldNumPagesInfo
interface, as set by CHeaderFooter::SetNumPagesInfo(const MFieldNumPagesInfo &)
.
|
private: virtual CTextField* NewFieldL(TUid aFieldType);
Implementations of this function should create a field of the type specified, returning NULL if the field type is not recognised or supported.
|
|