CFileNameField Class Reference

#include <fldbltin.h>

Link against: field.lib

class CFileNameField : public CTextField, public CTextField

Inherits from

Detailed Description

A filename field.

This is a field which evaluates to the filename of the current document. Before the filename field can be evaluated, it must be passed a pointer to an object which implements the UpdateFieldFileName() function.

Member Attribute Documentation

iFileNameInfo

MFieldFileNameInfo *iFileNameInfo[protected]

Member Function Documentation

InternalizeL ( RReadStream & )

voidInternalizeL(RReadStream &)[inline, virtual]

Overrides the base class method to do nothing, because this class has no persistent data.

RestoreL ( const CStreamStore &, TStreamId )

IMPORT_C voidRestoreL(const CStreamStore &aStore,
TStreamIdaId
)[virtual]

Restores the field data from a stream store. Concrete field types with no persistent data should override this function to do nothing.

Parameters
aStoreStream store containing the field data to restore.
aIdThe ID of the stream store in which the field data was previously stored.

SetFileNameInfo ( MFieldFileNameInfo * )

voidSetFileNameInfo(MFieldFileNameInfo *aInfo)[inline]

Sets the object which implements the UpdateFieldFileName() function, to get the current document's filename. SetFileNameInfo() must be called before the filename field can be evaluated.

Parameters
aInfoPointer to an object which implements the UpdateFieldFileName() function.

StoreL ( CStreamStore & )

IMPORT_C TStreamIdStoreL(CStreamStore &aStore)const [virtual]

Stores the field data to a stream store. Concrete field types with no persistent data should override this function to return KNullStreamId.

Parameters
aStoreStream store to which the field data is written.
Return Value
The ID of the stream store.

Type ( )

IMPORT_C TUidType()const [virtual]

Reimplemented from CTextField::Type()const

Gets the field's type UID.

Return Value
KFileNameFieldUid.

Value ( TPtr & )

IMPORT_C TIntValue(TPtr &aValueText)[virtual]

Reimplemented from CTextField::Value(TPtr &)

Gets the document's filename, by calling UpdateFieldFileName() (implemented by the object passed to the filename field using SetFileNameInfo()).

Note

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

Parameters
aValueTextDescriptor which on return contains the document's filename.
Return Value
Zero if aValueText is long enough to hold the filename. Otherwise, the length of the buffer which is required to hold the filename.