|
1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // FORM Cursor Navigation header file holding policy interface class. |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef __FRMCURS_H__ |
|
19 #define __FRMCURS_H__ |
|
20 |
|
21 |
|
22 #include <frmconst.h> |
|
23 |
|
24 |
|
25 class CTmViewAnchoredLayout; |
|
26 class TTmDocPos; |
|
27 |
|
28 /** |
|
29 This policy interface class maintains the cursor position and sets the |
|
30 policy for its movement. |
|
31 @publishedPartner |
|
32 @deprecated |
|
33 */ |
|
34 class MCursorPositioningPolicy |
|
35 |
|
36 { |
|
37 public: |
|
38 |
|
39 //-- Interface enumerations --------------------------------------------- |
|
40 |
|
41 |
|
42 /** Types of delete operation. This is used when...??? |
|
43 */ |
|
44 enum TDeleteType |
|
45 { |
|
46 EDeleteUndefined = 0, |
|
47 EDeleteBackspace = 1, |
|
48 EDeleteForward = 2, |
|
49 |
|
50 EDeleteLast |
|
51 }; |
|
52 |
|
53 /** Types of reformatting. This is used when...??? |
|
54 */ |
|
55 enum TTextChangeType |
|
56 { |
|
57 ETextChangeUndefined = 0, |
|
58 /** Change that causes no change in cursor position. */ |
|
59 ETextChangeNonLocal = 1, |
|
60 /** Change that moves the cursor to its trailing edge. */ |
|
61 ETextChangeTyping = 2, |
|
62 |
|
63 // Maybe several more. |
|
64 // ... |
|
65 ETExtChangeLast |
|
66 }; |
|
67 |
|
68 /** |
|
69 Hint for positioning the visual cursor. Describes properties of the |
|
70 editing operation that is most likely to happen next. |
|
71 */ |
|
72 enum TPosHint |
|
73 { |
|
74 EPosHintUndefined = 0, |
|
75 /** Left to right typing expected. */ |
|
76 EInsertStrongL2R = 1, |
|
77 /** Right to left typing expected. */ |
|
78 EInsertStrongR2L = 2, |
|
79 |
|
80 // Maybe several more. |
|
81 //... |
|
82 EPosHintLast |
|
83 }; |
|
84 |
|
85 public: |
|
86 |
|
87 //-- Object creation/setup API ------------------------------------------ |
|
88 |
|
89 /** |
|
90 */ |
|
91 virtual ~MCursorPositioningPolicy() {} |
|
92 |
|
93 /** |
|
94 Sets the document/layout object on which all the cursor navigation will |
|
95 take place. |
|
96 */ |
|
97 virtual void SetTmLayout(CTmViewAnchoredLayout* aLayout) = 0; |
|
98 |
|
99 |
|
100 //-- Cursor positioning API --------------------------------------------- |
|
101 |
|
102 /** |
|
103 Gets the cursor position for display and insertion. |
|
104 @return TTmDocPos value holding cursor document position. |
|
105 */ |
|
106 virtual const TTmDocPos& Pos() const = 0; |
|
107 |
|
108 /** |
|
109 Sets the cursor position explicitly. |
|
110 @param aNewPos New position cursor is to be moved to. |
|
111 */ |
|
112 virtual void SetPos(const TTmDocPos& aNewPos) = 0; |
|
113 |
|
114 |
|
115 /** |
|
116 @return ETrue if successful, EFalse otherwise e.g. no formatting |
|
117 */ |
|
118 virtual void PosXyL(TPoint& aXy) const = 0; |
|
119 |
|
120 /** |
|
121 Sets the X, Y co-ordinates to jump to. |
|
122 @param aXy Layout co-ordinates to approx. move the cursor to. |
|
123 On exit |
|
124 @return ETrue if successful, EFalse otherwise e.g. no formatting |
|
125 */ |
|
126 virtual void SetPosByXyL(TPoint& aNewXy) = 0; |
|
127 |
|
128 /** |
|
129 Allows change of cursor position in response to a hint as to |
|
130 positioning. |
|
131 @param aHint Text directional hint from client. |
|
132 */ |
|
133 virtual void SetPositioningHintL(TPosHint aHint) = 0; |
|
134 |
|
135 /** |
|
136 Suggests a new latent X,Y position for Up/Down operations/scrolls. |
|
137 @param aX X Layout co-ordinate for latent position of cursor. |
|
138 */ |
|
139 virtual void SetLatentX(TInt aX) = 0; |
|
140 |
|
141 /** |
|
142 Suggests a new latent X,Y position for Up/Down operations/scrolls. |
|
143 @param aY Y Layout co-ordinate for latent position of cursor. |
|
144 */ |
|
145 virtual void SetLatentY(TInt aY) = 0; |
|
146 |
|
147 /** |
|
148 Suggests a new latent X,Y position for Up/Down operations/scrolls. |
|
149 @param aXy X,Y Layout co-ordinate for latent position of cursor. |
|
150 */ |
|
151 virtual const TPoint& LatentXy() const = 0; |
|
152 |
|
153 /** |
|
154 Suggests a new latent X,Y position for Up/Down operations/scrolls. |
|
155 @param aXy X,Y Layout co-ordinate for latent position of cursor. |
|
156 */ |
|
157 virtual void SetLatentXy(const TPoint& aXy) = 0; |
|
158 |
|
159 /** |
|
160 @leave |
|
161 */ |
|
162 virtual const TPoint& UpdateLatentXyL() = 0; |
|
163 |
|
164 |
|
165 //--- Cursor navigation API --------------------------------------------- |
|
166 |
|
167 |
|
168 /** |
|
169 Moves the cursor up or down a line. |
|
170 @param aUp ETrue if wish to move up, EFalse to go down. |
|
171 @return TCursorMove Actual movement that took place. |
|
172 */ |
|
173 virtual TCursorMove UpDownL(TBool aUp) = 0; |
|
174 |
|
175 /** |
|
176 Moves the cursor left or right a character position. |
|
177 @param aDown ETrue if wish to move left, EFalse to go right. |
|
178 @return TCursorMove Actual movement that took place. |
|
179 */ |
|
180 virtual TCursorMove LeftRightL(TBool aLeft) = 0; |
|
181 |
|
182 /** |
|
183 Moves the cursor to the start or to the end of the line. |
|
184 @param aStart ETrue if wish to move to the start, EFalse to go to the end. |
|
185 @return TCursorMove Actual movement that took place. |
|
186 */ |
|
187 virtual TCursorMove LineStartEndL(TBool aStart) = 0; |
|
188 |
|
189 |
|
190 //--- Cursor reactionary API to changes --------------------------------- |
|
191 |
|
192 |
|
193 /** |
|
194 Responds to total change of formatting. |
|
195 */ |
|
196 virtual void HandleGlobalReformatL() = 0; |
|
197 |
|
198 /** |
|
199 Responds to partial change of formatting. |
|
200 @param aStart ? |
|
201 @param aOldEnd ? |
|
202 @param aNewEnd ? |
|
203 @param aParaFormatChg ? |
|
204 @param aChgType ? |
|
205 */ |
|
206 virtual void HandleReformatL(TInt aStart, TInt aOldEnd, |
|
207 TInt aNewEnd, TBool aParaFormatChg, TTextChangeType aChgType) = 0; |
|
208 |
|
209 |
|
210 //-- Misc/Unknown API --------------------------------------------------- |
|
211 |
|
212 |
|
213 /** |
|
214 Gets the cursor position for delete. ??? |
|
215 @param aDelType ? |
|
216 @param aStart ? |
|
217 @param aEnd ? |
|
218 */ |
|
219 virtual void GetDeletePosition(TDeleteType aDelType, TInt& aStart, |
|
220 TInt& aEnd) const = 0; |
|
221 |
|
222 /** |
|
223 Place holder for future expansion when if more virtual methods |
|
224 are requried. |
|
225 */ |
|
226 virtual void* ExtendedInterface(TUid aInterfaceId) = 0; |
|
227 |
|
228 }; |
|
229 |
|
230 |
|
231 #endif // __FRMCURS_H__ |