Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: fldbase.h
Link against:

Class MTextFieldFactory

MTextFieldFactory

Support

Supported from 5.0

Description

Abstract base class for field factories. Defines a single pure virtual function — NewFieldL().

To use fields in editable text,

1) Define a field factory class (derived from MTextFieldFactory). It must implement the pure virtual NewFieldL() function, to create and return fields given a type.

2) Create an instance of the field factory and set this to be the editable text object's field factory (see CPlainText::SetFieldFactory(), or you can specify a field factory in the text object 's NewL()).

3) Create a new field (CPlainText::NewTextFieldL()), specifying the field type UID (the built in field type UID values are defined in flddef.h). This calls the factory's NewFieldL() function.

4) Insert the field into the text object (CPlainText::InsertFieldL()).

5) Evaluate the field (CPlainText::UpdateFieldL()) and then re-evaluate as required.

Defined in MTextFieldFactory:
NewFieldL()


Create a field


NewFieldL()

virtual CTextField* NewFieldL(TUid aFieldType);

Description

Implementations of this function should create a field of the type specified, returning NULL if the field type is not recognised or supported.

Parameters

TUid aFieldType

The field's type UID.

Return value

CTextField*

Pointer to the new text field, or NULL if the factory does not recognise or support the field type.