MTmInlineTextSource Class Reference

class MTmInlineTextSource

Class used to provide custom formatting functionality within Form as an extended interface (via the GetExtendedInterface mechanism supplied in MTmSource ). Basically allows inline text insertion, that is, insertion of non-backing store text into the CTmTextLayout formatting data used when drawing to the graphics device.

Implementors of derived classes need to ensure that, in addition to anything else it does, their overload of GetExtendedInterface reacts to being prompted with the UID KInlineTextApiExtensionUid by returning their class cast as an MTmInlineTextSource . It should also invoke GetExtendedInterface on its other parent for any unrecognised UIDs.

MTmSource::GetExtendedInterface MFormCustomInterfaceProvider

Member Functions Documentation

GetInlineText(const TTmDocPos &)

TPtrC GetInlineText ( const TTmDocPos & aAt ) [pure virtual]

Gets a view of the text to be inserted at aAt.

Parameters

const TTmDocPos & aAt Document position, including character edge, being queried.

GetNextInlineTextPosition(const TTmDocPos &, TInt, TTmDocPos &)

TInt GetNextInlineTextPosition ( const TTmDocPos & aFrom,
TInt aMaxLength,
TTmDocPos & aNext
) [pure virtual]
Reports the next position into which inline text should be inserted
Post-condition
if KErrNone returned then aFrom <= aNext && GetInlineText(aNext).Length() != 0 && (GetInlineText(X).Length() == 0 for all TTmDocPos X such that aFrom < X && X < aNext) else if KErrNotFound returned GetInlineText(X).Length() == 0 for all TTmDocPos X such that aFrom <= X && X < aFrom + aMaxLength

Parameters

const TTmDocPos & aFrom The document position and character edge to start from.
TInt aMaxLength The maximum length within which to report inline text. It means that inline text at position X should be reported if aFrom <= X && X < aFrom + aMaxLength. Also report trailing inline text at position aFrom + aMaxLength because it is really attached to the preceding character. Always report only the first inline text position >= aFrom.
TTmDocPos & aNext On exit the position of the next bit of inline text to be inserted. N.B. The position of trailing text following position N and the position of leading text preceding position N+1 are both considered to be N+1 - and the trailing text comes first so if aFrom specifies a leading edge do not report trailing edge inline text unless its position is greater than aFrom. A panic EBadReturnValue will result otherwise.