32
|
1 |
/*
|
|
2 |
* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef INLINETEXT_H_
|
|
20 |
#define INLINETEXT_H_
|
|
21 |
|
|
22 |
#include <e32std.h>
|
|
23 |
#include <tagma.h>
|
|
24 |
|
|
25 |
/**
|
|
26 |
@publishedPartner
|
|
27 |
*/
|
|
28 |
const TUid KInlineTextApiExtensionUid = { 0x101FD03D };
|
|
29 |
|
|
30 |
|
|
31 |
/**
|
|
32 |
Class used to provide custom formatting functionality within Form
|
|
33 |
as an extended interface (via the GetExtendedInterface mechanism
|
|
34 |
supplied in MTmSource). Basically allows inline text insertion,
|
|
35 |
that is, insertion of non-backing store text into the CTmTextLayout
|
|
36 |
formatting data used when drawing to the graphics device.
|
|
37 |
|
|
38 |
Implementors of derived classes need to ensure that, in addition
|
|
39 |
to anything else it does, their overload of GetExtendedInterface
|
|
40 |
reacts to being prompted with the UID KInlineTextApiExtensionUid
|
|
41 |
by returning their class cast as an MTmInlineTextSource. It should
|
|
42 |
also invoke GetExtendedInterface on its other parent for any
|
|
43 |
unrecognised UIDs.
|
|
44 |
|
|
45 |
@publishedPartner
|
|
46 |
@released
|
|
47 |
@see MTmSource::GetExtendedInterface
|
|
48 |
@see MFormCustomInterfaceProvider
|
|
49 |
*/
|
|
50 |
class MTmInlineTextSource
|
|
51 |
{
|
|
52 |
public:
|
|
53 |
/**
|
|
54 |
Reports the next position into which inline text should be inserted
|
|
55 |
@param aFrom
|
|
56 |
The document position and character edge to start from.
|
|
57 |
@param aMaxLength
|
|
58 |
The maximum length within which to report inline text.
|
|
59 |
It means that inline text at position X should be reported if
|
|
60 |
aFrom <= X && X < aFrom + aMaxLength.
|
|
61 |
Also report trailing inline text at position aFrom + aMaxLength
|
|
62 |
because it is really attached to the preceding character.
|
|
63 |
Always report only the first inline text position >= aFrom.
|
|
64 |
@param aNext
|
|
65 |
On exit the position of the next bit of inline text to be inserted.
|
|
66 |
N.B. The position of trailing text following position N and the
|
|
67 |
position of leading text preceding position N+1 are both
|
|
68 |
considered to be N+1 - and the trailing text comes first so if
|
|
69 |
aFrom specifies a leading edge do not report trailing edge
|
|
70 |
inline text unless its position is greater than aFrom.
|
|
71 |
A panic EBadReturnValue will result otherwise.
|
|
72 |
@return
|
|
73 |
KErrNone if a position is found within the specified range,
|
|
74 |
KErrNotFound otherwise.
|
|
75 |
@post
|
|
76 |
if KErrNone returned then aFrom <= aNext
|
|
77 |
&& GetInlineText(aNext).Length() != 0
|
|
78 |
&& (GetInlineText(X).Length() == 0 for all
|
|
79 |
TTmDocPos X such that aFrom < X && X < aNext)
|
|
80 |
else if KErrNotFound returned
|
|
81 |
GetInlineText(X).Length() == 0 for all
|
|
82 |
TTmDocPos X such that aFrom <= X && X < aFrom + aMaxLength
|
|
83 |
*/
|
|
84 |
virtual TInt GetNextInlineTextPosition(const TTmDocPos& aFrom, TInt aMaxLength, TTmDocPos& aNext) = 0;
|
|
85 |
|
|
86 |
/**
|
|
87 |
Gets a view of the text to be inserted at aAt.
|
|
88 |
@param aAt
|
|
89 |
Document position, including character edge, being queried.
|
|
90 |
@return
|
|
91 |
Any inline text that should be attached to the specified character edge at aAt.
|
|
92 |
*/
|
|
93 |
virtual TPtrC GetInlineText(const TTmDocPos& aAt) = 0;
|
|
94 |
};
|
|
95 |
|
|
96 |
#endif // INLINETEXT_H_
|
|
97 |
|