CGlobalText Class Reference

#include <txtglobl.h>

Link against: etext.lib

class CGlobalText : public CPlainText

Inherits from

  • CGlobalText
    Protected Attributes
    __DECLARE_TEST
    const CCharFormatLayer *iGlobalCharFormatLayer
    const CParaFormatLayer *iGlobalParaFormatLayer
    Public Member Functions
    ~CGlobalText()
    virtual IMPORT_C voidApplyCharFormatL(const TCharFormat &, const TCharFormatMask &, TInt, TInt)
    virtual IMPORT_C voidApplyParaFormatL(const CParaFormat *, const TParaFormatMask &, TInt, TInt)
    virtual IMPORT_C voidCancelSelectLabel()
    virtual IMPORT_C TBoolEnquirePageBreak(TInt, TInt)
    virtual IMPORT_C voidGetCharFormat(TCharFormat &, TCharFormatMask &, TInt, TInt)
    virtual IMPORT_C voidGetChars(TPtrC &, TCharFormat &, TInt)
    virtual IMPORT_C voidGetParaFormatL(CParaFormat *, TParaFormatMask &, TInt, TInt, CParaFormat::TParaFormatGetMode)
    virtual IMPORT_C voidGetParagraphFormatL(CParaFormat *, TInt)
    virtual IMPORT_C TIntGetPictureSizeInTwips(TSize &, TInt)
    const CCharFormatLayer *GlobalCharFormatLayer()
    const CParaFormatLayer *GlobalParaFormatLayer()
    virtual IMPORT_C TIntLdDocumentLength()
    virtual IMPORT_C TIntLdToParagraphStart(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 TBoolSelectParagraphLabel(TInt)
    IMPORT_C voidSetGlobalCharFormat(const CCharFormatLayer *)
    IMPORT_C voidSetGlobalParaFormat(const CParaFormatLayer *)
    Protected Member Functions
    CGlobalText()
    CGlobalText(const CParaFormatLayer *, const CCharFormatLayer *)
    Inherited Attributes
    CEditableText::iHasChanged
    CPlainText::iByteStore
    CPlainText::iFieldFactory
    CPlainText::iFieldSet
    CPlainText::iPageTable
    Inherited Enumerations
    CEditableText:@49
    CEditableText:@50
    CEditableText:TDocumentStorage
    CPlainText:@51
    CPlainText:@52
    CPlainText:@53
    CPlainText:TScanDataEnd
    CPlainText:TTextOrganisation
    CPlainText:TUnitOfText
    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]

    iGlobalCharFormatLayer

    const CCharFormatLayer *iGlobalCharFormatLayer[protected]

    iGlobalParaFormatLayer

    const CParaFormatLayer *iGlobalParaFormatLayer[protected]

    Constructor & Destructor Documentation

    CGlobalText ( )

    IMPORT_CCGlobalText()[protected]

    CGlobalText ( const CParaFormatLayer *, const CCharFormatLayer * )

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

    ~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 Function Documentation

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

    IMPORT_C voidApplyCharFormatL(const TCharFormat &aFormat,
    const TCharFormatMask &aMask,
    TIntaPos,
    TIntaLength
    )[virtual]

    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.

    ParameterDescription
    aFormatContains the character format attribute values to apply.
    aMaskBitmask specifying the character format attributes to change.
    aPosThis argument is not used for global text.
    aLengthThis argument is not used for global text.

    ApplyParaFormatL ( const CParaFormat *, const TParaFormatMask &, TInt, TInt )

    IMPORT_C voidApplyParaFormatL(const CParaFormat *aFormat,
    const TParaFormatMask &aMask,
    TIntaPos,
    TIntaLength
    )[virtual]

    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.

    ParameterDescription
    aFormatContains the paragraph format attribute values to apply.
    aMaskBitmask specifying the paragraph format attributes to change.
    aPosThis argument is not used for global text.
    aLengthThis argument is not used for global text.

    CancelSelectLabel ( )

    IMPORT_C voidCancelSelectLabel()[virtual]

    Not supported.

    EnquirePageBreak ( TInt, TInt )

    IMPORT_C TBoolEnquirePageBreak(TIntaPos,
    TIntaLength = 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.

    ParameterDescription
    aPosThe document position from which to begin searching for a page break.
    aLengthThe 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 )

    IMPORT_C voidGetCharFormat(TCharFormat &aFormat,
    TCharFormatMask &aVaries,
    TIntaPos,
    TIntaLength
    )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.

    ParameterDescription
    aFormatOn return, contains the effective character formatting for the global text object.
    aVariesOn 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.
    aPosThis argument is not used for global text.
    aLengthThis argument is not used for global text.

    GetChars ( TPtrC &, TCharFormat &, TInt )

    IMPORT_C voidGetChars(TPtrC &aView,
    TCharFormat &aFormat,
    TIntaStartPos
    )const [virtual]

    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.

    ParameterDescription
    aViewOn return, a constant pointer to a portion of the text.
    aFormatOn return, contains the text object's effective character formatting.
    aStartPosThe start position for the view.

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

    IMPORT_C voidGetParaFormatL(CParaFormat *aFormat,
    TParaFormatMask &aVaries,
    TIntaPos,
    TIntaLength,
    CParaFormat::TParaFormatGetModeaMode = 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.

    ParameterDescription
    aFormatMust not be NULL or a panic occurs. On return, contains the effective paragraph formatting for the global text object.
    aVariesOn 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.
    aPosThis argument is not used for global text.
    aLengthThis argument is not used for global text.
    aModeThe 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 voidGetParagraphFormatL(CParaFormat *aFormat,
    TIntaPos
    )const [virtual]

    Gets the text object's effective paragraph formatting. The aPos value is only used in the rich text implementation of this function.

    ParameterDescription
    aFormatOn return, filled with the text object's effective paragraph formatting.
    aPosThis argument is not used for global text.

    GetPictureSizeInTwips ( TSize &, TInt )

    IMPORT_C TIntGetPictureSizeInTwips(TSize &aSize,
    TIntaPos
    )const [virtual]

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

    GlobalCharFormatLayer ( )

    const CCharFormatLayer *GlobalCharFormatLayer()const [inline]

    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 ( )

    const CParaFormatLayer *GlobalParaFormatLayer()const [inline]

    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 TIntLdDocumentLength()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 TIntLdToParagraphStart(TInt &aCurrentPos)const [virtual]

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

    ParameterDescription
    aCurrentPosSpecifies 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 )

    IMPORT_C CGlobalText *NewL(const CParaFormatLayer *aGlobalParaLayer,
    const CCharFormatLayer *aGlobalCharLayer,
    TDocumentStorageaStorage = ESegmentedStorage,
    TIntaDefaultTextGranularity = 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.

    ParameterDescription
    aGlobalParaLayerPointer to the paragraph format layer referenced by the text object. Must not be NULL, or a panic occurs.
    aGlobalCharLayerPointer to the character format layer referenced by the text object. Must not be NULL, or a panic occurs.
    aStorageThe type of in-memory buffer to use. Defaults to ESegmentedStorage.
    aDefaultTextGranularitySpecifies 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 )

    IMPORT_C CGlobalText *NewL(const CStreamStore &aStore,
    TStreamIdaStreamId,
    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.

    PictureHandleL ( TInt, MLayDoc::TForcePictureLoad )

    IMPORT_C CPicture *PictureHandleL(TIntaPos,
    MLayDoc::TForcePictureLoadaForceLoad
    )const [virtual]

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

    SelectParagraphLabel ( TInt )

    IMPORT_C TBoolSelectParagraphLabel(TIntaPos)[virtual]

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

    SetGlobalCharFormat ( const CCharFormatLayer * )

    IMPORT_C voidSetGlobalCharFormat(const CCharFormatLayer *aCharFormatLayer)

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

    ParameterDescription
    aCharFormatLayerPointer to the character format layer to be referenced by the global text object.

    SetGlobalParaFormat ( const CParaFormatLayer * )

    IMPORT_C voidSetGlobalParaFormat(const CParaFormatLayer *aParaFormatLayer)

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

    ParameterDescription
    aParaFormatLayerPointer to the paragraph format layer to be referenced by the global text object.