Location:
txtlaydc.h
Link against:
MLayDoc
Supported from 5.0
This class specifies the mixin protocol for providing the
information needed by the text layout engine to lay out a text object. It is
inherited by classes which implement this protocol. Examples of such classes
are CRichText
and CGlobalText
.
At the heart of the interface are two interrogation functions; one gives the paragraph formatting for a document position, and the other gives a pointer descriptor to a series of contiguous characters with identical character formatting, and their character formatting. This information is sufficient for the layout engine to find the formatting and content of an entire document.
The constructor for the layout engine (CTextLayout
) is
prototyped as:
static CTextLayout *NewL(MLayDoc *aDoc,TInt aWrapWidth);
By viewing the text object purely in terms of the
MLayDoc
interface, the layout engine is insulated from any
editable text implementation issues.
Defined in MLayDoc
:
CancelSelectLabel()
, EForceLoadFalse
, EForceLoadTrue
, EnquirePageBreak()
, GetChars()
, GetParagraphFormatL()
, GetPictureSizeInTwips()
, LdDocumentLength()
, LdToParagraphStart()
, PictureHandleL()
, SelectParagraphLabel()
, TForcePictureLoad
virtual TInt LdDocumentLength()const=0;
Gets the the number of characters in the document.
|
virtual TInt LdToParagraphStart(TInt& aCurrentPos)const=0;
Gets the document position of the start of the paragraph containing a specified position.
|
|
virtual void GetParagraphFormatL(CParaFormat* aFormat,TInt aPos)const=0;
Gets the effective paragraph formatting which applies to the
paragraph which contains a specified document position. On return,
aFormat
is filled with values for all paragraph format
attributes.
|
virtual void GetChars(TPtrC& aView,TCharFormat& aFormat,TInt aStartPos)const=0;
Gets a constant pointer descriptor to a portion of the text object with constant character formatting. The view starts at the document position specified, and ends at:
the last character which shares the same character formatting (rich text only), or
the end of the document, or
the end of the segment, if segmented storage is being used
whichever occurs first.
Also fills a character format object with the character formatting of the range of characters.
|
virtual CPicture* PictureHandleL(TInt aPos,TForcePictureLoad aForceLoad=EForceLoadTrue)const=0;
Gets a pointer to the picture located at a specified document position,
if one exists. If the picture is not in memory, the function loads it (if the
second argument has a value of EForceLoadTrue
).
Note
The global text implementation of this function always returns NULL because global text does not support pictures.
|
|
TInt GetPictureSizeInTwips(TSize& aSize, TInt aPos)const=0;
Gets the size of a picture located at a specified document position.
Note
The global text implementation of this function always
returnsKErrNotFound
because global text does not support
pictures.
|
|
virtual TBool EnquirePageBreak(TInt aPos,TInt aLength=0)const=0;
Tests whether a page break occurs within a range of characters. A page
table should have been set up first:
seeCPlainText::SetPageTable()
.
|
|
virtual TBool SelectParagraphLabel(TInt aPos)=0;
This function should be implemented by text objects which support
paragraph labels. Each paragraph may have at most one label. By default, the
functions provided by MLayDoc
apply to the main body of text. This
function is provided to change this so that the MLayDoc
object is
an individual paragraph label, (each of which is treated as a separate
document). Paragraph labelling has not been implemented by global or rich
text.
This function should select the paragraph label associated with the
paragraph containing document position aPos
(aPos
is
a document position in the main document).
|
|
virtual void CancelSelectLabel()=0;
Cancels a paragraph label selection made by a call
toSelectParagraphLabel()
so that the main document reverts back to
the main body of text.
TForcePictureLoad
Used as a parameter to the PictureHandleL()
function to
control whether picture data should be loaded into memory or not.
|