CGlobalText Class Reference

class CGlobalText : public CPlainText

Text with globally applied formatting.

Global text uses a single set of paragraph format attributes to describe the appearance of every paragraph and a single set of character format attributes to describe the appearance of every character.

The paragraph formatting is stored in a CParaFormatLayer and the character formatting is stored in a CCharFormatLayer . A format layer is a set of character or paragraph format attributes, which may own a pointer to another format layer. This pointer is called a based-on link. The effective formatting of a global text object is the set of attributes specified in its two format layers, as well as any attributes inherited from the layers' chain of based-on links. To get the effective formatting, the links are read in turn, so that each attribute's value is taken from the first layer in the chain in which it has been set. Use GetCharFormat() and GetParaFormatL() to get the text object's effective formatting.

A global text object references the two format layers; it does not own them. This allows more than one global text object to use the same formatting. The format layers may be modified (see ApplyParaFormatL() and ApplyCharFormatL() ) or replaced (see SetGlobalParaFormat() and SetGlobalCharFormat() ) during the text object's lifetime.

Inherits from

Public Member Functions
~CGlobalText ()
IMPORT_C void ApplyCharFormatL (const TCharFormat &, const TCharFormatMask &, TInt , TInt )
IMPORT_C void CancelSelectLabel ()
IMPORT_C void GetCharFormat ( TCharFormat &, TCharFormatMask &, TInt , TInt )
IMPORT_C void GetParaFormatL ( CParaFormat *, TParaFormatMask &, TInt , TInt , CParaFormat::TParaFormatGetMode )
IMPORT_C void GetParagraphFormatL ( CParaFormat *, TInt )
IMPORT_C TInt GetPictureSizeInTwips ( TSize &, TInt )
const CCharFormatLayer * GlobalCharFormatLayer ()
const CParaFormatLayer * GlobalParaFormatLayer ()
IMPORT_C TInt LdDocumentLength ()
IMPORT_C TInt LdToParagraphStart ( TInt &)
IMPORT_C CGlobalText * NewL (const CParaFormatLayer *, const CCharFormatLayer *, TDocumentStorage , TInt )
IMPORT_C CGlobalText * NewL (const CStreamStore &, TStreamId , const CParaFormatLayer *, const CCharFormatLayer *, MTextFieldFactory *, TDocumentStorage )
IMPORT_C CPicture * PictureHandleL ( TInt , MLayDoc::TForcePictureLoad )
IMPORT_C TBool SelectParagraphLabel ( TInt )
IMPORT_C void SetGlobalCharFormat (const CCharFormatLayer *)
IMPORT_C void SetGlobalParaFormat (const CParaFormatLayer *)
Protected Member Functions
CGlobalText ()
CGlobalText (const CParaFormatLayer *, const CCharFormatLayer *)
Private Member Functions
CGlobalText (const CGlobalText &)
CGlobalText & operator= (const CGlobalText &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CEditableText::CancelFepInlineEdit(TBool &,TInt &,TInt &,TInt &,TInt)
CEditableText::CommitFepInlineEditL(TBool &,TInt &,TInt &,TInt &,TInt)
CEditableText::GetLengthOfInlineText()const
CEditableText::GetPositionOfInlineTextInDocument()const
CEditableText::HasChanged()const
CEditableText::OverrideFormatOfInlineTextIfApplicable(TPtrC &,TCharFormat &,TInt)const
CEditableText::RestoreL(const CStreamStore &,TStreamId)
CEditableText::SetHasChanged(TBool)
CEditableText::StartFepInlineEditL(TBool &,TInt &,TInt &,TInt &,TInt,const TDesC &,TInt,TInt,MFepInlineTextFormatRetriever &)
CEditableText::StoreL(CStreamStore &)const
CEditableText::UpdateFepInlineTextL(TBool &,TInt &,TInt &,TInt &,TInt,const TDesC &)
CEditableText::~CEditableText()
CPlainText::CPlainText()
CPlainText::CharPosOfParagraph(TInt &,TInt)const
CPlainText::ComponentInfo()const
CPlainText::ConstructL(TDocumentStorage,TInt)
CPlainText::ConstructL(const CStreamStore &,TStreamId,MTextFieldFactory *,TDocumentStorage)
CPlainText::ConsumeAdornmentL(RReadStream &)
CPlainText::ConvertAllFieldsToText()
CPlainText::ConvertFieldToText(TInt)
CPlainText::CopyComponentsL(CStreamStore &,CStoreMap &,TInt,TInt)const
CPlainText::CopyToStoreL(CStreamStore &,CStreamDictionary &,TInt,TInt)const
CPlainText::CopyToStreamL(RWriteStream &,TInt,TInt)const
CPlainText::Delete(TInt,TInt)
CPlainText::DeleteL(TInt,TInt)
CPlainText::DoConstructL(TDocumentStorage,TInt,MTextFieldFactory *)
CPlainText::DoCopyToStoreL(CStreamStore &,CStreamDictionary &,TInt,TInt)const
CPlainText::DoExternalizeFieldDataL(RWriteStream &)const
CPlainText::DoExternalizePlainTextL(RWriteStream &)const
CPlainText::DoExtract(TDes &,TInt,TInt,TUint)const
CPlainText::DoInternalizeFieldDataL(RReadStream &)
CPlainText::DoInternalizePlainTextL(RReadStream &)
CPlainText::DoPasteFromStoreL(const CStreamStore &,TStreamId,TInt)
CPlainText::DoPtDelete(TInt,TInt)
CPlainText::DoPtInsertL(TInt,const TDesC &)
CPlainText::DocumentLength()const
CPlainText::ExportAsTextL(const TDes &,TTextOrganisation,TInt)const
CPlainText::ExportTextL(TInt,RWriteStream &,TTextOrganisation,TInt,TInt,TInt,TInt *,TInt *)const
CPlainText::ExportTextL(TInt,RWriteStream &,const TImportExportParam &,TImportExportResult &)const
CPlainText::ExtendedInterface(TAny *&,TUid)
CPlainText::ExternalizeFieldDataL(RWriteStream &)const
CPlainText::ExternalizeL(RWriteStream &)const
CPlainText::ExternalizePlainTextL(RWriteStream &)const
CPlainText::ExternalizePlainTextNoLengthCountL(RWriteStream &)const
CPlainText::Extract(TDes &,TInt)const
CPlainText::Extract(TDes &,TInt,TInt)const
CPlainText::ExtractSelectively(TDes &,TInt,TInt,TUint)
CPlainText::FieldCount()const
CPlainText::FieldFactory()const
CPlainText::FindFields(TFindFieldInfo &,TInt,TInt)const
CPlainText::FindFields(TInt)const
CPlainText::GetWordInfo(TInt,TInt &,TInt &,TBool,TBool)const
CPlainText::ImportTextFileL(TInt,const TDes &,TTextOrganisation)
CPlainText::ImportTextL(TInt,RReadStream &,TTextOrganisation,TInt,TInt,TInt *,TInt *)
CPlainText::ImportTextL(TInt,RReadStream &,const TImportExportParam &,TImportExportResult &)
CPlainText::InsertFieldL(TInt,CTextField *,TUid)
CPlainText::InsertL(TInt,const CPlainText *)
CPlainText::InsertL(TInt,const TChar &)
CPlainText::InsertL(TInt,const TDesC &)
CPlainText::InternalizeFieldDataL(RReadStream &)
CPlainText::InternalizeL(RReadStream &)
CPlainText::InternalizePlainTextL(RReadStream &)
CPlainText::InternalizePlainTextL(RReadStream &,TInt)
CPlainText::NewL(TDocumentStorage,TInt)
CPlainText::NewL(const CStreamStore &,TStreamId,MTextFieldFactory *,TDocumentStorage)
CPlainText::NewTextFieldL(TUid)const
CPlainText::PageContainingPos(TInt)const
CPlainText::ParagraphCount()const
CPlainText::ParagraphNumberForPos(TInt &)const
CPlainText::PasteComponentsL(const CStreamStore &,TInt)
CPlainText::PasteFromStoreL(const CStreamStore &,const CStreamDictionary &,TInt)
CPlainText::PtInsertL(TInt,const TDesC &)
CPlainText::Read(TInt)const
CPlainText::Read(TInt,TInt)const
CPlainText::RemoveField(TInt)
CPlainText::Reset()
CPlainText::RestoreComponentsL(const CStreamStore &)
CPlainText::RestoreFieldComponentsL(const CStreamStore &)
CPlainText::ScanParas(TInt &,TUint &)const
CPlainText::ScanWords(TInt &,TUint &)const
CPlainText::SetFieldFactory(MTextFieldFactory *)
CPlainText::SetPageTable(TPageTable *)
CPlainText::StoreComponentsL(CStreamStore &,CStoreMap &)const
CPlainText::StoreFieldComponentsL(CStreamStore &,CStoreMap &)const
CPlainText::TextField(TInt)const
CPlainText::ToParagraphStart(TInt &)const
CPlainText::UidFromStreamL(RReadStream &)
CPlainText::UpdateAllFieldsL()
CPlainText::UpdateFieldL(TInt)
CPlainText::WordCount()const
CPlainText::~CPlainText()
Inherited Enumerations
CEditableText:@49
CEditableText:@50
CEditableText:TDocumentStorage
CPlainText:@51
CPlainText:@52
CPlainText:@53
CPlainText:TScanDataEnd
CPlainText:TTextOrganisation
CPlainText:TUnitOfText
Protected Attributes
__DECLARE_TEST
const CCharFormatLayer * iGlobalCharFormatLayer
const CParaFormatLayer * iGlobalParaFormatLayer
Private Attributes
void * iReserved_2
Inherited Attributes
CEditableText::iHasChanged
CPlainText::iByteStore
CPlainText::iFieldFactory
CPlainText::iFieldSet
CPlainText::iPageTable

Constructor & Destructor Documentation

CGlobalText()

IMPORT_C CGlobalText ( ) [protected]

CGlobalText(const CParaFormatLayer *, const CCharFormatLayer *)

IMPORT_C CGlobalText ( const CParaFormatLayer * aGlobalParaLayer,
const CCharFormatLayer * aGlobalCharLayer
) [protected]

Parameters

const CParaFormatLayer * aGlobalParaLayer
const CCharFormatLayer * aGlobalCharLayer

CGlobalText(const CGlobalText &)

CGlobalText ( const CGlobalText & aGlobalText ) [private]

Parameters

const CGlobalText & aGlobalText

~CGlobalText()

IMPORT_C ~CGlobalText ( )

The destructor is empty, and is present only to cause the virtual function table to be defined in a unique module.

Member Functions Documentation

ApplyCharFormatL(const TCharFormat &, const TCharFormatMask &, TInt, TInt)

IMPORT_C void ApplyCharFormatL ( const TCharFormat & aFormat,
const TCharFormatMask & aMask,
TInt aPos,
TInt aLength
) [virtual]

Parameters

const TCharFormat & aFormat
const TCharFormatMask & aMask
TInt aPos
TInt aLength

CancelSelectLabel()

IMPORT_C void CancelSelectLabel ( ) [virtual]

GetCharFormat(TCharFormat &, TCharFormatMask &, TInt, TInt)

IMPORT_C void GetCharFormat ( TCharFormat & aFormat,
TCharFormatMask & aVaries,
TInt aPos,
TInt aLength
) const [virtual]

Gets the global text object's effective character formatting. Note that the last three arguments are not relevant to the global text implementation of this function.

Parameters

TCharFormat & aFormat On return, contains the effective character formatting for the global text object.
TCharFormatMask & aVaries On return, a bitmask indicating which character format attributes vary over the range of characters selected. This is only relevant for rich text, so for global text returns a value of zero for all attributes.
TInt aPos This argument is not used for global text.
TInt aLength This argument is not used for global text.

GetParaFormatL(CParaFormat *, TParaFormatMask &, TInt, TInt, CParaFormat::TParaFormatGetMode)

IMPORT_C void GetParaFormatL ( CParaFormat * aFormat,
TParaFormatMask & aVaries,
TInt aPos,
TInt aLength,
CParaFormat::TParaFormatGetMode aMode = CParaFormat::EAllAttributes
) const [virtual]

Gets the the global text object's effective paragraph formatting. Note that the position and length arguments are only used in the rich text implementation of this function.

Parameters

CParaFormat * aFormat Must not be NULL or a panic occurs. On return, contains the effective paragraph formatting for the global text object.
TParaFormatMask & aVaries On return, a bitmask indicating which paragraph format attributes vary over the range of characters selected. This is only relevant for rich text, so for global text returns a value of zero for all attributes.
TInt aPos This argument is not used for global text.
TInt aLength This argument is not used for global text.
CParaFormat::TParaFormatGetMode aMode = CParaFormat::EAllAttributes The default, EAllAttributes indicates that values for all paragraph format attributes are written to aFormat. EFixedAttributes indicates that tabs, bullets and borders are not written to aFormat.

GetParagraphFormatL(CParaFormat *, TInt)

IMPORT_C void GetParagraphFormatL ( CParaFormat * aFormat,
TInt aPos
) const [virtual]

Parameters

CParaFormat * aFormat
TInt aPos

GetPictureSizeInTwips(TSize &, TInt)

IMPORT_C TInt GetPictureSizeInTwips ( TSize & aSize,
TInt aPos
) const [virtual]

Global text provides no support for pictures, so this implementation of the function returns KErrNotFound.

Parameters

TSize & aSize
TInt aPos

GlobalCharFormatLayer()

const CCharFormatLayer * GlobalCharFormatLayer ( ) const [inline]

GlobalParaFormatLayer()

const CParaFormatLayer * GlobalParaFormatLayer ( ) const [inline]

LdDocumentLength()

IMPORT_C TInt LdDocumentLength ( ) const [virtual]

Gets the the number of characters in the document.

Note: the count includes all non-printing characters but excludes the end of text paragraph delimiter, so that the smallest return value is always zero.

LdToParagraphStart(TInt &)

IMPORT_C TInt LdToParagraphStart ( TInt & aCurrentPos ) const [virtual]

Gets the document position of the start of the paragraph containing a specified document position.

Parameters

TInt & aCurrentPos Specifies a document position: must be valid or a panic occurs. On return, specifies the document position of the first character in the paragraph in which it is located.

NewL(const CParaFormatLayer *, const CCharFormatLayer *, TDocumentStorage, TInt)

IMPORT_C CGlobalText * NewL ( const CParaFormatLayer * aGlobalParaLayer,
const CCharFormatLayer * aGlobalCharLayer,
TDocumentStorage aStorage = ESegmentedStorage,
TInt aDefaultTextGranularity = EDefaultTextGranularity
) [static]

Allocates and constructs an empty global text object with a paragraph and a character format layer. A single end-of-document delimiter is inserted.

Parameters

const CParaFormatLayer * aGlobalParaLayer Pointer to the paragraph format layer referenced by the text object. Must not be NULL, or a panic occurs.
const CCharFormatLayer * aGlobalCharLayer Pointer to the character format layer referenced by the text object. Must not be NULL, or a panic occurs.
TDocumentStorage aStorage = ESegmentedStorage The type of in-memory buffer to use. Defaults to ESegmentedStorage.
TInt aDefaultTextGranularity = EDefaultTextGranularity Specifies the granularity of the in-memory buffer. Default is EDefaultTextGranularity bytes (=256).

NewL(const CStreamStore &, TStreamId, const CParaFormatLayer *, const CCharFormatLayer *, MTextFieldFactory *, TDocumentStorage)

IMPORT_C CGlobalText * NewL ( const CStreamStore & aStore,
TStreamId aStreamId,
const CParaFormatLayer * aGlobalParaLayer,
const CCharFormatLayer * aGlobalCharLayer,
MTextFieldFactory * aFieldFactory = NULL,
TDocumentStorage  = ESegmentedStorage
) [static]

Returns a handle to a new instance of this class, whose textual content is restored from the specified read-stream. The global text object *uses* (does not own) the supplied global format layers.

Parameters

const CStreamStore & aStore
TStreamId aStreamId
const CParaFormatLayer * aGlobalParaLayer
const CCharFormatLayer * aGlobalCharLayer
MTextFieldFactory * aFieldFactory = NULL
TDocumentStorage  = ESegmentedStorage

PictureHandleL(TInt, MLayDoc::TForcePictureLoad)

IMPORT_C CPicture * PictureHandleL ( TInt aPos,
MLayDoc::TForcePictureLoad aForceLoad
) const [virtual]

Global text provides no support for pictures, so this implementation of the function returns NULL.

Parameters

TInt aPos
MLayDoc::TForcePictureLoad aForceLoad

SelectParagraphLabel(TInt)

IMPORT_C TBool SelectParagraphLabel ( TInt aPos ) [virtual]

Global text does not support paragraph labels, so this function returns EFalse.

Parameters

TInt aPos

SetGlobalCharFormat(const CCharFormatLayer *)

IMPORT_C void SetGlobalCharFormat ( const CCharFormatLayer * aCharFormatLayer )

Parameters

const CCharFormatLayer * aCharFormatLayer

SetGlobalParaFormat(const CParaFormatLayer *)

IMPORT_C void SetGlobalParaFormat ( const CParaFormatLayer * aParaFormatLayer )

Replaces the paragraph format layer referenced by the global text object.

Parameters

const CParaFormatLayer * aParaFormatLayer Pointer to the paragraph format layer to be referenced by the global text object.

operator=(const CGlobalText &)

CGlobalText & operator= ( const CGlobalText & aGlobalText ) [private]

Parameters

const CGlobalText & aGlobalText

Member Data Documentation

__DECLARE_TEST

__DECLARE_TEST [protected]

const CCharFormatLayer * iGlobalCharFormatLayer

const CCharFormatLayer * iGlobalCharFormatLayer [protected]

const CParaFormatLayer * iGlobalParaFormatLayer

const CParaFormatLayer * iGlobalParaFormatLayer [protected]

void * iReserved_2

void * iReserved_2 [private]