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.
Protected Member Functions | |
---|---|
CGlobalText() | |
CGlobalText(const CParaFormatLayer *, const CCharFormatLayer *) |
Private Member Functions | |
---|---|
CGlobalText(const CGlobalText &) | |
CGlobalText & | operator=(const CGlobalText &) |
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 |
IMPORT_C | CGlobalText | ( | const CParaFormatLayer * | aGlobalParaLayer, |
const CCharFormatLayer * | aGlobalCharLayer | |||
) | [protected] |
const CParaFormatLayer * aGlobalParaLayer | |
const CCharFormatLayer * aGlobalCharLayer |
CGlobalText | ( | const CGlobalText & | aGlobalText | ) | [private] |
const CGlobalText & aGlobalText |
IMPORT_C | ~CGlobalText | ( | ) |
The destructor is empty, and is present only to cause the virtual function table to be defined in a unique module.
IMPORT_C void | ApplyCharFormatL | ( | const TCharFormat & | aFormat, |
const TCharFormatMask & | aMask, | |||
TInt | aPos, | |||
TInt | aLength | |||
) | [virtual] |
const TCharFormat & aFormat | |
const TCharFormatMask & aMask | |
TInt aPos | |
TInt aLength |
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.
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. |
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.
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. |
IMPORT_C void | GetParagraphFormatL | ( | CParaFormat * | aFormat, |
TInt | aPos | |||
) | const [virtual] |
CParaFormat * aFormat | |
TInt aPos |
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.
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.
IMPORT_C TInt | LdToParagraphStart | ( | TInt & | aCurrentPos | ) | const [virtual] |
Gets the document position of the start of the paragraph containing a specified document position.
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. |
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.
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). |
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.
const CStreamStore & aStore | |
TStreamId aStreamId | |
const CParaFormatLayer * aGlobalParaLayer | |
const CCharFormatLayer * aGlobalCharLayer | |
MTextFieldFactory * aFieldFactory = NULL | |
TDocumentStorage = ESegmentedStorage |
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.
TInt aPos | |
MLayDoc::TForcePictureLoad aForceLoad |
IMPORT_C TBool | SelectParagraphLabel | ( | TInt | aPos | ) | [virtual] |
Global text does not support paragraph labels, so this function returns EFalse.
TInt aPos |
IMPORT_C void | SetGlobalCharFormat | ( | const CCharFormatLayer * | aCharFormatLayer | ) |
const CCharFormatLayer * aCharFormatLayer |
IMPORT_C void | SetGlobalParaFormat | ( | const CParaFormatLayer * | aParaFormatLayer | ) |
Replaces the paragraph format layer referenced by the global text object.
const CParaFormatLayer * aParaFormatLayer | Pointer to the paragraph format layer to be referenced by the global text object. |
CGlobalText & | operator= | ( | const CGlobalText & | aGlobalText | ) | [private] |
const CGlobalText & aGlobalText |
const CCharFormatLayer * | iGlobalCharFormatLayer | [protected] |
const CParaFormatLayer * | iGlobalParaFormatLayer | [protected] |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.