CGlobalText Class Reference
class CGlobalText : public CPlainText |
Public Member Functions |
---|
| ~CGlobalText() |
virtual IMPORT_C void | ApplyCharFormatL(const TCharFormat &, const TCharFormatMask &, TInt, TInt) |
virtual IMPORT_C void | ApplyParaFormatL(const CParaFormat *, const TParaFormatMask &, TInt, TInt) |
virtual IMPORT_C void | CancelSelectLabel() |
virtual IMPORT_C TBool | EnquirePageBreak(TInt, TInt) |
virtual IMPORT_C void | GetCharFormat(TCharFormat &, TCharFormatMask &, TInt, TInt) |
virtual IMPORT_C void | GetChars(TPtrC &, TCharFormat &, TInt) |
virtual IMPORT_C void | GetParaFormatL(CParaFormat *, TParaFormatMask &, TInt, TInt, CParaFormat::TParaFormatGetMode) |
virtual IMPORT_C void | GetParagraphFormatL(CParaFormat *, TInt) |
virtual IMPORT_C TInt | GetPictureSizeInTwips(TSize &, TInt) |
const CCharFormatLayer * | GlobalCharFormatLayer() |
const CParaFormatLayer * | GlobalParaFormatLayer() |
virtual IMPORT_C TInt | LdDocumentLength() |
virtual 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) |
virtual IMPORT_C CPicture * | PictureHandleL(TInt, MLayDoc::TForcePictureLoad) |
virtual IMPORT_C TBool | SelectParagraphLabel(TInt) |
IMPORT_C void | SetGlobalCharFormat(const CCharFormatLayer *) |
IMPORT_C void | SetGlobalParaFormat(const CParaFormatLayer *) |
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() |
Detailed Description
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.
Member Attribute Documentation
__DECLARE_TEST
| __DECLARE_TEST | [protected] |
Constructor & Destructor Documentation
CGlobalText ( )
IMPORT_C | CGlobalText | ( | ) | [protected] |
CGlobalText ( const CParaFormatLayer *, const CCharFormatLayer * )
~CGlobalText ( )
The destructor is empty, and is present only to cause the virtual function table to be defined in a unique module.
Member Function Documentation
ApplyCharFormatL ( const TCharFormat &, const TCharFormatMask &, TInt, TInt )
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.
Parameter | Description | aFormat | Contains the character format attribute values to apply. |
aMask | Bitmask specifying the character format attributes to change. |
aPos | This argument is not used for global text. |
aLength | This argument is not used for global text. |
ApplyParaFormatL ( const CParaFormat *, const TParaFormatMask &, TInt, TInt )
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.
Parameter | Description | aFormat | Contains the paragraph format attribute values to apply. |
aMask | Bitmask specifying the paragraph format attributes to change. |
aPos | This argument is not used for global text. |
aLength | This argument is not used for global text. |
CancelSelectLabel ( )
IMPORT_C void | CancelSelectLabel | ( | ) | [virtual] |
EnquirePageBreak ( TInt, TInt )
IMPORT_C TBool | EnquirePageBreak | ( | TInt | aPos, |
| TInt | aLength = 0 |
| ) | const [virtual] |
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.
Parameter | Description | aPos | The document position from which to begin searching for a page break. |
aLength | The number of characters to search for a page break, beginning at aPos. The default is zero. |
Returns: ETrue if a page break occurs within the specified range, otherwise EFalse.
GetCharFormat ( TCharFormat &, TCharFormatMask &, TInt, TInt )
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.
Parameter | Description | aFormat | On return, contains the effective character formatting for the global text object. |
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. |
aPos | This argument is not used for global text. |
aLength | This argument is not used for global text. |
GetChars ( TPtrC &, TCharFormat &, TInt )
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.
Parameter | Description | aView | On return, a constant pointer to a portion of the text. |
aFormat | On return, contains the text object's effective character formatting. |
aStartPos | The start position for the view. |
GetParaFormatL ( CParaFormat *, TParaFormatMask &, TInt, TInt, CParaFormat::TParaFormatGetMode )
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.
Parameter | Description | aFormat | Must not be NULL or a panic occurs. On return, contains the effective paragraph formatting for the global text object. |
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. |
aPos | This argument is not used for global text. |
aLength | This argument is not used for global text. |
aMode | 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] |
Gets the text object's effective paragraph formatting. The aPos value is only used in the rich text implementation of this function.
Parameter | Description | aFormat | On return, filled with the text object's effective paragraph formatting. |
aPos | This argument is not used for global text. |
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.
GlobalCharFormatLayer ( )
Gets the character format layer referenced by the global text object.
Returns: Pointer to the character format layer referenced by the global text object.
GlobalParaFormatLayer ( )
Gets the paragraph format layer referenced by the global text object.
Returns: Pointer to the paragraph format layer referenced by the global text object.
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.
Returns: The number of characters contained in the document.
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.
Parameter | Description | 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. |
Returns: The number of characters skipped in scanning to the start of the paragraph.
NewL ( const CParaFormatLayer *, const CCharFormatLayer *, TDocumentStorage, TInt )
Allocates and constructs an empty global text object with a paragraph and a character format layer. A single end-of-document delimiter is inserted.
Parameter | Description | aGlobalParaLayer | Pointer to the paragraph format layer referenced by the text object. Must not be NULL, or a panic occurs. |
aGlobalCharLayer | Pointer to the character format layer referenced by the text object. Must not be NULL, or a panic occurs. |
aStorage | The type of in-memory buffer to use. Defaults to ESegmentedStorage. |
aDefaultTextGranularity | Specifies the granularity of the in-memory buffer. Default is EDefaultTextGranularity bytes (=256). |
Returns: Pointer to the global text object.
NewL ( const CStreamStore &, TStreamId, const CParaFormatLayer *, const CCharFormatLayer *, MTextFieldFactory *, TDocumentStorage )
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.
PictureHandleL ( TInt, MLayDoc::TForcePictureLoad )
Global text provides no support for pictures, so this implementation of the function returns NULL.
SelectParagraphLabel ( TInt )
IMPORT_C TBool | SelectParagraphLabel | ( | TInt | aPos | ) | [virtual] |
Global text does not support paragraph labels, so this function returns EFalse.
SetGlobalCharFormat ( const CCharFormatLayer * )
Replaces the character format layer referenced by the global text object.
Parameter | Description | aCharFormatLayer | Pointer to the character format layer to be referenced by the global text object. |
SetGlobalParaFormat ( const CParaFormatLayer * )
Replaces the paragraph format layer referenced by the global text object.
Parameter | Description | aParaFormatLayer | Pointer to the paragraph format layer to be referenced by the global text object. |