CPageNumField Class Reference

#include <fldbltin.h>

Link against: field.lib

class CPageNumField : public CPageFieldBase, public CPageFieldBase

Detailed Description

A field which evaluates to the current page number in the document.

Before the page number field can be evaluated, it must be passed a pointer to an object which implements the UpdateFieldPageNum() function.

Member Attribute Documentation

iPageNumInfo

MFieldPageNumInfo *iPageNumInfo[protected]

Member Function Documentation

SetPageNumInfo ( MFieldPageNumInfo * )

voidSetPageNumInfo(MFieldPageNumInfo *aInfo)[inline]

Sets the object which implements UpdateFieldPageNum(), to get the current page number. SetPageNumInfo() must be called before the page number field can be evaluated.

Parameters
aInfoPointer to an object which implements UpdateFieldPageNum().

Type ( )

IMPORT_C TUidType()const [virtual]

Reimplemented from CTextField::Type()const

Gets the field's type UID.

Return Value
KPageNumberFieldUid.

Value ( TPtr & )

IMPORT_C TIntValue(TPtr &aValueText)[virtual]

Reimplemented from CTextField::Value(TPtr &)

Gets the current page number, by calling UpdateFieldPageNum() (implemented by the object passed to the field using SetPageNumInfo()).

Notes

SetPageNumInfo() must have been called beforehand, or a panic occurs.

The text object should support pagination and pagination should have occurred before evaluating the field.

Parameters
aValueTextDescriptor which on return contains the current page number, converted into the appropriate style, as set by CPageFieldBase::SetNumberStyle().
Return Value
Zero if aValueText is long enough to hold the string. Otherwise, the length of the buffer which is required to hold the string.