Location:
txtglobl.h
Link against: etext.lib
CGlobalText
Supported from 5.0
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.
|
Defined in CGlobalText
:
ApplyCharFormatL()
, ApplyParaFormatL()
, CancelSelectLabel()
, EnquirePageBreak()
, GetCharFormat()
, GetChars()
, GetParaFormatL()
, GetParagraphFormatL()
, GetPictureSizeInTwips()
, GlobalCharFormatLayer()
, GlobalParaFormatLayer()
, LdDocumentLength()
, LdToParagraphStart()
, NewL()
, PictureHandleL()
, SelectParagraphLabel()
, SetGlobalCharFormat()
, SetGlobalParaFormat()
, ~CGlobalText()
Inherited from CBase
:
operator new()
Inherited from CEditableText
:
EDefaultTextGranularity
,
EFlatStorage
,
ELineBreak
,
ENonBreakingHyphen
,
ENonBreakingSpace
,
ENonBreakingTab
,
EPageBreak
,
EParagraphDelimiter
,
EPictureCharacter
,
EPotentialHyphen
,
ESegmentedStorage
,
ETabCharacter
,
EVisibleSpaceCharacter
,
HasChanged()
,
RestoreL()
,
SetHasChanged()
,
StoreL()
,
TDocumentStorage
Inherited from CPlainText
:
Anonymous
,
CharPosOfParagraph()
,
ComponentInfo()
,
ConvertAllFieldsToText()
,
ConvertFieldToText()
,
CopyToStoreL()
,
DeleteL()
,
DocumentLength()
,
EOrganiseByLine
,
EOrganiseByParagraph
,
EScanBackwards
,
EScanEndOfData
,
EScanJoinDelimiters
,
EScanPictureIsDelimiter
,
EScanPunctuationIsDelimiter
,
EScanStayIfBoundary
,
EScanToUnitEnd
,
EScanToUnitStart
,
ExportAsTextL()
,
ExportTextL()
,
ExternalizeFieldDataL()
,
ExternalizeL()
,
ExternalizePlainTextL()
,
ExternalizePlainTextNoLengthCountL()
,
Extract()
,
FieldCount()
,
FieldFactory()
,
FindFields()
,
GetWordInfo()
,
ImportTextFileL()
,
ImportTextL()
,
InsertFieldL()
,
InsertL()
,
InternalizeFieldDataL()
,
InternalizeL()
,
InternalizePlainTextL()
,
NewTextFieldL()
,
PageContainingPos()
,
ParagraphCount()
,
ParagraphNumberForPos()
,
PasteFromStoreL()
,
Read()
,
RemoveField()
,
Reset()
,
RestoreComponentsL()
,
RestoreFieldComponentsL()
,
ScanParas()
,
ScanWords()
,
SetFieldFactory()
,
SetPageTable()
,
StoreComponentsL()
,
StoreFieldComponentsL()
,
TImportExportParam
,
TImportExportResult
,
TScanDataEnd
,
TTextOrganisation
,
TextField()
,
ToParagraphStart()
,
UpdateAllFieldsL()
,
UpdateFieldL()
,
WordCount()
Inherited from MLayDoc
:
EForceLoadFalse
,
EForceLoadTrue
,
TForcePictureLoad
static CGlobalText* NewL(const CParaFormatLayer* aGlobalParaLayer,const CCharFormatLayer* aGlobalCharLayer, TDocumentStorage aStorage=ESegmentedStorage,TInt aDefaultTextGranularity=EDefaultTextGranularity);
Allocates and constructs an empty global text object with a paragraph and a character format layer. A single end-of-document delimiter is inserted.
|
|
static CGlobalText* NewL(const CStreamStore& aStore,TStreamId aStreamId, const CParaFormatLayer* aGlobalParaLayer,const CCharFormatLayer* aGlobalCharLayer, MTextFieldFactory* aFieldFactory=NULL, TDocumentStorage=ESegmentedStorage);
Allocates and constructs a new global text object with a paragraph and a character format layer. Its text content and field set are restored from the stream store specified.
Note
If the text object supports fields, a field factory should be specified.
|
|
~CGlobalText();
The destructor is empty, and is present only to cause the virtual function table to be defined in a unique module.
const CCharFormatLayer* GlobalCharFormatLayer()const;
Gets the character format layer referenced by the global text object.
|
const CParaFormatLayer* GlobalParaFormatLayer()const;
Gets the paragraph format layer referenced by the global text object.
|
void SetGlobalCharFormat(const CCharFormatLayer* aCharFormatLayer);
Replaces the character format layer referenced by the global text object.
|
void SetGlobalParaFormat(const CParaFormatLayer* aParaFormatLayer);
Replaces the paragraph format layer referenced by the global text object.
|
virtual void GetCharFormat(TCharFormat& aFormat,TCharFormatMask& aVaries,TInt aPos,TInt aLength)const;
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.
|
virtual void GetParaFormatL(CParaFormat* aFormat,TParaFormatMask& aVaries,TInt aPos,TInt aLength, CParaFormat::TParaFormatGetMode aMode=CParaFormat::EAllAttributes)const;
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.
|
virtual void ApplyCharFormatL(const TCharFormat& aFormat,const TCharFormatMask& aMask,TInt aPos,TInt aLength);
Changes the text object's character formatting. The attributes which are
set in the mask are read from aFormat
into the text object's
character format layer. The attributes which are not set in the mask are not
changed. Note that the position and length arguments are only used in the rich
text implementation of this function.
|
virtual void ApplyParaFormatL(const CParaFormat* aFormat,const TParaFormatMask& aMask,TInt aPos,TInt aLength);
Changes the text object's paragraph formatting. The attributes which are
set in the mask are read from aFormat
into the text object's
paragraph format layer. The attributes which are not set in the mask are not
changed. Note that the position and length arguments are only used in the rich
text implementation of this function.
|
virtual TBool EnquirePageBreak(TInt aPos,TInt aLength=0)const;
Tests whether a page break occurs within a range of characters. Returns
false if no page table has been set up: see
CPlainText::SetPageTable()
. The start and end of the range must be
valid document positions, or a panic occurs.
|
|
virtual void GetChars(TPtrC& aView,TCharFormat& aFormat,TInt aStartPos)const;
Gets a constant pointer descriptor to a portion of the text object. The
portion starts at document position aStartPos
, and ends at the end
of the document, or the end of the segment, if segmented storage is being used.
Also fills a character format object with the text object's effective character
formatting. The start position must be valid, or a panic occurs.
|
virtual void GetParagraphFormatL(CParaFormat* aFormat,TInt aPos)const;
Gets the text object's effective paragraph formatting. The
aPos
value is only used in the rich text implementation of this
function.
|
virtual TInt LdDocumentLength()const;
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.
|
virtual TInt LdToParagraphStart(TInt& aCurrentPos)const;
Gets the document position of the start of the paragraph containing a specified document position.
|
|
virtual TInt GetPictureSizeInTwips(TSize& aSize, TInt aPos)const;
Global text provides no support for pictures, so this implementation of
the function returns KErrNotFound
.
virtual CPicture* PictureHandleL(TInt aPos,MLayDoc::TForcePictureLoad aForceLoad)const;
Global text provides no support for pictures, so this implementation of the function returns NULL.
virtual TBool SelectParagraphLabel(TInt aPos);
Global text does not support paragraph labels, so this function returns
EFalse
.
virtual void CancelSelectLabel();
Not supported.