author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 15 Sep 2010 12:29:17 +0300 | |
branch | RCL_3 |
changeset 64 | 85902f042028 |
parent 59 | 978afdc0236f |
child 72 | a5e7a4f63858 |
permissions | -rw-r--r-- |
56 | 1 |
/* |
2 |
* Copyright (c) 1997-1999 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 |
#if !defined(__EIKEDWIN_H__) |
|
20 |
#define __EIKEDWIN_H__ |
|
21 |
||
22 |
#include <s32std.h> |
|
23 |
#include <gdi.h> |
|
24 |
#include <txtetext.h> |
|
25 |
#include <medobsrv.h> |
|
26 |
#include <gulutil.h> |
|
27 |
#include <fepbase.h> |
|
28 |
#include <frmvis.h> |
|
29 |
#include <frmtview.h> |
|
30 |
#include <uikon.hrh> |
|
31 |
#include <eikon.hrh> |
|
32 |
#include <eikbctrl.h> |
|
33 |
#include <eikedwob.h> |
|
34 |
#include <eiksbfrm.h> |
|
35 |
#include <eikccpu.h> |
|
36 |
#include <eiklay.h> |
|
37 |
#include <lafmain.h> |
|
38 |
#include <AknPictographDrawerInterface.h> |
|
39 |
#include <babitflags.h> |
|
40 |
#include <centralrepository.h> // class CCenRepNotifyHandler; |
|
41 |
#include <cenrepnotifyhandler.h> // class CRepository; |
|
42 |
||
43 |
class CGlobalText; |
|
44 |
class CParaFormatLayer; |
|
45 |
class CCharFormatLayer; |
|
46 |
class MLayDoc; |
|
47 |
class CEikEdwinFepSupport; |
|
48 |
class CLafEdwinCustomDrawBase; |
|
49 |
class CClipboard; |
|
50 |
class CAknEdwinFormAccessor; |
|
51 |
class CAknEdwinState; |
|
52 |
class CAknInputPolicyManager; |
|
53 |
class CFormCursorModifier; |
|
54 |
class CTextView; |
|
55 |
class MAknsControlContext; |
|
56 |
class CAknEdwinDrawingModifier; |
|
57 |
class CAknEdwinFormExtendedInterfaceProvider; |
|
58 |
class CAknPhoneNumberInlineTextSource; |
|
59 |
class CAknNoMatchesIndicatorInlineTextSource; |
|
60 |
class CAknInlineTextSource; |
|
61 |
class CAknPictographInterface; |
|
62 |
class CAknExtendedInputCapabilities; |
|
63 |
class CAknPointerEventSuppressor; |
|
64 |
class CSmileyManager; |
|
65 |
class CSmileyCustomWrap; |
|
66 |
class CAknEdwinPhysicsHandler; |
|
67 |
class CEdwinAsyncFormat; |
|
68 |
class MAknsSkinInstance; |
|
69 |
||
70 |
// Forward declaration of now removed (Series 60 2.0) custom drawer class for CEikEdwin |
|
71 |
class CEikAvkonCustomDraw; |
|
72 |
||
73 |
// Forward declaration of now removed (Series 60 2.0) custom drawer class for CEikEdwin |
|
74 |
class CEikAvkonCustomDraw; |
|
75 |
||
76 |
// For construction of Rich Text - based custom formatters |
|
77 |
class CRichText; |
|
78 |
class CAknPhysics; |
|
79 |
||
80 |
enum TReplaceOption |
|
81 |
{ |
|
82 |
ENoReplace, |
|
83 |
EReplaceOnce, |
|
84 |
EReplaceAll, |
|
85 |
EReplaceSkip |
|
86 |
}; |
|
87 |
||
88 |
/** |
|
89 |
* This describes the features of a |
|
90 |
* search-and-replace operation on a CEikEdwin. |
|
91 |
* |
|
92 |
* See CEikEdwin::ReplaceL(). |
|
93 |
*/ |
|
94 |
struct SEdwinFindModel |
|
95 |
{ |
|
96 |
/** Flags for the search (see CEikEdwin::TFindFlags) */ |
|
97 |
TInt iFlags; // TEdwinFindFlags |
|
98 |
/** Text to search for. */ |
|
99 |
TBuf<EEikEdwinFindStringMaxLen> iText; |
|
100 |
/** Text to replace it with. */ |
|
101 |
TBuf<EEikEdwinFindStringMaxLen> iReplaceText; |
|
102 |
/** Replace options. */ |
|
103 |
TReplaceOption iReplaceOption; |
|
104 |
}; |
|
105 |
||
106 |
/** |
|
107 |
* Styles for highlighting. See SetHighlightStyleL(). |
|
108 |
*/ |
|
109 |
enum TAknsHighlightStyle |
|
110 |
{ |
|
111 |
/** Normal highlighting. */ |
|
112 |
EEikEdwinHighlightNormal = 0, |
|
113 |
/** Link highlighting. */ |
|
114 |
EEikEdwinHighlightLink |
|
115 |
}; |
|
116 |
||
117 |
// inline utility to handle RGB values (set / unset) |
|
118 |
||
119 |
class SAknRgb |
|
120 |
{ |
|
121 |
// data (private) |
|
122 |
TRgb iValue; |
|
123 |
TBool iIsSet; |
|
124 |
public: // utilities |
|
125 |
SAknRgb():iIsSet(EFalse){} |
|
126 |
TRgb Value(){return iValue;} |
|
127 |
SAknRgb& operator=(TRgb aRgb) |
|
128 |
{ |
|
129 |
iValue = aRgb; |
|
130 |
iIsSet = ETrue; |
|
131 |
return *this; |
|
132 |
} |
|
133 |
TBool IsSet(){return iIsSet;} |
|
134 |
}; |
|
135 |
||
136 |
/** |
|
137 |
* Base class for controls that display and allow manipulation of text. |
|
138 |
* |
|
139 |
* The properties of a particular Edwin object can be set using bitwise flags, |
|
140 |
* which are defined in member enums (see @c TFlags for example). |
|
141 |
* |
|
142 |
* Edwins support Front End Processors, and so are a highly effective way of |
|
143 |
* getting textual data from the user. The text currently being composed by the |
|
144 |
* user is called the composition text. |
|
145 |
*/ |
|
146 |
class CEikEdwin : public CEikBorderedControl, |
|
147 |
public MEikScrollBarObserver, |
|
148 |
public CTextView::MObserver, |
|
149 |
public MEditObserver, |
|
150 |
public MEikCcpuEditor |
|
151 |
{ |
|
152 |
||
153 |
private: |
|
154 |
||
155 |
class CUndoBuffer; |
|
156 |
NONSHARABLE_CLASS(CEikEdwinExtension) : public CBase, MCenRepNotifyHandlerCallback |
|
157 |
{ |
|
158 |
public: |
|
159 |
/** |
|
160 |
* Allocates and constructs a CEikEdwinExtension. |
|
161 |
* |
|
162 |
* @param aEdwin Pointer to the CEikEdwin creating the extension. |
|
163 |
* @return A newly constructed edwin extension. |
|
164 |
*/ |
|
165 |
static CEikEdwinExtension* NewL(CEikEdwin* aEdwin); |
|
166 |
||
167 |
/** |
|
168 |
* Destructor. |
|
169 |
*/ |
|
170 |
~CEikEdwinExtension(); |
|
171 |
||
172 |
/** |
|
173 |
* Gets the form accessor. |
|
174 |
* |
|
175 |
* @return The form accessor. |
|
176 |
*/ |
|
177 |
IMPORT_C CAknEdwinFormAccessor* FormAccessor() const; |
|
178 |
||
179 |
/** |
|
180 |
* Sets the form accessor. |
|
181 |
* |
|
182 |
* @param aFormAccessor The form accessor. |
|
183 |
*/ |
|
184 |
IMPORT_C void SetFormAccessor(CAknEdwinFormAccessor* aFormAccessor); |
|
185 |
||
186 |
/** |
|
187 |
* Sets the CIdle object to update scroll bar. |
|
188 |
* |
|
189 |
* @param The CIdle object to perform scroll bar updating. |
|
190 |
*/ |
|
191 |
IMPORT_C void SetScrollBarSetter(CIdle* aScrollBarSetter); |
|
192 |
||
193 |
/** |
|
194 |
* Gets the CIdle object which updates scroll bar. |
|
195 |
* |
|
196 |
* @return The CIdle object used to perform scroll bar updating. |
|
197 |
*/ |
|
198 |
IMPORT_C CIdle* ScrollBarSetter(); |
|
199 |
||
200 |
/** |
|
201 |
* Gets the custom wrapper. |
|
202 |
* |
|
203 |
* @return The custom wrapper. |
|
204 |
*/ |
|
205 |
IMPORT_C const TAvkonEditorCustomWrap& TextWrapper(); |
|
206 |
||
207 |
// the following two methods are deprecated |
|
208 |
IMPORT_C CFormCursorModifier* FormCursorModifier() const; |
|
209 |
||
210 |
/** |
|
211 |
* Store a locally stored (but externally set) Skins background control context. |
|
212 |
* |
|
213 |
* @param aBackgroundControlContext Control context to store. Not owned. Can be NULL. |
|
214 |
*/ |
|
215 |
void SetSkinBackgroundControlContext( MAknsControlContext* aBackgroundControlContext ); |
|
216 |
||
217 |
/** |
|
218 |
* Access to locally stored Skins background control context. |
|
219 |
* |
|
220 |
* @return Pointer to locally stored control context |
|
221 |
*/ |
|
222 |
||
223 |
MAknsControlContext* SkinBackgroundControlContext() const; |
|
224 |
||
225 |
/** |
|
226 |
* This returns a flag that records whether the background context has ever been |
|
227 |
* set by API. |
|
228 |
* |
|
229 |
* @return EFalse iff control context has never been set. |
|
230 |
*/ |
|
231 |
TBool SkinBackgroundControlContextHasBeenSet() const; |
|
232 |
||
233 |
/** |
|
234 |
* Stores the alignment value. |
|
235 |
* |
|
236 |
* @param aAlignment Editor alignment to be stored. |
|
237 |
*/ |
|
238 |
void SetAlignment(TInt aAlignment); |
|
239 |
||
240 |
/** |
|
241 |
* Returns the stored alignment value. |
|
242 |
* |
|
243 |
* @return Value of the current editor alignment. |
|
244 |
*/ |
|
245 |
TInt CurrentAlignment() const; |
|
246 |
||
247 |
/** |
|
248 |
* Sets pictograph animation callback. |
|
249 |
*/ |
|
250 |
void SetPictoCallBack( TCallBack& aCallBack ); |
|
251 |
||
252 |
/** |
|
253 |
* Sets pictograph animation callback. |
|
254 |
*/ |
|
255 |
const TCallBack& PictoCallBack() const; |
|
256 |
||
257 |
/** |
|
258 |
* Creates the CAknFormExtendedInterfaceProvider object if it does not exist. |
|
259 |
*/ |
|
260 |
void CreateFormExtendedInterfaceProviderIfNeededL(); |
|
261 |
||
262 |
/** |
|
263 |
* Access to Form's extended interface provider. |
|
264 |
*/ |
|
265 |
CAknEdwinFormExtendedInterfaceProvider* FormExtendedInferfaceProvider() const; |
|
266 |
||
267 |
/** |
|
268 |
* Create a custom formatter for pure phone number content. |
|
269 |
* |
|
270 |
* Calls CreateFormExtendedInterfaceProviderIfNeededL to ensure that there is an |
|
271 |
* ExtendedInterfaceProvider object built. |
|
272 |
* |
|
273 |
* @param aTextLayout Reference to the CTextLayout object used for this editor. |
|
274 |
* aText CPlainText object reference for the text used in the editor. |
|
275 |
*/ |
|
276 |
void CreatePurePhoneNumberFormatterL( CTextLayout& aTextLayout, const CPlainText& aText); |
|
277 |
||
278 |
/** |
|
279 |
* Create a custom formatter for pure phone number content. |
|
280 |
* |
|
281 |
* Calls CreateFormExtendedInterfaceProviderIfNeededL to ensure that there is an |
|
282 |
* ExtendedInterfaceProvider object built. |
|
283 |
* |
|
284 |
* @param aTextLayout Reference to the CTextLayout object used for this editor |
|
285 |
*/ |
|
286 |
void CreateNoMatchesIndicatorFormatterL( CTextLayout& aTextLayout ); |
|
287 |
||
288 |
/** |
|
289 |
* Create a custom formatter for rich text editor with general content. Phone numbers are |
|
290 |
* recognized using an internal parser and formatted with the number grouping engine |
|
291 |
* |
|
292 |
* Calls CreateFormExtendedInterfaceProviderIfNeededL to ensure that there is an |
|
293 |
* ExtendedInterfaceProvider object built. |
|
294 |
* |
|
295 |
* @param aTextLayout Reference to the CTextLayout object used for this editor |
|
296 |
*/ |
|
297 |
void CreateRichTextPhoneNumberFormatterL( CTextLayout& aTextLayout, const CRichText& aText ); |
|
298 |
||
299 |
/** |
|
300 |
* This allows the caller to access the single inline text interface that will be seen |
|
301 |
* by Tagma. All installed inline text source classes are held behind this single interface |
|
302 |
* |
|
303 |
* @return pointer to the inline text source object that will be provided to Tagma |
|
304 |
* Null is returned if none is installed. |
|
305 |
*/ |
|
306 |
CAknInlineTextSource* InlineTextSource() const; |
|
307 |
||
308 |
/** |
|
309 |
* Returns pointer to pictograph interface. |
|
310 |
* |
|
311 |
* @return Pointer to pictograph interface. The value can be NULL if pictographs are not supported. |
|
312 |
*/ |
|
313 |
CAknPictographInterface* PictographInterface() const; |
|
314 |
||
315 |
/** |
|
316 |
* Used for suppressing all editor's background drawing. |
|
317 |
*/ |
|
318 |
void SetSuppressBackgroundDrawing( TBool aSuppress ); |
|
319 |
||
320 |
/** |
|
321 |
* Tests if the background drawing is suppressed. |
|
322 |
*/ |
|
323 |
TBool IsBackgroundDrawingSuppressed() const; |
|
324 |
||
325 |
/** |
|
326 |
* Returns the value of ClearDirection |
|
327 |
* |
|
328 |
* @return value of current ClearDirection |
|
329 |
*/ |
|
330 |
TInt ClearDirection() const; |
|
331 |
||
332 |
/** |
|
333 |
* Enables kinetic scrolling. |
|
334 |
*/ |
|
335 |
void EnableKineticScrollingL( CAknPhysics* aPhysics = NULL ); |
|
336 |
||
337 |
/** |
|
338 |
* Enables physics. |
|
339 |
*/ |
|
340 |
void EnablePhysicsL( CAknPhysics* aPhysics = NULL ); |
|
341 |
||
342 |
/** |
|
343 |
* Initializes physics. |
|
344 |
*/ |
|
345 |
void InitPhysicsL(); |
|
346 |
||
347 |
public: // from MCenRepNotifyHandlerCallback |
|
348 |
void HandleNotifyInt(TUint32 aId, TInt aNewValue); |
|
349 |
||
350 |
private: |
|
351 |
||
352 |
CEikEdwinExtension(); |
|
353 |
void ConstructL(CEikEdwin* aEdwin); |
|
354 |
||
355 |
private: |
|
356 |
||
357 |
enum TFlagIndices |
|
358 |
{ |
|
359 |
ESkinBackgroundControlContextHasBeenSetIndex = 0, |
|
360 |
ESuppressBackgroundDrawing, |
|
361 |
EKineticScrollingEnabled |
|
362 |
}; |
|
363 |
class TAknEdwinPictographDrawer : public MAknPictographAnimatorCallBack |
|
364 |
{ |
|
365 |
private: // From MAknPictographAnimatorCallBack |
|
366 |
void DrawPictographArea(); |
|
367 |
}; |
|
368 |
||
369 |
private: |
|
370 |
||
371 |
CIdle* iSetScrollBar; |
|
372 |
TAvkonEditorCustomWrap iTextWrapper; |
|
373 |
CAknEdwinFormAccessor* iFormAccessor; |
|
374 |
CFormCursorModifier* iFormCursorModifier; |
|
375 |
MAknsControlContext* iSkinBackgroundControlContext; |
|
376 |
TBitFlags iFlags; |
|
377 |
TInt iAlignment; |
|
378 |
TCallBack iPictoCallBack; |
|
379 |
CAknEdwinFormExtendedInterfaceProvider* iFormExtendedInterfaceProvider; // Owned |
|
380 |
CAknInlineTextSource* iPhoneNumberFormatter; // Not owned |
|
381 |
CAknNoMatchesIndicatorInlineTextSource* iNoMatchesIndicatorFormatter; // Not owned |
|
382 |
TAknEdwinPictographDrawer iPictographDrawer; |
|
383 |
CAknPictographInterface* iPictographInterface; |
|
384 |
// For clear direction. |
|
385 |
CRepository* iCenRep; // Owned |
|
386 |
CCenRepNotifyHandler* iCenRepNotifyHandler; // Owned |
|
387 |
TInt iClearDirection; // Value of ClearDirection |
|
64
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
388 |
// For listening the status of qwerty key board |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
389 |
CRepository* iCenRepForQwerty; // Owned |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
390 |
CCenRepNotifyHandler* iCenRepNotifyHandlerForQwerty; // Owned |
56 | 391 |
public: |
392 |
||
393 |
TInt iSkinIdForText; |
|
394 |
TAknsHighlightStyle iSkinHighlightStyle; |
|
395 |
SAknRgb iEditorBackgroundColor; |
|
396 |
TInt iUpperFullFormattingLength; |
|
397 |
CAknExtendedInputCapabilities* iExtendedInputCapabilities; |
|
398 |
TRect iTextLinesRect; |
|
399 |
TRect iScrollRect; |
|
400 |
TInt iTempCursorPos; |
|
401 |
TInt iTempAnchorPos; |
|
402 |
TInt iTempSelect; |
|
403 |
CAknPointerEventSuppressor* iPtSuppressor; |
|
404 |
TBool iDragging; |
|
405 |
TInt iRecordCursor; |
|
406 |
TBool iRecordScroll; |
|
407 |
/** |
|
408 |
* @c iDestroyedPtr is used for the object destruction check. |
|
409 |
* If it has non-null value, the destruction check is turned on, and |
|
410 |
* the value points to a local boolean variable that keeps the destroyed state. |
|
411 |
*/ |
|
412 |
TBool* iDestroyedPtr; |
|
413 |
enum TDrawState |
|
414 |
{ |
|
415 |
ENotDraw = 0, |
|
416 |
EDrawn, |
|
417 |
EDrawing |
|
418 |
}; |
|
419 |
TInt iDrawInvoked; |
|
420 |
TInt iThumbPos; |
|
421 |
// own |
|
422 |
CSmileyManager* iSmiley; |
|
423 |
CSmileyCustomWrap* iSmileyWrap; |
|
424 |
TBool iInlineEditing; |
|
425 |
TBool iDisableConvertInFormat; |
|
426 |
TCursorSelection iVisibleRange; |
|
427 |
CEdwinAsyncFormat* iAsyncFormat; |
|
428 |
||
429 |
/** |
|
430 |
* Pointer to CEikEdwin. |
|
431 |
* Not own. |
|
432 |
*/ |
|
433 |
CEikEdwin* iEdwin; |
|
434 |
||
435 |
/** |
|
436 |
* Scrolled offset if using rate scroll way. |
|
437 |
*/ |
|
438 |
TInt iScrolledDelta; |
|
439 |
||
440 |
/** |
|
441 |
* If ETrue, uses rate scroll. Otherwise uses original way. |
|
442 |
*/ |
|
443 |
TBool iUseRateScroll; |
|
444 |
||
445 |
/** |
|
446 |
* Used with each step of dragging scrollbar to record |
|
447 |
* the thumb position before dragging action |
|
448 |
*/ |
|
449 |
TInt iScrollbarPosition; |
|
450 |
||
451 |
/** |
|
452 |
* Physics handler. Used only when physics feature is enabled. |
|
453 |
* Own. |
|
454 |
*/ |
|
455 |
CAknEdwinPhysicsHandler* iPhysicsHandler; |
|
456 |
||
457 |
/** |
|
458 |
* Content has moved down so that empty space |
|
459 |
* above the editor content is visible. |
|
460 |
*/ |
|
461 |
TBool iStartBorderExceeded; |
|
462 |
||
463 |
/** |
|
464 |
* Content has moved up so that empty space |
|
465 |
* below the editor content is visible. |
|
466 |
*/ |
|
467 |
TBool iEndBorderExceeded; |
|
468 |
||
469 |
/** |
|
470 |
* Amount of pixels out of border. In practice width |
|
471 |
* of empty space above or below editor content. |
|
472 |
*/ |
|
473 |
TInt iPixelsOutOfBorder; |
|
474 |
||
475 |
/** |
|
476 |
* If ETrue, text cursor was visible before drag or flick started. |
|
477 |
* Used to store cursor state so that it is possible to enable cursor |
|
478 |
* again when dragging, flicking or bounce stops. |
|
479 |
*/ |
|
480 |
TBool iCursorWasVisible; |
|
481 |
||
482 |
/** |
|
483 |
* If ETrue, ongoing scrolling is caused by moving scrollbar thumb. |
|
484 |
*/ |
|
485 |
TBool iScrolledByScrollBar; |
|
486 |
/** |
|
487 |
* Record formatted height of layout |
|
488 |
*/ |
|
489 |
TInt iRecordFormattedHeight; |
|
490 |
||
491 |
/** |
|
492 |
* Skins instance. |
|
493 |
* Not own. |
|
494 |
*/ |
|
495 |
MAknsSkinInstance* iSkinInstance; |
|
496 |
||
497 |
/** |
|
498 |
* Record enableSmiley is supported. |
|
499 |
*/ |
|
500 |
TBool iEnableSmileySupported; |
|
501 |
||
502 |
/** |
|
503 |
* Record if text view has been actually hidden. |
|
504 |
*/ |
|
505 |
TBool iTextViewHidden; |
|
59
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
506 |
/** |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
507 |
* Record the buff of "Tap To write" in current language. |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
508 |
* |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
509 |
* Own. |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
510 |
*/ |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
511 |
HBufC* iT2WBuf; |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
512 |
enum TT2WFlag |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
513 |
{ |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
514 |
ESplitInputEnabled = 0x00000001, |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
515 |
EFocusOn = 0x00000002, |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
516 |
ERecordCursor = 0x00000004, |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
517 |
ECursorVisible = 0x00000008 |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
518 |
}; |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
519 |
/** |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
520 |
* Record internal status of of "tap to write". |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
521 |
*/ |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
522 |
TInt iT2WState; |
64
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
523 |
|
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
524 |
/** |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
525 |
* Used to record if qwerty key board is opened. |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
526 |
* |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
527 |
*/ |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
59
diff
changeset
|
528 |
TInt iQwertyStatus; |
56 | 529 |
}; |
530 |
||
531 |
public: |
|
532 |
||
533 |
/** |
|
534 |
* The following flags may be combined with a bitwise OR to form the |
|
535 |
* @c aEdwinFlags argument to @c ConstructL(TInt, ...) or the flags field |
|
536 |
* of an EDWIN resource structure run through @c ConstructFromResourceL(). |
|
537 |
* |
|
538 |
* These flags are duplicated in @c uikon.hrh (see @c EEikEdwinKeepDocument |
|
539 |
* etc.) |
|
540 |
*/ |
|
541 |
enum TFlags |
|
542 |
{ // user flags |
|
543 |
/** */ |
|
544 |
EZeroEnumValue =0x00000000, |
|
545 |
||
546 |
/** |
|
547 |
* If set, @c CEikEdwin does not destroy its content on destruction. |
|
548 |
*/ |
|
549 |
EKeepDocument =0x00000001, |
|
550 |
||
551 |
/** |
|
552 |
* If set, the content buffer uses segmented storage (see |
|
553 |
* @c CEditableText::ESegmentedStorage). |
|
554 |
*/ |
|
555 |
ESegmentedStorage =0x00000002, |
|
556 |
||
557 |
/** |
|
558 |
* The size specified in the resource used to construct the object is |
|
559 |
* given in pixels, not character widths. |
|
560 |
*/ |
|
561 |
EWidthInPixels =0x00000004, |
|
562 |
||
563 |
/** |
|
564 |
* No automatic selection takes place. Normally the entire text is |
|
565 |
* selected whenever the Edwin is created, resized or has its text |
|
566 |
* set as one operation. |
|
567 |
*/ |
|
568 |
ENoAutoSelection =0x00000008, |
|
569 |
||
570 |
/** |
|
571 |
* If set, then whenever the control is activated the cursor is |
|
572 |
* moved to the end of the text. |
|
573 |
*/ |
|
574 |
EJustAutoCurEnd =0x00000010, |
|
575 |
||
576 |
/** |
|
577 |
* Does not wrap the text being edited. |
|
578 |
*/ |
|
579 |
ENoWrap =0x00000020, |
|
580 |
||
581 |
/** |
|
582 |
* Uses a line cursor instead of a block cursor. |
|
583 |
*/ |
|
584 |
ELineCursor =0x00000040, |
|
585 |
||
586 |
/** |
|
587 |
* Does not perform horizontal scrolling. |
|
588 |
*/ |
|
589 |
ENoHorizScrolling =0x00000080, |
|
590 |
||
591 |
/** |
|
592 |
* If set, scroll bars required to edit long documents appear inside |
|
593 |
* the Edwin. This reduces the area used to display the Edwin. |
|
594 |
* |
|
595 |
* If not set, scroll bars appear outside the Edwin. |
|
596 |
*/ |
|
597 |
EInclusiveSizeFixed =0x00000100, |
|
598 |
||
599 |
/** |
|
600 |
* Sets the Edwin’s height according to the number of lines of text |
|
601 |
* supplied by the user. |
|
602 |
*/ |
|
603 |
EUserSuppliedText =0x00000200, |
|
604 |
||
605 |
/** |
|
606 |
* The Edwin is a window-owning control. |
|
607 |
*/ |
|
608 |
EOwnsWindow =0x00000400, |
|
609 |
||
610 |
/** |
|
611 |
* The Edwin does not respond to input at all. |
|
612 |
*/ |
|
613 |
EDisplayOnly =0x00000800, |
|
614 |
||
615 |
/** |
|
616 |
* Does not hide the selection if the Edwin loses focus. |
|
617 |
*/ |
|
618 |
EAlwaysShowSelection =0x00001000, |
|
619 |
||
620 |
/** |
|
621 |
* The Edwin is read-only so users cannot add text to any document it |
|
622 |
* displays. |
|
623 |
*/ |
|
624 |
EReadOnly =0x00002000, |
|
625 |
||
626 |
/** |
|
627 |
* If set, no special attempt will be made to delete the embedded pictures cleanly. |
|
628 |
* |
|
629 |
* This flag does not apply to Edwins which do not edit rich text. |
|
630 |
*/ |
|
631 |
EAllowPictures =0x00004000, |
|
632 |
||
633 |
/** |
|
634 |
* The Edwin supports undo operations. |
|
635 |
*/ |
|
636 |
EAllowUndo =0x00008000, |
|
637 |
||
638 |
/** |
|
639 |
* Does not allow line or paragraph breaks in the text being edited. |
|
640 |
*/ |
|
641 |
ENoLineOrParaBreaks =0x00010000, |
|
642 |
||
643 |
/** |
|
644 |
* Allows only ASCII characters. |
|
645 |
*/ |
|
646 |
EOnlyASCIIChars =0x00020000, |
|
647 |
||
648 |
/** |
|
649 |
* The Edwin is resizable. |
|
650 |
*/ |
|
651 |
EResizable =0x00040000, |
|
652 |
||
653 |
/** |
|
654 |
* The Edwin ignores the virtual cursor. |
|
655 |
*/ |
|
656 |
EIgnoreVirtualCursor =0x00080000, |
|
657 |
||
658 |
/** |
|
659 |
* No custom draw is done. |
|
660 |
*/ |
|
661 |
ENoCustomDraw =0x01000000, |
|
662 |
||
663 |
/** |
|
664 |
* Changes layout to Avkon style. |
|
665 |
*/ |
|
666 |
EAvkonEditor =0x02000000, |
|
667 |
||
668 |
/** |
|
669 |
* Hides cursor. |
|
670 |
*/ |
|
671 |
EAvkonDisableCursor =0x04000000, |
|
672 |
||
673 |
/** |
|
674 |
* Changes text editor to non-editable mode. |
|
675 |
*/ |
|
676 |
EAvkonNotEditable =0x08000000, |
|
677 |
||
678 |
/** |
|
679 |
* Sets the @c Avkon wrapping rules ON. |
|
680 |
*/ |
|
681 |
EEdwinAlternativeWrapping = 0x10000000, |
|
682 |
||
683 |
/** |
|
684 |
* Enables tab key handling |
|
685 |
*/ |
|
686 |
EAvkonTabsEnabled = 0x20000000, |
|
687 |
||
688 |
/** |
|
689 |
* Disable VKB input |
|
690 |
*/ |
|
691 |
EAvkonDisableVKB = 0x40000000, |
|
692 |
||
693 |
/** |
|
694 |
* Enable Smiley Support |
|
695 |
*/ |
|
696 |
EAvkonEnableSmileySupport = 0x80000000 |
|
697 |
}; |
|
698 |
||
699 |
/** |
|
700 |
* Defines the possible commands for @c ClipboardL(). |
|
701 |
*/ |
|
702 |
enum TClipboardFunc |
|
703 |
{ |
|
704 |
/** Do nothing. */ |
|
705 |
ENoClipboard, |
|
706 |
||
707 |
/** Cut. */ |
|
708 |
ECut, |
|
709 |
||
710 |
/** Copy. */ |
|
711 |
ECopy, |
|
712 |
||
713 |
/** Paste. */ |
|
714 |
EPaste |
|
715 |
}; |
|
716 |
||
717 |
/** |
|
718 |
* The following flags may be ORed together for text searches (see |
|
719 |
* @c FindL() for example). |
|
720 |
*/ |
|
721 |
enum TFindFlags |
|
722 |
{ |
|
723 |
/** Search progresses up the screen. */ |
|
724 |
EFindDirectionUp =0x01, |
|
725 |
||
726 |
/** Only whole-word matches count. */ |
|
727 |
EFindWholeWord =0x02, |
|
728 |
||
729 |
/** Search is case-sensitive. */ |
|
730 |
EFindCaseSensitive =0x04, |
|
731 |
||
732 |
/** Finds again. */ |
|
733 |
EFindAgain =0x08, |
|
734 |
||
735 |
/** Does not display a busy message. */ |
|
736 |
ENoBusyMessage =0x10, |
|
737 |
||
738 |
/** */ |
|
739 |
EReadOnlyFile =0x20 // New for CKon |
|
740 |
}; |
|
741 |
||
742 |
/** |
|
743 |
* When content is supplied to an Edwin using @c SetDocumentContentL(), |
|
744 |
* this defines whether the new content is added to or has replaced the |
|
745 |
* existing content. |
|
746 |
*/ |
|
747 |
enum TSetContent |
|
748 |
{ |
|
749 |
/** Replaces the Edwin’s existing content. */ |
|
750 |
EUseText, |
|
751 |
||
752 |
/** Copies the supplied content into the existing content. */ |
|
753 |
ECopyText |
|
754 |
}; |
|
755 |
||
756 |
/** |
|
757 |
* Specifies whether the Edwin owns the document it is being used to edit. |
|
758 |
* |
|
759 |
* If the Edwin owns the document, the document object is destroyed on |
|
760 |
* destruction. |
|
761 |
*/ |
|
762 |
enum TOwnershipType |
|
763 |
{ |
|
764 |
/** Document is owned by the Edwin. */ |
|
765 |
EOwnsText, |
|
766 |
||
767 |
/** Document is owned by some other object. */ |
|
768 |
EDoesNotOwnText |
|
769 |
}; |
|
770 |
||
771 |
// order of hotkeys defined in resource file. Not all applicable to plain |
|
772 |
// text editors |
|
773 |
/** |
|
774 |
* Enumerates the hotkeys that are defined an @c r_eik_edwin_ctrl_hotkeys |
|
775 |
* or @c r_eik_edwin_shift_ctrl_hotkeys resource. |
|
776 |
* |
|
777 |
* Not all are applicable to plain text editors. |
|
778 |
*/ |
|
779 |
enum TEdwinHotKeys |
|
780 |
{ |
|
781 |
/** Cut. */ |
|
782 |
EHotKeyCut, |
|
783 |
||
784 |
/** Copy. */ |
|
785 |
EHotKeyCopy, |
|
786 |
||
787 |
/** Paste. */ |
|
788 |
EHotKeyPaste, |
|
789 |
||
790 |
/** Undo. */ |
|
791 |
EHotKeyUndo, |
|
792 |
||
793 |
/** Find. */ |
|
794 |
EHotKeyFind, |
|
795 |
||
796 |
/** Insert a character. */ |
|
797 |
EHotKeyInsertChar, |
|
798 |
||
799 |
/** Bold. */ |
|
800 |
EHotKeyBold, |
|
801 |
||
802 |
/** Italic. */ |
|
803 |
EHotKeyItalic, |
|
804 |
||
805 |
/** Underline. */ |
|
806 |
EHotKeyUnderline, |
|
807 |
||
808 |
/** Font. */ |
|
809 |
EHotKeyFont, |
|
810 |
||
811 |
/** Insert an object. */ |
|
812 |
EHotKeyInsertObject, |
|
813 |
||
814 |
/** Edit an object. */ |
|
815 |
EHotKeyEditObject, |
|
816 |
||
817 |
/** Format an object. */ |
|
818 |
EHotKeyFormatObject |
|
819 |
}; |
|
820 |
||
821 |
public: // construction and destruction |
|
822 |
||
823 |
/** |
|
824 |
* Destructor. |
|
825 |
* |
|
826 |
* Deletes objects and frees resources owned by this object. The Edwin’s |
|
827 |
* editable text is freed if the @c EKeepDocument flag is not set. |
|
828 |
*/ |
|
829 |
IMPORT_C ~CEikEdwin(); |
|
830 |
||
831 |
/** |
|
832 |
* C++ default constructor. |
|
833 |
* |
|
834 |
* Creates a new @c Edwin, FEP support for the new editor will not be |
|
835 |
* present if there is insufficient memory. |
|
836 |
*/ |
|
837 |
IMPORT_C CEikEdwin(); |
|
838 |
||
839 |
/** |
|
840 |
* Constructor. |
|
841 |
* |
|
842 |
* Creates a new @c Edwin, specifying the border to use. As with the default |
|
843 |
* constructor, FEP support for the new editor will not be present if there |
|
844 |
* is insufficient memory. S60 Edwin does not support / draw any borders. |
|
845 |
* |
|
846 |
* @param aBorder The Edwin border. |
|
847 |
*/ |
|
848 |
IMPORT_C CEikEdwin(const TGulBorder& aBorder); |
|
849 |
||
850 |
/** |
|
851 |
* Handles Symbian 2nd phase construction. |
|
852 |
* Completes construction of a new @c Edwin, initialising its heap-stored |
|
853 |
* members from the supplied arguments. |
|
854 |
* |
|
855 |
* @param aEdwinFlags Bitwise ORed combination of flags from @c TFlags. |
|
856 |
Default value is 0. |
|
857 |
* @param aWidthInChars Specifies the width for the Edwin, in characters or |
|
858 |
pixels: see the @c EWidthInPixels flag. Default value is 0. |
|
859 |
* @param aTextLimit Maximum length for the text to present as editable. |
|
860 |
Default value is 0. |
|
861 |
* @param aNumberOfLines Height for the Edwin, in lines. Default value |
|
862 |
is 0. |
|
863 |
*/ |
|
864 |
IMPORT_C void ConstructL(TInt aEdwinFlags=0, |
|
865 |
TInt aWidthInChars=0, |
|
866 |
TInt aTextLimit=0, |
|
867 |
TInt aNumberOfLines=0); |
|
868 |
||
869 |
/** |
|
870 |
* Sets the Edwin observer. The Edwin’s observer will be called back with |
|
871 |
* control events associated with the Edwin. |
|
872 |
* |
|
873 |
* @param aEdwinObserver New observer. |
|
874 |
*/ |
|
875 |
IMPORT_C void SetEdwinObserver(MEikEdwinObserver* aEdwinObserver); |
|
876 |
||
877 |
/** |
|
878 |
* Adds an observer of standard Edwin events to the list of observers, |
|
879 |
* creating the list if necessary. May be called any number of times and is |
|
880 |
* independent of calls to @c SetEdwinObserver. |
|
881 |
* |
|
882 |
* @param aEdwinObserver The observer to add to the list of observers. |
|
883 |
*/ |
|
884 |
IMPORT_C void AddEdwinObserverL(MEikEdwinObserver* aEdwinObserver); |
|
885 |
||
886 |
/** |
|
887 |
* Removes the specified observer from the list of observers. Does nothing |
|
888 |
* if aEdwinObserver is not an observer. |
|
889 |
* |
|
890 |
* @param aEdwinObserver The observer to remove from the list of observers. |
|
891 |
*/ |
|
892 |
IMPORT_C void RemoveEdwinObserver(MEikEdwinObserver* aEdwinObserver); |
|
893 |
||
894 |
/** |
|
895 |
* Creates the containing window for the Edwin if it does not already have one. |
|
896 |
*/ |
|
897 |
IMPORT_C void SetContainerWindowL(); |
|
898 |
||
899 |
/** |
|
900 |
* Sets the Edwin’s editable content. Before calling this function you must |
|
901 |
* get the @c iText pointer as @c iText is replaced by @c aText. You must |
|
902 |
* also free the memory by deleting the previous @c iText contents. |
|
903 |
* |
|
904 |
* @param aText New value for the content. |
|
905 |
* @param aContent Specifies whether to use @c aText itself, or to copy its |
|
906 |
* content. Default value is @c CEikEdwin::ECopyText. |
|
907 |
*/ |
|
908 |
IMPORT_C void SetDocumentContentL(CGlobalText& aText, |
|
909 |
TSetContent aContent=CEikEdwin::ECopyText); |
|
910 |
||
911 |
public: // from CCoeControl |
|
912 |
||
913 |
/** |
|
914 |
* From @c CCoeControl. |
|
915 |
* |
|
916 |
* Handles key events. |
|
917 |
* |
|
918 |
* @param aKeyEvent The key event. |
|
919 |
* @param aType The type of the event: @c EEventKeyDown, @c EEventKeyUp |
|
920 |
* or @c EEventKey. |
|
921 |
* @return A suitable response code. |
|
922 |
*/ |
|
923 |
IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, |
|
924 |
TEventCode aType); |
|
925 |
||
926 |
/** |
|
927 |
* From @c CCoeControl. |
|
928 |
* |
|
929 |
* Responds to focus-changed events. |
|
930 |
* |
|
931 |
* @param aDrawNow Not used. |
|
932 |
*/ |
|
933 |
IMPORT_C void FocusChanged(TDrawNow aDrawNow); |
|
934 |
||
935 |
/** |
|
936 |
* From @c CCoeControl. |
|
937 |
* |
|
938 |
* Sets the Edwin as ready for drawing. |
|
939 |
* |
|
940 |
* @leave KErrNoMemory. |
|
941 |
*/ |
|
942 |
IMPORT_C void ActivateL(); |
|
943 |
||
944 |
/** |
|
945 |
* From @c CCoeControl. |
|
946 |
* |
|
947 |
* Completes the construction of a new @c Edwin. This function initialises |
|
948 |
* the heap-stored members from an @c EDWIN resource. |
|
949 |
* |
|
950 |
* @param aReader A reader positioned for reading from an @c EDWIN resource. |
|
951 |
*/ |
|
952 |
IMPORT_C void ConstructFromResourceL(TResourceReader& aReader); |
|
953 |
||
954 |
/** |
|
955 |
* From @c CCoeControl. |
|
956 |
* |
|
957 |
* Handles pointer events. |
|
958 |
* |
|
959 |
* @param aPointerEvent Pointer event to respond to. |
|
960 |
*/ |
|
961 |
IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
962 |
||
963 |
/** |
|
964 |
* From @c CCoeControl. |
|
965 |
* |
|
966 |
* Gets the minimum size of this Edwin for automatic-layout control |
|
967 |
* contexts such as dialogs. |
|
968 |
* |
|
969 |
* @return Minimum size for the control. |
|
970 |
*/ |
|
971 |
IMPORT_C TSize MinimumSize(); |
|
972 |
||
973 |
/** |
|
974 |
* From @c CCoeControl. |
|
975 |
* |
|
976 |
* Draws the control on request. |
|
977 |
* |
|
978 |
* @param aRect If supplied, the rectangle in which to draw the Edwin. |
|
979 |
*/ |
|
980 |
IMPORT_C void Draw(const TRect& aRect) const; |
|
981 |
||
982 |
/** |
|
983 |
* From @c CCoeControl. |
|
984 |
* |
|
985 |
* Dims or undims the Edwin. |
|
986 |
* |
|
987 |
* @param aDimmed @c ETrue to dim the Edwin. @c EFalse to undim the Edwin. |
|
988 |
*/ |
|
989 |
IMPORT_C void SetDimmed(TBool aDimmed); |
|
990 |
||
991 |
/** |
|
992 |
* From @c CCoeControl. |
|
993 |
* |
|
994 |
* Sets the containing window for the Edwin by copying it from the specified |
|
995 |
* parent. Also copies a control context from @c aParent if one has not been |
|
996 |
* previously set. |
|
997 |
* |
|
998 |
*@param aParent The control to set as this Edwin’s parent. |
|
999 |
*/ |
|
1000 |
IMPORT_C void SetContainerWindowL(const CCoeControl& aParent); |
|
1001 |
||
1002 |
/** |
|
1003 |
* From @c CCoeControl. |
|
1004 |
* |
|
1005 |
* Gets the list of logical colours employed in the drawing of the control, |
|
1006 |
* paired with an explanation of how they are used. Appends the list to |
|
1007 |
* @c aColorUseList. |
|
1008 |
* |
|
1009 |
* @param[out] aColorUseList The list of logical colours. |
|
1010 |
*/ |
|
1011 |
IMPORT_C virtual void GetColorUseListL(CArrayFix<TCoeColorUse>& |
|
1012 |
aColorUseList) const; // not available before Release 005u |
|
1013 |
||
1014 |
// not available before Release 005u |
|
1015 |
/** |
|
1016 |
* From @c CCoeControl. |
|
1017 |
* |
|
1018 |
* Handles a change to Edwin’s resources which are shared across the |
|
1019 |
* environment. Colours or fonts for example. |
|
1020 |
* |
|
1021 |
* @param aType The type of resource that was changed. |
|
1022 |
*/ |
|
1023 |
IMPORT_C virtual void HandleResourceChange(TInt aType); |
|
1024 |
||
1025 |
/** |
|
1026 |
* From @c CCoeControl. |
|
1027 |
* |
|
1028 |
* Access to the input capabilities of the edwin. |
|
1029 |
* |
|
1030 |
* If this function is overrided in a subclass, the subclass should |
|
1031 |
* obtain this class' InputCapabilities' object provider through |
|
1032 |
* TCoeInputCapabilities::ObjectProvider() and set that as a part of |
|
1033 |
* the subclass' InputCapabilities object provider chain to ensure |
|
1034 |
* maximum functionality. |
|
1035 |
* |
|
1036 |
* @return The Edwin input capabilities. |
|
1037 |
*/ |
|
1038 |
IMPORT_C TCoeInputCapabilities InputCapabilities() const; |
|
1039 |
||
1040 |
/** |
|
1041 |
* From @c CCoeControl. |
|
1042 |
* |
|
1043 |
* This method sets the input capabilities of the edwin. Ownership of the |
|
1044 |
* T-class is not transferred. |
|
1045 |
* |
|
1046 |
* @param aInputCapabilities Reference to an input capabilities object |
|
1047 |
* on the heap. |
|
1048 |
* @leave KErrNoMemory Edwin FEB support object is not created. |
|
1049 |
*/ |
|
1050 |
IMPORT_C void SetInputCapabilitiesL(const TCoeInputCapabilities& |
|
1051 |
aInputCapabilities); |
|
1052 |
||
1053 |
/** |
|
1054 |
* From @c CCoeControl. |
|
1055 |
* |
|
1056 |
* In debug mode writes the internal state to the given stream. Does |
|
1057 |
* nothing in release mode. |
|
1058 |
* |
|
1059 |
* @param[out] aWriteStream A stream for writing the internal state. |
|
1060 |
*/ |
|
1061 |
IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const; |
|
1062 |
||
1063 |
private: |
|
1064 |
||
1065 |
/** |
|
1066 |
* From CAknControl |
|
1067 |
*/ |
|
1068 |
IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
1069 |
||
1070 |
public: // from MEikScrollBarObserver |
|
1071 |
||
1072 |
/** |
|
1073 |
* From @c MEikScrollBarObserver. |
|
1074 |
* |
|
1075 |
* Handles scrollbar key events. |
|
1076 |
* |
|
1077 |
* @param aScrollBar The scrollbar. |
|
1078 |
* @param aEventType The type of key event. |
|
1079 |
*/ |
|
1080 |
IMPORT_C void HandleScrollEventL(CEikScrollBar* aScrollBar, |
|
1081 |
TEikScrollEvent aEventType); |
|
1082 |
||
1083 |
public: // from CTextView::MObserver |
|
1084 |
||
1085 |
/** |
|
1086 |
* From @c CTextView::MObserver. |
|
1087 |
* |
|
1088 |
* Called after reformatting but before redisplay so that edit windows |
|
1089 |
* etc. can be resized. |
|
1090 |
* |
|
1091 |
* @param aTextView Not used. |
|
1092 |
*/ |
|
1093 |
IMPORT_C void OnReformatL(const CTextView* aTextView); |
|
1094 |
||
1095 |
public: |
|
1096 |
||
1097 |
/** |
|
1098 |
* Gets the number of characters in the document. |
|
1099 |
* |
|
1100 |
* @return The number of characters in the document. |
|
1101 |
*/ |
|
1102 |
IMPORT_C TInt TextLength() const; |
|
1103 |
||
1104 |
/** |
|
1105 |
* Gets the cursor’s position within the document. |
|
1106 |
* |
|
1107 |
* @return The cursor’s position within the document. |
|
1108 |
*/ |
|
1109 |
IMPORT_C TInt CursorPos() const; |
|
1110 |
||
1111 |
/** |
|
1112 |
* Gets the number of characters including non-printing characters within |
|
1113 |
* the selection. |
|
1114 |
* |
|
1115 |
* @return The number of characters within the selection. |
|
1116 |
*/ |
|
1117 |
IMPORT_C TInt SelectionLength() const; |
|
1118 |
||
1119 |
/** |
|
1120 |
* Gets the cursor selection. If no text view is associated to the Edwin |
|
1121 |
* this returns @c TCursorSelection(0,0). |
|
1122 |
* |
|
1123 |
* @return The current selection. |
|
1124 |
*/ |
|
1125 |
IMPORT_C TCursorSelection Selection() const; |
|
1126 |
||
1127 |
/** |
|
1128 |
* Removes the selection and any composition text. The cursor position is |
|
1129 |
* unaffected. If there is no selected region, this function has no effect. |
|
1130 |
*/ |
|
1131 |
IMPORT_C void ClearSelectionL(); |
|
1132 |
||
1133 |
/** |
|
1134 |
* Sets the text selection. Highlights the selected area and makes the new |
|
1135 |
* cursor position visible. Any previous selection is cancelled. This |
|
1136 |
* function also updates the scroll bar thumbs if present. |
|
1137 |
* |
|
1138 |
* @param aCursorPos The cursor’s position. |
|
1139 |
* @param aAnchorPos The anchor’s position. |
|
1140 |
*/ |
|
1141 |
IMPORT_C void SetSelectionL(TInt aCursorPos,TInt aAnchorPos); |
|
1142 |
||
1143 |
/** |
|
1144 |
* Sets the cursor’s position within the document. If the new position is |
|
1145 |
* not visible the text is scrolled so that the line containing the |
|
1146 |
* cursor is visible. This function also updates the scroll bar thumbs |
|
1147 |
* if present. |
|
1148 |
* |
|
1149 |
* @param aCursorPos New cursor position. |
|
1150 |
* @param aSelect @c ETrue to extend the cursor’s selection to the new |
|
1151 |
* position. @c EFalse otherwise. |
|
1152 |
*/ |
|
1153 |
IMPORT_C void SetCursorPosL(TInt aCursorPos,TBool aSelect); |
|
1154 |
||
1155 |
/** |
|
1156 |
* Selects the entire document. |
|
1157 |
*/ |
|
1158 |
IMPORT_C void SelectAllL(); |
|
1159 |
||
1160 |
/** |
|
1161 |
* Recalculates the screen width of an Edwin from the specified number |
|
1162 |
* of character widths. This is called during construction. If the |
|
1163 |
* Edwin only allows editing of numbers, the width of the zero |
|
1164 |
* character (0) is used; otherwise |
|
1165 |
* @c CFont::MaxNormalCharWidthInPixels() is used. |
|
1166 |
* |
|
1167 |
* If the @c EWidthInPixels flag has been set, the @c aWidthInChars |
|
1168 |
* argument is measured in pixels, not characters. |
|
1169 |
* |
|
1170 |
* @param aWidthInChars Width in either pixels or characters. |
|
1171 |
*/ |
|
1172 |
IMPORT_C void CalculateWidth(TInt aWidthInChars); |
|
1173 |
||
1174 |
/** |
|
1175 |
* Copies the entire document’s content into a descriptor. It is the |
|
1176 |
* caller's responsibility to provide a large enough buffer. |
|
1177 |
* |
|
1178 |
* @param[out] aDes An initialised descriptor which on return contains a |
|
1179 |
* copy of the content of this Edwin. |
|
1180 |
*/ |
|
1181 |
IMPORT_C void GetText(TDes& aDes) const; |
|
1182 |
||
1183 |
/** |
|
1184 |
* Gets a new buffer containing a copy of the whole text document. |
|
1185 |
* |
|
1186 |
* @return A new copy of the document text. |
|
1187 |
*/ |
|
1188 |
IMPORT_C HBufC* GetTextInHBufL() const; |
|
1189 |
||
1190 |
/** |
|
1191 |
* Sets the document text of this Edwin from the contents of a descriptor. |
|
1192 |
* This function removes any pictures, any invalid characters and cancels |
|
1193 |
* any previous selection. |
|
1194 |
* |
|
1195 |
* @param aDes Descriptor from which to copy. |
|
1196 |
*/ |
|
1197 |
IMPORT_C void SetTextL(const TDesC* aDes); |
|
1198 |
||
1199 |
/** |
|
1200 |
* Handles cut, copy and paste commands. This function also reports a |
|
1201 |
* change of state of the control to the observer when necessary. |
|
1202 |
* |
|
1203 |
* @param aClipboardFunc Clipboard operation. |
|
1204 |
*/ |
|
1205 |
IMPORT_C void ClipboardL(TClipboardFunc aClipboardFunc); |
|
1206 |
||
1207 |
/** |
|
1208 |
* Inserts a field at the current cursor position. If a selection was made |
|
1209 |
* the field replaces that selection. |
|
1210 |
* |
|
1211 |
* @param aField Text field to insert. |
|
1212 |
* @param aFieldType Type of the field. |
|
1213 |
*/ |
|
1214 |
IMPORT_C void InsertFieldL(CTextField* aField, TUid aFieldType); |
|
1215 |
||
1216 |
/** |
|
1217 |
* Updates all the fields in the document. |
|
1218 |
*/ |
|
1219 |
IMPORT_C void UpdateAllFieldsL(); |
|
1220 |
||
1221 |
/** |
|
1222 |
* Updates any text field at the current cursor position. Updating involves |
|
1223 |
* calculating the new value for the field, and replacing the field’s |
|
1224 |
* existing text content with the new text. |
|
1225 |
* |
|
1226 |
* This function does nothing if the cursor is not within a text field. |
|
1227 |
*/ |
|
1228 |
IMPORT_C void UpdateCurrentFieldL(); |
|
1229 |
||
1230 |
/** |
|
1231 |
* Counts and returns the number of words in the document. |
|
1232 |
* |
|
1233 |
* @return The number of words in the document. |
|
1234 |
*/ |
|
1235 |
IMPORT_C TInt CountWords(); |
|
1236 |
||
1237 |
/** |
|
1238 |
* Inserts the contents of a text file into the text being edited at the |
|
1239 |
* current cursor position. |
|
1240 |
* |
|
1241 |
* @param aFileName The file to open and read. |
|
1242 |
* @param aTextOrganisation How to handle line breaks. Default value is |
|
1243 |
* @c CPlainText::EOrganiseByLine. |
|
1244 |
*/ |
|
1245 |
IMPORT_C void InsertFromTextFileL(const TFileName &aFileName, |
|
1246 |
const CPlainText::TTextOrganisation |
|
1247 |
aTextOrganisation=CPlainText::EOrganiseByLine); |
|
1248 |
||
1249 |
/** |
|
1250 |
* Uses @c SetScrollBarsL() to set the scrollbars. |
|
1251 |
* |
|
1252 |
* @param aPtr Pointer to @c CEikEdwin instance. |
|
1253 |
* @return Integer value of @c EFalse. |
|
1254 |
*/ |
|
1255 |
IMPORT_C static TInt IdleL(TAny *aPtr); |
|
1256 |
||
1257 |
/** |
|
1258 |
* Gets a pointer to the Edwin’s document contents. |
|
1259 |
* |
|
1260 |
* @return A @c CPlainText pointer which contains the |
|
1261 |
* document. |
|
1262 |
*/ |
|
1263 |
IMPORT_C CPlainText* Text() const; |
|
1264 |
||
1265 |
// this is particularly important for when the front-end processor is |
|
1266 |
// inline-editing a CEikEdwin |
|
1267 |
/** |
|
1268 |
* Cancels any current transaction with the Edwin’s front-end processor. |
|
1269 |
* Any front-end input windows are removed, and any highlighted text being |
|
1270 |
* edited in the Edwin is removed. The Edwin is rolled back to the state |
|
1271 |
* it was in before the FEP transaction started. This function is called |
|
1272 |
* by @c CEikEdwin itself when the document content, the cursor position |
|
1273 |
* or the current selection is changed. |
|
1274 |
* |
|
1275 |
* Cancelling outstanding FEP transactions before performing operations |
|
1276 |
* on the text programmatically is particularly important when the |
|
1277 |
* front-end processor is inline-editing an Edwin. |
|
1278 |
* |
|
1279 |
*/ |
|
1280 |
IMPORT_C void CancelFepTransaction(); |
|
1281 |
||
1282 |
/** |
|
1283 |
* Handles all modifications made by reformatting the entire document. |
|
1284 |
* Calls @c CEikEdwin::FormatText() and redraws Edwin contents and |
|
1285 |
* scroll bars if they are ready to be redrawn. |
|
1286 |
*/ |
|
1287 |
IMPORT_C void HandleTextChangedL(); |
|
1288 |
||
1289 |
/** |
|
1290 |
* Gets the width used for laying out the text inside the Edwin in pixels. |
|
1291 |
* This may be larger or smaller than the width of the Edwin itself. |
|
1292 |
* See @c SetWysiwygModeOn() for example. |
|
1293 |
* |
|
1294 |
* @return Width of the text layout area in pixels. |
|
1295 |
*/ |
|
1296 |
IMPORT_C TInt LayoutWidth() const; |
|
1297 |
||
1298 |
/** |
|
1299 |
* Formats and draws a new document, updates scrollbars if necessary. |
|
1300 |
*/ |
|
1301 |
IMPORT_C void NotifyNewDocumentL(); |
|
1302 |
||
1303 |
/** |
|
1304 |
* Reformats and redraws the document, updates scrollbars if necessary. |
|
1305 |
*/ |
|
1306 |
IMPORT_C void NotifyNewFormatL(); |
|
1307 |
||
1308 |
/** |
|
1309 |
* Gets true if a substring is present in the text being edited before or |
|
1310 |
* after the cursor position. If @c aFindText is NULL, then the current |
|
1311 |
* word or selection will be searched for again. |
|
1312 |
* |
|
1313 |
* @param aFindText The substring to search for. |
|
1314 |
* @param aFindFlags See @c TFindFlags. Default value is 0. |
|
1315 |
* @return @c ETrue if aFindText is found. |
|
1316 |
*/ |
|
1317 |
IMPORT_C TBool FindL(const TDesC* aFindText,TInt aFindFlags=0); |
|
1318 |
||
1319 |
/** |
|
1320 |
* Gets the cursor position of the matching text in the document. The |
|
1321 |
* search starts from @c aPos. If @c aFindText is NULL, then the |
|
1322 |
* current word or selection will be searched for. If the substring |
|
1323 |
* cannot be found, this function returns @c KErrNotFound. |
|
1324 |
* |
|
1325 |
* @param aFindText The substring to search for. |
|
1326 |
* @param aPos Starting position for the find. |
|
1327 |
* @param aFindFlags See @c TFindFlags. |
|
1328 |
* @return KErrNotFound if the text was not found, otherwise the |
|
1329 |
* position of the matched substring. |
|
1330 |
*/ |
|
1331 |
IMPORT_C TInt FindTextL(const TDesC* aFindText,TInt aPos,TInt aFindFlags); |
|
1332 |
||
1333 |
/** |
|
1334 |
* Replaces the highlighted text. See @c SEdwinFindModel struct. |
|
1335 |
* |
|
1336 |
* @param[in,out] aFindModel Pointer to the replacement text. |
|
1337 |
*/ |
|
1338 |
IMPORT_C void ReplaceL(SEdwinFindModel* aFindModel); |
|
1339 |
||
1340 |
/** |
|
1341 |
* Replaces all occurrences of a string with new text. Both old and new |
|
1342 |
* text are held in @c aFindModel. |
|
1343 |
* |
|
1344 |
* @param[in,out] aFindModel Pointer to the replacement text. |
|
1345 |
* @leave This function will leave if the replace operation fails |
|
1346 |
* unexpectedly. |
|
1347 |
*/ |
|
1348 |
IMPORT_C void ReplaceAllL(SEdwinFindModel* aFindModel); |
|
1349 |
||
1350 |
/** |
|
1351 |
* Gets the current word or selection and searches for it. This function |
|
1352 |
* is called by @c FindL() and @c FindTextL() when no text to search for |
|
1353 |
* is given. |
|
1354 |
* |
|
1355 |
* @param aFindText An empty descriptor. |
|
1356 |
*/ |
|
1357 |
IMPORT_C void GetFindText(TDes* aFindText); |
|
1358 |
||
1359 |
/** |
|
1360 |
* Updates scrollbars. |
|
1361 |
*/ |
|
1362 |
IMPORT_C void UpdateScrollBarsL(); |
|
1363 |
||
1364 |
/** |
|
1365 |
* Creates the Edwin scroll bar frame with no pre-allocation of memory |
|
1366 |
* for scroll bars. |
|
1367 |
* |
|
1368 |
* @return The scroll bar frame. |
|
1369 |
*/ |
|
1370 |
IMPORT_C CEikScrollBarFrame* CreateScrollBarFrameL(); |
|
1371 |
||
1372 |
/** |
|
1373 |
* Creates a pre-allocated scroll bar frame. |
|
1374 |
* |
|
1375 |
* @return Pre-allocated scroll bar frame. |
|
1376 |
*/ |
|
1377 |
inline CEikScrollBarFrame* CreatePreAllocatedScrollBarFrameL(); |
|
1378 |
||
1379 |
/** |
|
1380 |
* Gets the scroll bar frame surrounding this Edwin. |
|
1381 |
* |
|
1382 |
* @return Pointer to this Edwin’s scroll bar frame. |
|
1383 |
*/ |
|
1384 |
inline CEikScrollBarFrame* ScrollBarFrame(); |
|
1385 |
||
1386 |
/** |
|
1387 |
* Sets word wrapping on or off. |
|
1388 |
* |
|
1389 |
* @param aWrapIsOn @c ETrue enables word wrapping, @c EFalse disables |
|
1390 |
* word wrapping. |
|
1391 |
*/ |
|
1392 |
IMPORT_C void SetWordWrapL(TBool aWrapIsOn); |
|
1393 |
||
1394 |
/** |
|
1395 |
* Gets the width of a line cursor in pixels. |
|
1396 |
* |
|
1397 |
* @return Always 0. |
|
1398 |
*/ |
|
1399 |
IMPORT_C virtual TInt LineCursorWidth() const; |
|
1400 |
||
1401 |
/** |
|
1402 |
* Sets the zoom factor of the document and reformats the document. |
|
1403 |
* |
|
1404 |
* @param aZoomFactor New value for the zooming factor. |
|
1405 |
*/ |
|
1406 |
IMPORT_C void SetZoomFactorL(TZoomFactor* aZoomFactor); |
|
1407 |
||
1408 |
/** |
|
1409 |
* Sets the Edwin’s background colour. |
|
1410 |
* |
|
1411 |
* @param aBackground New value for the background colour. |
|
1412 |
*/ |
|
1413 |
IMPORT_C void SetBackgroundColorL(TRgb aBackground); |
|
1414 |
||
1415 |
/** |
|
1416 |
* Sets the format mode to be WYSIWYG. |
|
1417 |
* |
|
1418 |
* @param aLayoutWidth Formatting width in twips. |
|
1419 |
* @param aDevice Mapping between twips and pixels on the target device. |
|
1420 |
*/ |
|
1421 |
IMPORT_C void SetWysiwygModeOn(TInt aLayoutWidth, |
|
1422 |
MGraphicsDeviceMap* aDevice); |
|
1423 |
||
1424 |
/** |
|
1425 |
* Switches off the WYSIWYG mode. This function sets the new format mode |
|
1426 |
* to be @c EFScreenMode. |
|
1427 |
*/ |
|
1428 |
IMPORT_C void SetWysiwygModeOff(); |
|
1429 |
||
1430 |
/** |
|
1431 |
* Updates the text wrap width. This function is for use in WYSIWYG mode |
|
1432 |
* only. |
|
1433 |
* |
|
1434 |
* @param aLayoutWidth New width to wrap text at in WYSIWYG mode in twips. |
|
1435 |
*/ |
|
1436 |
IMPORT_C void UpdateLayoutWidth(TInt aLayoutWidth); |
|
1437 |
||
1438 |
/** |
|
1439 |
* Sends the Edwin’s document using an infra red beamer. |
|
1440 |
*/ |
|
1441 |
IMPORT_C void SendDataOverIrL(); |
|
1442 |
||
1443 |
/** |
|
1444 |
* Receives an Edwin document using an infra red beamer. |
|
1445 |
* This function will leave if the data received is not a suitable type |
|
1446 |
* to be pasted into the Edwin. |
|
1447 |
*/ |
|
1448 |
IMPORT_C void ReceiveDataOverIrL(); |
|
1449 |
||
1450 |
/** |
|
1451 |
* Controls the formatting mode of the editor. |
|
1452 |
* |
|
1453 |
* The length of the text is compared against current formatting mode thresholds. |
|
1454 |
* (See method SetUpperFullFormattingLength). If the length is greater than the |
|
1455 |
* upper limit of full formatting, then the editor is set to "band" formatting, |
|
1456 |
* where the editor attempts to format as little as is needed, e.g. the visible part |
|
1457 |
* of the editor. If the text length is less than the lower limit of band formatting, |
|
1458 |
* then the formatting mode is switched to full document formatting. |
|
1459 |
* |
|
1460 |
* This method performs an immediate re-formatting of all or part of the text with the new formatting mode. |
|
1461 |
* |
|
1462 |
* @param aIsNewDoc If EFalse, attempts to perform re-formatting based upon current formatting |
|
1463 |
* If not EFalse, whole document it formatted from scratch |
|
1464 |
* Note: This parameter is ignored if aReFormat is EFalse |
|
1465 |
*/ |
|
1466 |
IMPORT_C void SetAmountToFormatL(TBool aIsNewDoc=EFalse); |
|
1467 |
||
1468 |
/** |
|
1469 |
* Controls the formatting mode of the editor. |
|
1470 |
* |
|
1471 |
* The length of the text is compared against the current formatting mode thresholds. |
|
1472 |
* (See method SetUpperFullFormattingLength). If the length is greater than the |
|
1473 |
* upper limit of full formatting, then the editor is set to "band" formatting, |
|
1474 |
* where the editor attempts to format as little as is needed, e.g. the visible part |
|
1475 |
* of the editor. If the text length is less than the lower limit of band formatting, |
|
1476 |
* then the formatting mode is switched to full document formatting. |
|
1477 |
* |
|
1478 |
* This method has a flag to allow any immediate re-formatting to be suppressed. |
|
1479 |
* Formatting text can be a time-consuming operation. If the client is able to |
|
1480 |
* ensure that no reformatting is needed, (for instance if a further re-formatting |
|
1481 |
* API is going to be called later) then the reformatting flag can be called |
|
1482 |
* with EFalse. Otherwise, a re-format will take place within this method. |
|
1483 |
* |
|
1484 |
* @since 3.1 |
|
1485 |
* @param aIsNewDoc If EFalse, attempts to perform re-formatting based upon current formatting |
|
1486 |
* If not EFalse, whole document it formatted from scratch |
|
1487 |
* Note: This parameter is ignored if aReFormat is EFalse |
|
1488 |
* @param aReFormat If EFalse, do not perform any re-formatting |
|
1489 |
*/ |
|
1490 |
IMPORT_C void SetAmountToFormatL( TBool aIsNewDoc, TBool aReFormat ); |
|
1491 |
||
1492 |
/** |
|
1493 |
* Sets the @c EPasteFromIrStore flag. |
|
1494 |
* |
|
1495 |
* @param aPasteFromIrStore @c ETrue to set the @c EPasteFromIrStore flag. |
|
1496 |
* @c EFalse to remove the @c EPasteFromIrStore flag. |
|
1497 |
*/ |
|
1498 |
IMPORT_C void SetPasteFromIrStore(TBool aPasteFromIrStore); |
|
1499 |
||
1500 |
/** |
|
1501 |
* Copies the contents of a stream store to the current cursor position, |
|
1502 |
* replacing any selected text. This function is used to paste data from |
|
1503 |
* the clipboard. |
|
1504 |
* |
|
1505 |
* @param[out] aStore Store from which to read. |
|
1506 |
* @param[in] aDict Stream dictionary. |
|
1507 |
*/ |
|
1508 |
IMPORT_C void PasteFromStoreL(CStreamStore& aStore, |
|
1509 |
CStreamDictionary& aDict); |
|
1510 |
||
1511 |
/** |
|
1512 |
* Copies the highlighted text into a stream store. |
|
1513 |
* |
|
1514 |
* @param[out] aStore Store to write to. |
|
1515 |
* @param[in] aDict Stream dictionary. |
|
1516 |
*/ |
|
1517 |
IMPORT_C void CopyToStoreL(CStreamStore& aStore, CStreamDictionary& aDict); |
|
1518 |
||
1519 |
/** |
|
1520 |
* Sets the text view margins. |
|
1521 |
* |
|
1522 |
* @param aMargins New value for the view’s margins. |
|
1523 |
*/ |
|
1524 |
IMPORT_C void SetBorderViewMargins(TMargins8 aMargins); |
|
1525 |
||
1526 |
/** |
|
1527 |
* Forces the scrollbars to update now; this is a synchronous function. |
|
1528 |
*/ |
|
1529 |
IMPORT_C void ForceScrollBarUpdateL(); |
|
1530 |
||
1531 |
/** |
|
1532 |
* Sets whether the Edwin owns a document. Edwins can either be used as a |
|
1533 |
* standalone text editor control, or as an editor for text owned by |
|
1534 |
* another object. The document ownership setting determines whether the |
|
1535 |
* Edwin or another object owns the document. |
|
1536 |
* |
|
1537 |
* @param aOwner Whether Edwin or another object owns the document. |
|
1538 |
* See @c TOwnershipType. |
|
1539 |
*/ |
|
1540 |
IMPORT_C void SetDocumentOwnership(TOwnershipType aOwner); |
|
1541 |
||
1542 |
/** |
|
1543 |
* Sets the maximum number of characters that can be inserted. |
|
1544 |
* |
|
1545 |
* @param aLimit New maximum for the number of characters that can be |
|
1546 |
* inserted. |
|
1547 |
*/ |
|
1548 |
IMPORT_C void SetTextLimit(TInt aLimit); |
|
1549 |
||
1550 |
/** |
|
1551 |
* Displays a dialog allowing the user to choose a character from the |
|
1552 |
* character map. The selected character is inserted into the Edwin |
|
1553 |
* at the current cursor position. |
|
1554 |
*/ |
|
1555 |
IMPORT_C void RunCharMapDialogL(); |
|
1556 |
||
1557 |
/** |
|
1558 |
* Gets the text view margins. |
|
1559 |
* |
|
1560 |
* @return The text view margins. |
|
1561 |
*/ |
|
1562 |
IMPORT_C TMargins8 Margins() const; |
|
1563 |
||
1564 |
/** |
|
1565 |
* Gets the upper limit for formatting. This returns the value of |
|
1566 |
* @c KFullFormattingUpperThreshold which determines the maximum number of |
|
1567 |
* characters that can be formatted, if it is exceeded then only visible |
|
1568 |
* text is formatted. This is used with @c KPartialFormattingLowerThreshold |
|
1569 |
* to control the extent of text formatting. |
|
1570 |
* |
|
1571 |
* @return The value of @c KFullFormattingUpperThreshold. |
|
1572 |
*/ |
|
1573 |
IMPORT_C TInt UpperFullFormattingLength() const; |
|
1574 |
||
1575 |
/** |
|
1576 |
* Gets the lower limit for formatting. This returns the value of |
|
1577 |
* @c KPartialFormattingLowerThreshold which determines when a switch is |
|
1578 |
* made from formatting only visible text to formatting all text. When the |
|
1579 |
* text length exceeds the @c KFullFormattingUpperThreshold only visible |
|
1580 |
* text is formatted. If some characters are deleted so that the text |
|
1581 |
* length is less than @c KFullFormattingUpperThreshold the entire text |
|
1582 |
* is still not formatted. Instead, reformatting occurs only when the |
|
1583 |
* number of characters is less than the value of |
|
1584 |
* @c KPartialFormattingLowerThreshold. |
|
1585 |
* |
|
1586 |
* @return The value of @c KPartialFormattingLowerThreshold. |
|
1587 |
*/ |
|
1588 |
IMPORT_C TInt LowerPartialFormattingLength() const; |
|
1589 |
||
1590 |
/** |
|
1591 |
* Sets the Edwin’s read-only flag so that documents displayed by Edwin |
|
1592 |
* cannot be edited by users. |
|
1593 |
* |
|
1594 |
* @param aReadOnly @c ETrue to set Edwin to display documents as |
|
1595 |
* read-only. @c EFalse otherwise. |
|
1596 |
*/ |
|
1597 |
IMPORT_C void SetReadOnly(TBool aReadOnly); |
|
1598 |
||
1599 |
/** |
|
1600 |
* Determines whether the document being edited with Edwin is read-only. |
|
1601 |
* |
|
1602 |
* @return @c ETrue if the document being edited is read-only. |
|
1603 |
* @c EFalse otherwise. |
|
1604 |
*/ |
|
1605 |
IMPORT_C TBool IsReadOnly() const; |
|
1606 |
||
1607 |
/** |
|
1608 |
* Gets editor flags from the editor. |
|
1609 |
* @return editor flags if existed |
|
1610 |
* @or return KErrNotFound |
|
1611 |
*/ |
|
1612 |
IMPORT_C TInt CEikEdwin::AknEditorFlags(); |
|
1613 |
||
1614 |
||
1615 |
||
1616 |
/** |
|
1617 |
* Determines whether the document being edited is read only. Displays |
|
1618 |
* a message with @c CEikonEnv::InfoMsg() if the document is set as |
|
1619 |
* read-only. |
|
1620 |
*/ |
|
1621 |
IMPORT_C void CheckNotReadOnlyL(); |
|
1622 |
||
1623 |
/** |
|
1624 |
* Sets whether the document accepts pictures. |
|
1625 |
* |
|
1626 |
* @param aAllow @c ETrue sets the document to accept pictures, @c EFalse |
|
1627 |
* sets the document to not accept pictures. |
|
1628 |
*/ |
|
1629 |
IMPORT_C void SetAllowPictures(TBool aAllow); |
|
1630 |
||
1631 |
/** |
|
1632 |
* Removes unwanted pictures. If @c EAllowPictures has been set, returns |
|
1633 |
* immediately. Otherwise, this function checks the document text between |
|
1634 |
* two bounds and removes all pictures in that range. |
|
1635 |
* |
|
1636 |
* @param aStartPos Where to start looking for unwanted pictures. |
|
1637 |
* @param aLength Where to stop. |
|
1638 |
*/ |
|
1639 |
IMPORT_C void CheckRemovePictures(TInt aStartPos,TInt aLength); |
|
1640 |
||
1641 |
/** |
|
1642 |
* Sets the minimum gap between text and the right hand edge of the Edwin |
|
1643 |
* when text is wrapped. This value is used to calculate the layout area |
|
1644 |
* for text. |
|
1645 |
* |
|
1646 |
* @param aGap Size of the gutter in pixels. |
|
1647 |
*/ |
|
1648 |
IMPORT_C void SetRightWrapGutter(TInt aGap); |
|
1649 |
||
1650 |
/** |
|
1651 |
* Undoes the most recent text operation when the Edwin supports this |
|
1652 |
* feature and when the undo store is not empty. |
|
1653 |
*/ |
|
1654 |
IMPORT_C void UndoL(); |
|
1655 |
||
1656 |
/** |
|
1657 |
* Deletes the undo store. |
|
1658 |
*/ |
|
1659 |
IMPORT_C void ClearUndo(); |
|
1660 |
||
1661 |
/** |
|
1662 |
* Sets whether the undo operation is permitted. |
|
1663 |
* |
|
1664 |
* @param aAllow ETrue to permit undo operations. EFalse to not permit undo |
|
1665 |
* operations. |
|
1666 |
*/ |
|
1667 |
IMPORT_C void SetAllowUndo(TBool aAllow); |
|
1668 |
||
1669 |
/** |
|
1670 |
* Gets whether Edwin is set to support the undo command. |
|
1671 |
* |
|
1672 |
* @return @c ETrue if edits can be undone. @c EFalse if edits cannot |
|
1673 |
* be undone. |
|
1674 |
*/ |
|
1675 |
IMPORT_C TBool SupportsUndo() const; |
|
1676 |
||
1677 |
/** |
|
1678 |
* Tests whether an undo is possible. Returns @c ETrue only if the undo |
|
1679 |
* store is available to Edwin. |
|
1680 |
* |
|
1681 |
* @return @c ETrue if the undo store is available. @c EFalse if the |
|
1682 |
* undo store is not available. |
|
1683 |
*/ |
|
1684 |
IMPORT_C TBool CanUndo() const; |
|
1685 |
||
1686 |
/** |
|
1687 |
* Sets whether picture characters and/or punctuation should be treated as |
|
1688 |
* word delimiters in addition to whitespace. |
|
1689 |
* |
|
1690 |
* @param aPicture @c ETrue if picture characters should be treated as |
|
1691 |
* delimiters for words. |
|
1692 |
* @param aPunctuation @c ETrue if punctuation should be treated as |
|
1693 |
* delimiters for words. |
|
1694 |
*/ |
|
1695 |
IMPORT_C void SetWordDelimiters(TBool aPicture,TBool aPunctuation); |
|
1696 |
||
1697 |
/** |
|
1698 |
* Gets the start position and the length of the word in which the |
|
1699 |
* specified document position is located. |
|
1700 |
* |
|
1701 |
* @param[in] aCurrentPos A position within a word in the text. |
|
1702 |
* @param[out] aStartPos Returns the start position of the word. |
|
1703 |
* @param[out] aLength Returns the word’s length. |
|
1704 |
*/ |
|
1705 |
IMPORT_C void GetWordInfo(TInt aCurrentPos, |
|
1706 |
TInt& aStartPos, |
|
1707 |
TInt& aLength) const; |
|
1708 |
||
1709 |
/** |
|
1710 |
* Sets the new cursor position. If the cursor is no longer visible the |
|
1711 |
* document is scrolled to display the line containing the new cursor |
|
1712 |
* position. Scrollbars are also updated if present. |
|
1713 |
* |
|
1714 |
* @param aMovement The cursor movement. |
|
1715 |
* @param aSelect If @c ETrue, the selection is extended. This corresponds |
|
1716 |
* to holding down the Shift key on a machine keyboard. |
|
1717 |
*/ |
|
1718 |
IMPORT_C void MoveCursorL(TCursorPosition::TMovementType aMovement, |
|
1719 |
TBool aSelect); |
|
1720 |
||
1721 |
/** |
|
1722 |
* Scrolls the text either horizontally or vertically without affecting |
|
1723 |
* the cursor’s position. |
|
1724 |
* |
|
1725 |
* @param aMovement The cursor's movement. |
|
1726 |
*/ |
|
1727 |
IMPORT_C void MoveDisplayL(TCursorPosition::TMovementType aMovement); |
|
1728 |
||
1729 |
/** |
|
1730 |
* Removes all non-ASCII characters from the specified text. This can be |
|
1731 |
* used to remove Unicode characters where they are not valid characters |
|
1732 |
* for example. |
|
1733 |
* |
|
1734 |
* @param aStartPos The start position in the text. |
|
1735 |
* @param aLength The number of characters, beginning with aStartPos to |
|
1736 |
* check. |
|
1737 |
*/ |
|
1738 |
IMPORT_C void CheckValidityOfChars(TInt aStartPos,TInt aLength); |
|
1739 |
||
1740 |
/** |
|
1741 |
* Sets the @c EOnlyASCIIChars flag. |
|
1742 |
* |
|
1743 |
* @param aASCIIOnly If @c ETrue the EOnlyASCIIChars flag will be set. If |
|
1744 |
* @c EFalse the EOnlyASCIIChars flag will be removed. |
|
1745 |
*/ |
|
1746 |
IMPORT_C void SetOnlyASCIIChars(TBool aASCIIOnly); |
|
1747 |
||
1748 |
/** |
|
1749 |
* Tests whether the @c EOnlyASCIIChars flag is set. |
|
1750 |
* |
|
1751 |
* @return @c ETrue if the @c EOnlyASCIIChars flag is set. |
|
1752 |
*/ |
|
1753 |
IMPORT_C TBool OnlyASCIIChars() const; |
|
1754 |
||
1755 |
/** |
|
1756 |
* Gets the average number of lines shown in Edwin’s view. |
|
1757 |
* |
|
1758 |
* @return The average number of lines. |
|
1759 |
*/ |
|
1760 |
inline TInt AvgLinesInViewRect() const; |
|
1761 |
||
1762 |
/** |
|
1763 |
* Gets the average number of characters on a line. |
|
1764 |
* |
|
1765 |
* @return The average number of characters on a line. |
|
1766 |
*/ |
|
1767 |
inline TInt AvgCharsPerLine() const; |
|
1768 |
||
1769 |
/** |
|
1770 |
* Sets the average number of lines displayed in Edwin’s view. |
|
1771 |
* |
|
1772 |
* @param aAvgLines The average number of lines to display. |
|
1773 |
*/ |
|
1774 |
inline void SetAvgLinesInViewRect(TInt aAvgLines); |
|
1775 |
||
1776 |
/** |
|
1777 |
* Sets the average number of characters per line. |
|
1778 |
* |
|
1779 |
* @param aAvgChars The average number of characters per line. |
|
1780 |
*/ |
|
1781 |
inline void SetAvgCharsPerLine(TInt aAvgChars); |
|
1782 |
||
1783 |
/** |
|
1784 |
* Sets the Edwin size observer. Does not imply transfer of ownership. |
|
1785 |
* |
|
1786 |
* @param aEdwinSizeObserver The Edwin size observer. |
|
1787 |
*/ |
|
1788 |
IMPORT_C void SetEdwinSizeObserver(MEikEdwinSizeObserver* |
|
1789 |
aEdwinSizeObserver); |
|
1790 |
||
1791 |
/** |
|
1792 |
* Gets the minimum Edwin height. |
|
1793 |
* |
|
1794 |
* @return The minimum Edwin height. |
|
1795 |
*/ |
|
1796 |
IMPORT_C TInt MinimumHeight() const; |
|
1797 |
||
1798 |
/** |
|
1799 |
* Gets the maximum Edwin height. |
|
1800 |
* |
|
1801 |
* Please do not use the following method for deciding heights if you are |
|
1802 |
* using edwins with Maximum Heights in forms. Use @c MaximumHeightInLines |
|
1803 |
* instead. |
|
1804 |
* |
|
1805 |
* @return The maximum Edwin height. |
|
1806 |
*/ |
|
1807 |
IMPORT_C TInt MaximumHeight() const; |
|
1808 |
||
1809 |
/** |
|
1810 |
* Sets the minimum Edwin height. This function also increases the maximum |
|
1811 |
* Edwin height if its value is less than @c aHeight. |
|
1812 |
*/ |
|
1813 |
IMPORT_C void SetMinimumHeight(TInt aHeight); |
|
1814 |
||
1815 |
/** |
|
1816 |
* Sets the maximum Edwin height. This function also decreases the minimum |
|
1817 |
* Edwin height if its value is greater than @c aHeight. |
|
1818 |
* |
|
1819 |
* Please do not use the following method for setting maximum heights if |
|
1820 |
* you are using edwins with maximum heights in forms. Use |
|
1821 |
* @c MaximumHeightInLines instead. |
|
1822 |
* |
|
1823 |
* @param aHeight The maximum Edwin height. |
|
1824 |
*/ |
|
1825 |
IMPORT_C void SetMaximumHeight(TInt aHeight); |
|
1826 |
||
1827 |
void OnEditorStateFlagChange( TInt aOldFlag, TInt aNewFlag ); |
|
1828 |
void ReportChinesePopupEventL( TBool aChinesePopupOpen ); |
|
1829 |
||
1830 |
public: // new utility methods |
|
1831 |
||
1832 |
/** |
|
1833 |
* Replaces the cursor selection with the identified text. |
|
1834 |
* |
|
1835 |
* @param aInsertPos The position at which text will be inserted. |
|
1836 |
* @param aText The text to insert. |
|
1837 |
* @param aDelete The cursor-selected text that will be replaced by @c |
|
1838 |
* aText. |
|
1839 |
*/ |
|
1840 |
IMPORT_C void InsertDeleteCharsL(TInt aInsertPos, |
|
1841 |
const TDesC& aText, |
|
1842 |
const TCursorSelection& aDelete); |
|
1843 |
||
1844 |
/** |
|
1845 |
* Sets non-printing characters?visibility. |
|
1846 |
* |
|
1847 |
* @param aVisibility Non-printing characters?visibility. |
|
1848 |
*/ |
|
1849 |
IMPORT_C void SetNonPrintingCharsVisibility(TNonPrintingCharVisibility |
|
1850 |
aVisibility); |
|
1851 |
||
1852 |
/** |
|
1853 |
* Sets non-printing characters?visibility. |
|
1854 |
* |
|
1855 |
* @return Non-printing characters?visibility. |
|
1856 |
*/ |
|
1857 |
IMPORT_C TNonPrintingCharVisibility NonPrintingCharsVisibility() const; |
|
1858 |
||
1859 |
public: // new Avkon wrap interface |
|
1860 |
||
1861 |
/** |
|
1862 |
* Sets the @c EAvkonEditor flag. |
|
1863 |
* |
|
1864 |
* @param aAvkonWrapIsOn If @c ETrue @c EAvkonEditor flag is set. |
|
1865 |
*/ |
|
1866 |
IMPORT_C void SetAvkonWrap(TBool aAvkonWrapIsOn); |
|
1867 |
||
1868 |
public: // Avkon editor extensions |
|
1869 |
||
1870 |
/** |
|
1871 |
* Sets default case for the editor. The case is used when the editor |
|
1872 |
* is focused first time. Available case flags from @c uikon.hrh |
|
1873 |
* are @c EAknEditorUpperCase, @c EAknEditorLowerCase and |
|
1874 |
* @c EAknEditorTextCase. @c EAknEditorTextCase is used if the initial |
|
1875 |
* case is not set from EDWIN resource default_case or with this API. |
|
1876 |
* |
|
1877 |
* @param aCase Initial case to be used in the editor. |
|
1878 |
*/ |
|
1879 |
IMPORT_C void SetAknEditorCase(TInt aCase); |
|
1880 |
||
1881 |
/** |
|
1882 |
* Sets permitted cases for the editor. |
|
1883 |
* Possible flags from @c uikon.hrh are @c EAknEditorAllCaseModes, |
|
1884 |
* @c EAknEditorUpperCase, @c EAknEditorLowerCase and |
|
1885 |
* @c EAknEditorTextCase. @c EAknEditorAllCaseModes is used if the value |
|
1886 |
* is not set from EDWIN resource allowed_case_modes or with this API. |
|
1887 |
* |
|
1888 |
* @param aPermittedCaseModes Case modes that are available in the editor. |
|
1889 |
*/ |
|
1890 |
IMPORT_C void SetAknEditorPermittedCaseModes(TInt aPermittedCaseModes); |
|
1891 |
||
1892 |
/** |
|
1893 |
* Sets number mode key mapping for '*' and '#' keys. The key mapping is |
|
1894 |
* used in editors when numeric input mode is used. Key mapping characters |
|
1895 |
* for '*' key are shown on special character table if also text input |
|
1896 |
* modes are allowed in the editor but the current input mode is numeric |
|
1897 |
* mode. @c EAknEditorStandardNumberModeKeymap is used in editors that |
|
1898 |
* allow only numeric input if the mapping is not set from EDWIN resource |
|
1899 |
* @c numeric_keymap or with this API. |
|
1900 |
* @c EAknEditorAlphanumericNumberModeKeymap is used as default if the |
|
1901 |
* editor allows also text input mode. |
|
1902 |
* |
|
1903 |
* @param aNumericKeymap Key mapping used in an editor with number input |
|
1904 |
* mode. |
|
1905 |
*/ |
|
1906 |
IMPORT_C void SetAknEditorNumericKeymap(TAknEditorNumericKeymap |
|
1907 |
aNumericKeymap); |
|
1908 |
||
1909 |
/** |
|
1910 |
* Sets default input mode for the editor. The input mode is used when |
|
1911 |
* the editor is focused first time. |
|
1912 |
* @c EAknEditorTextInputMode is used if the initial input mode is not set |
|
1913 |
* from EDWIN resource default_input_mode or with this API. |
|
1914 |
* |
|
1915 |
* @param aInputMode Initial input mode to be used in the editor. |
|
1916 |
*/ |
|
1917 |
IMPORT_C void SetAknEditorInputMode(TInt aInputMode); |
|
1918 |
||
1919 |
/** |
|
1920 |
* Sets allowed input modes for the editor. |
|
1921 |
* All input modes are allowed (@c EAknEditorAllInputModes) if the value |
|
1922 |
* is not set from EDWIN resource @c allowed_input_modes or with this API. |
|
1923 |
* |
|
1924 |
* @param aInputModes Input modes that are allowed in the editor. |
|
1925 |
*/ |
|
1926 |
IMPORT_C void SetAknEditorAllowedInputModes(TInt aInputModes); |
|
1927 |
||
1928 |
/** |
|
1929 |
* Sets editor specific special character table. |
|
1930 |
* |
|
1931 |
* @param aSCTResId Special character table dialog resource. |
|
1932 |
*/ |
|
1933 |
IMPORT_C void SetAknEditorSpecialCharacterTable(TInt aSCTResId); |
|
1934 |
||
1935 |
/** |
|
1936 |
* Sets initial editor flags for the editor. |
|
1937 |
* This method can be used also to update editor flags after the editor is |
|
1938 |
* focused. FEP is automatically notified of the updated editor flags. |
|
1939 |
* |
|
1940 |
* @param aFlags Avkon editor flags for the editor. |
|
1941 |
*/ |
|
1942 |
IMPORT_C void SetAknEditorFlags(TInt aFlags); |
|
1943 |
||
1944 |
/** |
|
1945 |
* Enables or disables CCPU interface provided functionalities |
|
1946 |
* (cut, copy, paste and undo). |
|
1947 |
* |
|
1948 |
* @param aSupport CCPU support enabled if @c ETrue. |
|
1949 |
*/ |
|
1950 |
IMPORT_C void EnableCcpuSupportL(TBool aSupport); |
|
1951 |
||
1952 |
/** |
|
1953 |
* Updates editor input mode. FEP is automatically notified of the |
|
1954 |
* new input mode in editor state and FEP takes new input mode to use |
|
1955 |
* immediatelly. Current inline editing is reset. |
|
1956 |
* This method should not be used for setting initial input mode for the |
|
1957 |
* editor. Use @c SetAknEditorInputMode() method instead for setting |
|
1958 |
* initial input mode. |
|
1959 |
* |
|
1960 |
* @param aInputMode New input mode for the editor. |
|
1961 |
*/ |
|
1962 |
IMPORT_C void SetAknEditorCurrentInputMode(TInt aInputMode); |
|
1963 |
||
1964 |
/** |
|
1965 |
* Returns the input mode that has been saved to editor state. |
|
1966 |
* |
|
1967 |
* @since S60 2.6 |
|
1968 |
* @return Input Mode that is saved to editor state. |
|
1969 |
*/ |
|
1970 |
IMPORT_C TInt AknEditorCurrentInputMode(); |
|
1971 |
||
1972 |
/** |
|
1973 |
* Updates editor case. FEP is automatically notified of the |
|
1974 |
* case change in editor state and FEP takes new case to use immediately. |
|
1975 |
* Available case flags from @c uikon.hrh are @c EAknEditorUpperCase, |
|
1976 |
* @c EAknEditorLowerCase and @c EAknEditorTextCase. |
|
1977 |
* This method should not be used to set initial case for the editor. |
|
1978 |
* Use @c SetAknEditorCase() method instead for setting initial case. |
|
1979 |
* |
|
1980 |
* @param aCase New case for the editor. |
|
1981 |
*/ |
|
1982 |
IMPORT_C void SetAknEditorCurrentCase(TInt aCase); |
|
1983 |
||
1984 |
/** |
|
1985 |
* Sets new local input language for the editor. Global input language |
|
1986 |
* changes have not effect for the input language but the user can still |
|
1987 |
* change the input language from the edit menu. |
|
1988 |
* |
|
1989 |
* @param aLanguage Editor local input language. |
|
1990 |
*/ |
|
1991 |
IMPORT_C void SetAknEditorLocalLanguage(TLanguage aLanguage); |
|
1992 |
||
1993 |
/** |
|
1994 |
* This call causes FEP to reset current editing state and |
|
1995 |
* new editing state is fetched from @c CAknEdwinState object. |
|
1996 |
*/ |
|
1997 |
IMPORT_C void NotifyEditorStateObserverOfStateChangeL(); |
|
1998 |
||
1999 |
/** |
|
2000 |
* Used for suppressing all editor's background drawing. This is |
|
2001 |
* intended for internal use. |
|
2002 |
* |
|
2003 |
* Note that when this is set, the background is not drawn with skin |
|
2004 |
* nor cleared, so the background MUST be drawn by the parent control |
|
2005 |
* every time the editor changes. |
|
2006 |
* |
|
2007 |
* @param aSuppress If ETrue, suppress background drawing |
|
2008 |
*/ |
|
2009 |
IMPORT_C void SetSuppressBackgroundDrawing( TBool aSuppress ); |
|
2010 |
||
2011 |
/** |
|
2012 |
* Tests if the background drawing is suppressed. |
|
2013 |
* |
|
2014 |
* @return ETrue if the background drawing is suppressed |
|
2015 |
*/ |
|
2016 |
IMPORT_C TBool IsBackgroundDrawingSuppressed() const; |
|
2017 |
||
2018 |
/** |
|
2019 |
* Used to prevent partial text lines from being drawn. |
|
2020 |
* The client is responsible for giving a sane value. An empty |
|
2021 |
* rect disables this feature. This is intended for internal use. |
|
2022 |
* |
|
2023 |
* @param aRect The rect which contains text lines to be drawn |
|
2024 |
*/ |
|
2025 |
IMPORT_C void SetTextLinesRect( const TRect& aRect ); |
|
2026 |
||
2027 |
/** |
|
2028 |
* Used to determine which area is used for scrolling |
|
2029 |
*/ |
|
2030 |
IMPORT_C void SetScrollRect( const TRect & aRect ); |
|
2031 |
||
2032 |
/** |
|
2033 |
* Gets the rectangle set for drawing only full lines. In case |
|
2034 |
* the feature is disabled, this returns an empty rect. |
|
2035 |
* This is intended for internal use. |
|
2036 |
* |
|
2037 |
* @return The rect which contains text lines to be drawn |
|
2038 |
*/ |
|
2039 |
IMPORT_C TRect GetTextLinesRect() const; |
|
2040 |
||
2041 |
/** |
|
2042 |
* Used to control cursor visibility |
|
2043 |
*/ |
|
2044 |
IMPORT_C void SetCursorVisible(TBool aVisible); |
|
2045 |
public: |
|
2046 |
||
2047 |
// These methods have been added for use with Avkon to set maximum |
|
2048 |
// editor heights. |
|
2049 |
/** |
|
2050 |
* Sets editor's maximum height in lines. |
|
2051 |
* |
|
2052 |
* @param aLines Maximum height in lines. |
|
2053 |
*/ |
|
2054 |
IMPORT_C void SetMaximumHeightInLines(TInt aLines); |
|
2055 |
||
2056 |
/** |
|
2057 |
* Gets editor maximum height in lines. |
|
2058 |
* |
|
2059 |
* @return Maximum height in lines. |
|
2060 |
*/ |
|
2061 |
IMPORT_C TInt MaximumHeightInLines() const; |
|
2062 |
||
2063 |
public: // From MEikCcpuEditor |
|
2064 |
||
2065 |
/** |
|
2066 |
* Tests whether the editor is focused. |
|
2067 |
* |
|
2068 |
* @return If editor is focused, @c ETrue is returned. |
|
2069 |
*/ |
|
2070 |
IMPORT_C TBool CcpuIsFocused() const; |
|
2071 |
||
2072 |
/** |
|
2073 |
* Tests whether the selected text can be cut. |
|
2074 |
* |
|
2075 |
* @return @c ETrue if it is possible to cut the selected text. |
|
2076 |
*/ |
|
2077 |
IMPORT_C TBool CcpuCanCut() const; |
|
2078 |
||
2079 |
/** |
|
2080 |
* Cuts selected text. |
|
2081 |
*/ |
|
2082 |
IMPORT_C void CcpuCutL(); |
|
2083 |
||
2084 |
/** |
|
2085 |
* Tests whether the selected text can be copied. |
|
2086 |
* |
|
2087 |
* @return @c ETrue if it is possible to copy the selected text. |
|
2088 |
*/ |
|
2089 |
IMPORT_C TBool CcpuCanCopy() const; |
|
2090 |
||
2091 |
/** |
|
2092 |
* Copies selected text. |
|
2093 |
*/ |
|
2094 |
IMPORT_C void CcpuCopyL(); |
|
2095 |
||
2096 |
/** |
|
2097 |
* Tests whether text can be pasted from the clipboard. |
|
2098 |
* |
|
2099 |
* @return @c ETrue if it is possible to paste the clipboard text. |
|
2100 |
*/ |
|
2101 |
IMPORT_C TBool CcpuCanPaste() const; |
|
2102 |
||
2103 |
/** |
|
2104 |
* Pastes text from the clipboard to the editor. |
|
2105 |
*/ |
|
2106 |
IMPORT_C void CcpuPasteL(); |
|
2107 |
||
2108 |
/** |
|
2109 |
* Tests is it possible to undo previous operation. |
|
2110 |
* |
|
2111 |
* @return @c ETrue if it is possible to undo previous operation. |
|
2112 |
*/ |
|
2113 |
IMPORT_C TBool CcpuCanUndo() const; |
|
2114 |
||
2115 |
/** |
|
2116 |
* Undoes the most recent text operation when the Edwin supports this |
|
2117 |
* feature and when the undo store is not empty |
|
2118 |
*/ |
|
2119 |
IMPORT_C void CcpuUndoL(); |
|
2120 |
||
2121 |
/** |
|
2122 |
* Gets edwin's flags from @c CAknEdwinState. |
|
2123 |
* |
|
2124 |
* @return The control's flags. |
|
2125 |
*/ |
|
2126 |
IMPORT_C TInt AknEdwinFlags() const; |
|
2127 |
||
2128 |
||
2129 |
public: // Internal to Symbian |
|
2130 |
||
2131 |
// the following methods are deprecated and will be removed in a future |
|
2132 |
// release |
|
2133 |
/** |
|
2134 |
* Allocates memory for the Edwin text view. |
|
2135 |
*/ |
|
2136 |
IMPORT_C void CreateTextViewL(); |
|
2137 |
||
2138 |
/** |
|
2139 |
* Gets Edwin text view. |
|
2140 |
* |
|
2141 |
* @return Pointer to the Edwin text view. |
|
2142 |
*/ |
|
2143 |
IMPORT_C CTextView* TextView() const; |
|
2144 |
||
2145 |
/** |
|
2146 |
* Gets Edwins text layout. |
|
2147 |
* |
|
2148 |
* @return Pointer to the text layout. |
|
2149 |
*/ |
|
2150 |
IMPORT_C CTextLayout* TextLayout() const; |
|
2151 |
||
2152 |
/** |
|
2153 |
* Sets undo buffer for the Edwin. |
|
2154 |
* |
|
2155 |
* @param aSelection The current selection. |
|
2156 |
* @return @c ETrue if buffer was set. |
|
2157 |
*/ |
|
2158 |
IMPORT_C TBool SetUndoBufferL(const TCursorSelection& aSelection); |
|
2159 |
||
2160 |
/** |
|
2161 |
* Sets new undoable text to the undo buffer. |
|
2162 |
* |
|
2163 |
* @param aSelection The current selection. |
|
2164 |
*/ |
|
2165 |
IMPORT_C void SetUndoableText(const TCursorSelection& aSelection); |
|
2166 |
||
2167 |
/** |
|
2168 |
* Gets the editor state. |
|
2169 |
* |
|
2170 |
* @return Pointer to editor state object. |
|
2171 |
*/ |
|
2172 |
CAknEdwinState* EditorState() const; |
|
2173 |
||
2174 |
/** |
|
2175 |
* Sets maximum length for the editor. |
|
2176 |
* |
|
2177 |
* @param aLength Maximum length for the editor. |
|
2178 |
*/ |
|
2179 |
inline void SetMaxLength(TInt aLength); |
|
2180 |
||
2181 |
/** |
|
2182 |
* Gets the editor maximum length. |
|
2183 |
* |
|
2184 |
* @return The editor maximum length |
|
2185 |
*/ |
|
2186 |
inline TInt MaxLength() const; |
|
2187 |
||
2188 |
public: |
|
2189 |
||
2190 |
// added to get access to user flags without a get/set for every different |
|
2191 |
// flag. |
|
2192 |
/** |
|
2193 |
* Adds user flags. |
|
2194 |
* See @c TFlags. |
|
2195 |
* |
|
2196 |
* @param aFlag Flags to add. |
|
2197 |
*/ |
|
2198 |
IMPORT_C void AddFlagToUserFlags(TUint32 aFlag); |
|
2199 |
||
2200 |
/** |
|
2201 |
* Removes user flags. |
|
2202 |
* See @c TFlags. |
|
2203 |
* |
|
2204 |
* @param aFlag Flags to remove. |
|
2205 |
*/ |
|
2206 |
IMPORT_C void RemoveFlagFromUserFlags(TUint32 aFlag); |
|
2207 |
||
2208 |
/** |
|
2209 |
* Gets user flags. |
|
2210 |
* See @c TFlags. |
|
2211 |
* |
|
2212 |
* @return The user flags. |
|
2213 |
*/ |
|
2214 |
IMPORT_C TUint32 UserFlags() const ; |
|
2215 |
||
2216 |
public: |
|
2217 |
||
2218 |
/** |
|
2219 |
* Sets the character format layer for the editor. Ownership of the |
|
2220 |
* CCharFormatLayer is transferred. |
|
2221 |
* |
|
2222 |
* @param aCharFormatLayer Pointer to the character format layer object. |
|
2223 |
*/ |
|
2224 |
IMPORT_C void SetCharFormatLayer(CCharFormatLayer* aCharFormatLayer); |
|
2225 |
||
2226 |
/** |
|
2227 |
* Sets the paragraph format layer for the editor. Ownership of the |
|
2228 |
* CParaFormatLayer is transferred. |
|
2229 |
* |
|
2230 |
* @param aParaFormatLayer Pointer to the paragraph format layer object. |
|
2231 |
*/ |
|
2232 |
IMPORT_C void SetParaFormatLayer(CParaFormatLayer* aParaFormatLayer); |
|
2233 |
||
2234 |
||
2235 |
public: // Skins support |
|
2236 |
||
2237 |
/** |
|
2238 |
* Sets within in the editor an externally owned Skins background control |
|
2239 |
* context. This background control context will then be used by the editor |
|
2240 |
* to draw background. |
|
2241 |
* |
|
2242 |
* If this API is not called, then the editor IS skin enabled, (that is |
|
2243 |
* @c CEikEdwins are skin enabled by default) but it will try to find a |
|
2244 |
* control context with which to perform background drawing from the |
|
2245 |
* Control Environment, via the Object Provider. |
|
2246 |
* |
|
2247 |
* Setting this control context to NULL will have the effect of turning off |
|
2248 |
* background skinning. |
|
2249 |
* |
|
2250 |
* @param aContext Control context to store. Not owned. Can be NULL. |
|
2251 |
*/ |
|
2252 |
IMPORT_C void SetSkinBackgroundControlContextL( MAknsControlContext* |
|
2253 |
aContext ); |
|
2254 |
||
2255 |
/** |
|
2256 |
* Access to Skins background control context that is potentially being |
|
2257 |
* used by the Editor. |
|
2258 |
* |
|
2259 |
* This API will first check to see if an control context has been set by |
|
2260 |
* API, and if so, return that. If the background control context has been |
|
2261 |
* set to NULL by API, then it will return NULL. If the background control |
|
2262 |
* context has never been set by API, then this returns the control context |
|
2263 |
* (if one exists) that the object obtains from Object Provider. |
|
2264 |
* |
|
2265 |
* @return Pointer to control context potentially in |
|
2266 |
* use, or NULL. |
|
2267 |
*/ |
|
2268 |
MAknsControlContext* SkinBackgroundControlContext() const; |
|
2269 |
||
2270 |
/** |
|
2271 |
* Access to disposition of the editor to perform Skinning. This does not |
|
2272 |
* take into account whether the application is skin enabled or whether the |
|
2273 |
* environment is providing a background control context. It is only a |
|
2274 |
* function of whether editor's (default) disposition to skin has been |
|
2275 |
* countered by calls on the editor API. |
|
2276 |
* |
|
2277 |
* @return @c EFalse if SetSkinBackgroundControlContextL has been |
|
2278 |
* called with NULL in its most recent call. |
|
2279 |
*/ |
|
2280 |
TBool SkinEnabled() const; |
|
2281 |
||
2282 |
/** |
|
2283 |
* Stores the alignment value for an editor. |
|
2284 |
* |
|
2285 |
* @param aAlignment Editor alignment to be stored - must be supplied as |
|
2286 |
* one of the values in Avkon editor alignment enum i.e.: |
|
2287 |
* EAknEditorAlignCenter, |
|
2288 |
* EAknEditorAlignLeft, |
|
2289 |
* EAknEditorAlignRight, |
|
2290 |
* EAknEditorAlignBidi |
|
2291 |
*/ |
|
2292 |
IMPORT_C void SetAlignment(TInt aAlignment); |
|
2293 |
||
2294 |
public: // Pictograph support |
|
2295 |
||
2296 |
/** |
|
2297 |
* Redraws text view. Used for pictograph animations. |
|
2298 |
*/ |
|
2299 |
void DrawTextView() const; |
|
2300 |
||
2301 |
/** |
|
2302 |
* Sets the callback, which the editor calls after having redrawn itself |
|
2303 |
* for animated pictographs. @c CEikCaptionedControl uses it to draw the |
|
2304 |
* highlight frame on top of the editor. |
|
2305 |
* |
|
2306 |
* @since S60 2.6 |
|
2307 |
* @param aCallBack The callback. |
|
2308 |
*/ |
|
2309 |
IMPORT_C void SetPictographAnimationCallBack( TCallBack& aCallBack ); |
|
2310 |
||
2311 |
/** |
|
2312 |
* Returns pictograph animation callback. If it is not set, the function |
|
2313 |
* pointer is NULL. |
|
2314 |
* |
|
2315 |
* @return Pictograph animation callback |
|
2316 |
*/ |
|
2317 |
const TCallBack& PictographAnimationCallBack() const; |
|
2318 |
||
2319 |
/** |
|
2320 |
* This method sets the upper limit of full document formatting. |
|
2321 |
* |
|
2322 |
* At construction, the mode is full document formatting, where the text |
|
2323 |
* formatter processes the whole document to determine its layout. |
|
2324 |
* |
|
2325 |
* When the text content is set, or when user input causes the length of |
|
2326 |
* text to exceed this value, the formatting mode switches to "Band" |
|
2327 |
* formatting, where the text formatter attempts to format as little as |
|
2328 |
* possible - optimally just the visible screen. |
|
2329 |
* |
|
2330 |
* A lower limit is calculated from the passed-in value, by the subtraction |
|
2331 |
* of a constant. When the text becomes smaller than this lower limit, the |
|
2332 |
* formatting switches to full document formatting. |
|
2333 |
* |
|
2334 |
* Internally-imposed limits prevent the client setting too small a value |
|
2335 |
* for proper operation of the text formatting. |
|
2336 |
* |
|
2337 |
* If this method is not called, the upper and lower limts are set to a |
|
2338 |
* large default values. |
|
2339 |
* |
|
2340 |
* Access to the actual limits is available via the methods |
|
2341 |
* @c UpperFullFormattingLength() and @c LowerPartialFormattingLength(). |
|
2342 |
* |
|
2343 |
* @since 3.0 |
|
2344 |
* @param aUpperFullFormattingLimit The upper limit of full document |
|
2345 |
* formatting. |
|
2346 |
*/ |
|
2347 |
IMPORT_C void SetUpperFullFormattingLength( TInt aUpperFullFormattingLimit ); |
|
2348 |
||
2349 |
/** |
|
2350 |
* Can be called to inhibit redrawing of the editor when NotifyNewFormatL() |
|
2351 |
* is called. |
|
2352 |
* |
|
2353 |
* @param aEnabled If ETrue, inhibit redrawing when notified of |
|
2354 |
* new format from now on. |
|
2355 |
*/ |
|
2356 |
IMPORT_C void SetSuppressNotifyDraw( TBool aEnabled ); |
|
2357 |
||
2358 |
/** |
|
2359 |
* Can be called to inhibit formatting of the editor. Care is required to ensure that |
|
2360 |
* the necessary reformatting is carried out later on if this API is used. |
|
2361 |
* |
|
2362 |
* Note: When called with EFalse, it does not automatically trigger reformatting. |
|
2363 |
* |
|
2364 |
* @since 3.1 |
|
2365 |
* @param aSuppressed If ETrue, inhibit formatting from now on, if EFalse, |
|
2366 |
* re-enable formatting from now on. |
|
2367 |
*/ |
|
2368 |
IMPORT_C void SetSuppressFormatting( TBool aSuppressed ); |
|
2369 |
||
2370 |
/** |
|
2371 |
* Enables kinetic scrolling in editor. |
|
2372 |
* |
|
2373 |
* Note that when kinetic scrolling is enabled, it is |
|
2374 |
* no longer possible to disable it with this function. |
|
2375 |
* |
|
2376 |
* @since S60 v5.2 |
|
2377 |
* @param aEnable ETrue if kinetic scrolling should be enabled. |
|
2378 |
*/ |
|
2379 |
IMPORT_C void EnableKineticScrollingL( TBool aEnable ); |
|
2380 |
||
2381 |
/** |
|
2382 |
* Enables kinetic scrolling in editor with external CAknPhysics instance. |
|
2383 |
* |
|
2384 |
* Note that when kinetic scrolling is enabled, it is |
|
2385 |
* no longer possible to disable it with this function. |
|
2386 |
* |
|
2387 |
* @since S60 v5.2 |
|
2388 |
* @param aPhysics Pointer to external CAknPhysics instance. |
|
2389 |
*/ |
|
2390 |
IMPORT_C void EnableKineticScrollingL( CAknPhysics* aPhysics ); |
|
2391 |
||
2392 |
public: |
|
2393 |
void EnableSmileySupportL( TBool aEnableSmiley ); |
|
2394 |
TBool IsSmileyEnabled() const; |
|
2395 |
void DrawSmileyInTextL( RRegion& rgn, const TRect& aDrawRect, |
|
2396 |
CBitmapContext& aGc, CFont& aFont, const TDesC& aText, const TPoint& aPt ); |
|
2397 |
void ConvertVisibleTextForSmileyL( TBool aTextToCode ); |
|
2398 |
TBool AdjustCursorForSmileyL( TInt aOldCursor, TCursorSelection& aSelect ); |
|
2399 |
TRect AdjustDrawRectForSmiley( const TRect& aRect ) const; |
|
2400 |
HBufC* ExtractTextLC( TCursorSelection aSelect ); |
|
2401 |
void ConvertSmileyIconToTextL( TInt aStartPos, TDes& aText ); |
|
2402 |
||
2403 |
private: |
|
2404 |
void ConvertTextForSmileyL( TCursorSelection aSelect, |
|
2405 |
TBool aTextToCode, TBool aRedraw = ETrue ); |
|
2406 |
void TrimText( TDes& aText ); |
|
2407 |
TCursorSelection GetVisibleTextRangeL(); |
|
2408 |
void ExtendedRangeForSmiley( TCursorSelection& aSelect ); |
|
2409 |
TBool ConvertSmileyForDeleteL( TInt aDocPos, TBool aBackSpace ); |
|
2410 |
void ConvertSmileyForDeleteL( const TCursorSelection &aSelect ); |
|
2411 |
TBool AdjustCursorPosByMovementL( TCursorPosition::TMovementType aMovement, |
|
2412 |
TBool aSelect ); |
|
2413 |
void HandleSelectionForSmiley( TCursorSelection aSelect ); |
|
59
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2414 |
|
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2415 |
/** |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2416 |
* 1,If the editor is read only or it is display only "tap to write" is disabled |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2417 |
* 2,If iEdwinExtension->iT2WBuf is NULL, "tap to write" is disabled. |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2418 |
* 3,If Qwerty key borad is opened, "tap to write" is disabled |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2419 |
* 4,If focus off, "tap to write" is disabled |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2420 |
* 5,If split input is enabled, "tap to write" is disabled |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2421 |
*/ |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2422 |
TBool IsT2WEnabled() const; |
56 | 2423 |
protected: |
2424 |
||
2425 |
/** |
|
2426 |
* Specifies the end points of the editable area. |
|
2427 |
*/ |
|
2428 |
enum TEnd |
|
2429 |
{ |
|
2430 |
/** The start of the editable area. */ |
|
2431 |
EStart, |
|
2432 |
||
2433 |
/** The end of the editable area. */ |
|
2434 |
EEnd |
|
2435 |
}; |
|
2436 |
||
2437 |
/** |
|
2438 |
* Specifies the chunk size as either a word, or a paragraph. |
|
2439 |
*/ |
|
2440 |
enum TChunkSize |
|
2441 |
{ |
|
2442 |
/** A word. */ |
|
2443 |
EChunkWord, |
|
2444 |
||
2445 |
/** A paragraph. */ |
|
2446 |
EChunkPara |
|
2447 |
}; |
|
2448 |
||
2449 |
/** |
|
2450 |
* Specifies the chunk size as either a word, or a paragraph. |
|
2451 |
*/ |
|
2452 |
enum TEikEdwinFlags // Internal flags |
|
2453 |
{ |
|
2454 |
/** Rich text editor used. */ |
|
2455 |
ERichText =0x00000001, |
|
2456 |
||
2457 |
/** For double item dragging. */ |
|
2458 |
EDragDouble =0x00000002, |
|
2459 |
||
2460 |
/** |
|
2461 |
* If set, indicates the pointer being pressed inside the |
|
2462 |
* editor rectangle. |
|
2463 |
*/ |
|
2464 |
ELeftDownInViewRect =0x00000004, |
|
2465 |
||
2466 |
/** Used to calculate initial width. */ |
|
2467 |
ENumericCharacters =0x00000008, |
|
2468 |
||
2469 |
/** Edwin has one line and is not resizable. */ |
|
2470 |
EHasOneLineOnly =0x00000010, |
|
2471 |
||
2472 |
/** |
|
2473 |
* Custom formatter is installed to find and format phone numbers |
|
2474 |
* (@c CEikRichTextEditor only). |
|
2475 |
*/ |
|
2476 |
EPhoneNumberGrouping = 0x00000020, |
|
2477 |
ESuppressNotifyDraw = 0x00000040, |
|
2478 |
ESuppressFormatting = 0x00000080, // Suppresses calls to formatting |
|
2479 |
ESkipBackgroundDrawer = 0x00000100 |
|
2480 |
/* NOTE : If you want to add new flags here please be carefull. There are other |
|
2481 |
flags are defined as |
|
2482 |
enum |
|
2483 |
{ // internal flags |
|
2484 |
EWysiwygOn = 0x00000200, |
|
2485 |
EUnderOneScreenFormattedText = 0x00000400, |
|
2486 |
EPictureDelimits = 0x00000800, |
|
2487 |
EPunctuationDelimits = 0x00001000, |
|
2488 |
EPasteFromIrStore = 0x00002000, |
|
2489 |
ELockScrollBarState = 0x00004000, |
|
2490 |
EOnReformatting = 0x00008000 |
|
2491 |
}; |
|
2492 |
*/ |
|
2493 |
}; |
|
2494 |
||
2495 |
protected: // from MEditObserver |
|
2496 |
||
2497 |
/** |
|
2498 |
* From @c MEditObserver. |
|
2499 |
* |
|
2500 |
* Observer function called by the @c CRichText object when the object is |
|
2501 |
* edited to give notification of changes to its text buffer. In this way, |
|
2502 |
* the control knows how the text object has changed and can reformat and |
|
2503 |
* redraw the text object appropriately. |
|
2504 |
* |
|
2505 |
* @param aStartEdit The start position of the edit. |
|
2506 |
* @param aEditLength The number of characters added or, if negative, |
|
2507 |
* deleted after this position. |
|
2508 |
*/ |
|
2509 |
IMPORT_C void EditObserver(TInt aStartEdit,TInt aEditLength); |
|
2510 |
||
2511 |
protected: |
|
2512 |
||
2513 |
/** |
|
2514 |
* Draws the visible text and the cursor for DrawL(), but does not draw |
|
2515 |
* the border. The @c DrawL() function is trapped to handle problems due |
|
2516 |
* to insufficient resources being available. |
|
2517 |
* |
|
2518 |
* @param aRect Rectangle in which to draw. |
|
2519 |
*/ |
|
2520 |
IMPORT_C void TrappedDraw(const TRect& aRect) const; |
|
2521 |
||
2522 |
/** |
|
2523 |
* Draws the visible text and the cursor. |
|
2524 |
*/ |
|
2525 |
IMPORT_C void DrawContents(); |
|
2526 |
||
2527 |
/** |
|
2528 |
* Completes the second-phase construction of a @c CEikEdwin object. This |
|
2529 |
* protected function is called by @c ConstructL() and |
|
2530 |
* @c ConstructFromResourceL() after the Edwin’s size, flags and text |
|
2531 |
* limit have been set. Derived classes should call either this function |
|
2532 |
* or @c CEikEdwin’s @c ConstructL() or @c ConstructFromResourceL() |
|
2533 |
* functions during their construction before initialising their own |
|
2534 |
* members. |
|
2535 |
*/ |
|
2536 |
IMPORT_C void BaseConstructL(); |
|
2537 |
||
2538 |
/** |
|
2539 |
* Formats all the text in the text view. Called by several functions, for |
|
2540 |
* example by @c CEikEdwin::HandleTextChangedL() and |
|
2541 |
* @c CEikEdwin::SetTextL(). |
|
2542 |
*/ |
|
2543 |
IMPORT_C void FormatTextL(); |
|
2544 |
||
2545 |
/** |
|
2546 |
* Deletes the text under the cursor selection, also cancelling the |
|
2547 |
* selection. This function asks the user to confirm this action if |
|
2548 |
* aPromptConfirmation is ETrue. |
|
2549 |
* |
|
2550 |
* @param[out] aChanged On return, @c ETrue if the text was changed. |
|
2551 |
* @param[in] aIsBackSpace ETrue if this is in response to backspace being |
|
2552 |
* pressed. Determines whether character formatting is preserved |
|
2553 |
* or not. Default value is @c EFalse. |
|
2554 |
* @param[in] aPromptConfirmation Optional. @c ETrue to ask the user to |
|
2555 |
* confirm this action. Default value is @c ETrue. |
|
2556 |
* @return The cursor position in the text after deletion. |
|
2557 |
*/ |
|
2558 |
IMPORT_C TInt DeleteHighlightL(TBool& aChanged, |
|
2559 |
TBool aIsBackSpace=EFalse, |
|
2560 |
TBool aPromptConfirmation=ETrue); |
|
2561 |
||
2562 |
/** |
|
2563 |
* Confirms whether the deletion of the user’s selection is required. |
|
2564 |
* |
|
2565 |
* If the user’s selection is less than @c KBlockDeleteWarningSize and does |
|
2566 |
* not contain a picture, this function returns @c ETrue. |
|
2567 |
* |
|
2568 |
* If the user’s selection is greater than @c KBlockDeleteWarningSize or |
|
2569 |
* contains a picture, this function asks the user to confirm deletion of |
|
2570 |
* their selection and then returns the user’s response. |
|
2571 |
* |
|
2572 |
* @return @c ETrue. |
|
2573 |
*/ |
|
2574 |
IMPORT_C TBool OkToDeleteSelectionL(); |
|
2575 |
||
2576 |
/** |
|
2577 |
* Deletes the cursor’s selection. If no selection is made, this function |
|
2578 |
* deletes only one character. The argument @c aIsBackSpace determines |
|
2579 |
* whether to preserve the character formatting or not. |
|
2580 |
* |
|
2581 |
* @param[out] aChanged On return, @c ETrue if the text was changed. |
|
2582 |
* @param[in] aSelection The cursor selection describing the position to be |
|
2583 |
* deleted. |
|
2584 |
* @param[in] aIsBackSpace @c ETrue if this in response to backspace being |
|
2585 |
* pressed. Determines whether character formatting is preserved |
|
2586 |
* or not. |
|
2587 |
* @param[in] aAllowUndo @c ETrue if the user is permitted to undo this |
|
2588 |
* change. |
|
2589 |
*/ |
|
2590 |
IMPORT_C void DeleteL(TBool& aChanged, |
|
2591 |
const TCursorSelection& aSelection, |
|
2592 |
TBool aIsBackSpace=EFalse, |
|
2593 |
TBool aAllowUndo=ETrue); |
|
2594 |
||
2595 |
/** |
|
2596 |
* Handles errors that occur when handling a change in Edwin’s size. Calls |
|
2597 |
* @c CEikonEnv::NotifyIdleErrorWhileRedrawing(). |
|
2598 |
*/ |
|
2599 |
IMPORT_C void TrappedSizeChanged(); |
|
2600 |
||
2601 |
/** |
|
2602 |
* Handles a change in Edwin’s size. This function accounts for text wrap |
|
2603 |
* settings and whether the Edwin is ready to be redrawn and also calls |
|
2604 |
* functions to reformat text and to update the Edwin’s scroll bars. |
|
2605 |
*/ |
|
2606 |
IMPORT_C void HandleSizeChangedL(); |
|
2607 |
||
2608 |
/** |
|
2609 |
* Cancels the selection and any FEP composition text. This function then |
|
2610 |
* repositions the cursor at the specified end of the currently selected |
|
2611 |
* text. |
|
2612 |
* |
|
2613 |
* @param aEndOfSelectionToLeaveCursor The end of the current selection at |
|
2614 |
* which the cursor is repositioned. |
|
2615 |
*/ |
|
2616 |
IMPORT_C void CancelSelectionL(TEnd aEndOfSelectionToLeaveCursor); |
|
2617 |
||
2618 |
/** |
|
2619 |
* Moves the cursor to the beginning of the next word or paragraph. This |
|
2620 |
* function cancels any front end processing transaction currently in |
|
2621 |
* progress for the Edwin. |
|
2622 |
* |
|
2623 |
* @param aSelect If @c ETrue the chunk is selected, otherwise @c EFalse. |
|
2624 |
* @param aChunkSize The chunk size, this can be either a word or a |
|
2625 |
* paragraph. See @c TChunkSize enum. |
|
2626 |
* @param aEndScanningTowards Which direction to scan towards, the start |
|
2627 |
* or the end of the document. |
|
2628 |
*/ |
|
2629 |
IMPORT_C void MoveCursorToChunkStartL(TBool aSelect, |
|
2630 |
TChunkSize aChunkSize, |
|
2631 |
TEnd aEndScanningTowards); |
|
2632 |
||
2633 |
/** |
|
2634 |
* Cancels the insertion of a character format. This can be used for rich |
|
2635 |
* text only. |
|
2636 |
*/ |
|
2637 |
IMPORT_C void CancelInsertCharFormat(); |
|
2638 |
||
2639 |
/** |
|
2640 |
* Copies the contents of the cursor selection onto the clipboard. |
|
2641 |
*/ |
|
2642 |
IMPORT_C void PlaceDataOnClipboardL(); |
|
2643 |
||
2644 |
/** |
|
2645 |
* Reports an Edwin event of the specified type. The Edwin event is passed |
|
2646 |
* first to the Edwin observer and then to the list of observers, even if |
|
2647 |
* the first Edwin observer is not set. If the Edwin has a custom drawer, |
|
2648 |
* and the event is of type @c EEventFormatChanged, the event is passed to |
|
2649 |
* the custom drawer. If the Edwin has an observer the event is passed to |
|
2650 |
* that observer. If no observer is set for the Edwin, this function passes |
|
2651 |
* the event to each observer in the observer list. |
|
2652 |
* |
|
2653 |
* @param aEventType The type of event to report. |
|
2654 |
*/ |
|
2655 |
IMPORT_C void ReportEdwinEventL(MEikEdwinObserver::TEdwinEvent aEventType); |
|
2656 |
||
2657 |
/** |
|
2658 |
* Sets margin widths and line cursor width. |
|
2659 |
*/ |
|
2660 |
IMPORT_C void SetLineCursorDetailsL(); |
|
2661 |
||
2662 |
/** |
|
2663 |
* Replaces the current Edwin text. |
|
2664 |
* |
|
2665 |
* @param aInText Text with which the current text is replaced. |
|
2666 |
* @param aOutText On return, the replaced text. |
|
2667 |
*/ |
|
2668 |
IMPORT_C virtual void CopyDocumentContentL(CGlobalText& aInText, |
|
2669 |
CGlobalText& aOutText); |
|
2670 |
||
2671 |
/** |
|
2672 |
* Displays an information message to indicate that the specified text |
|
2673 |
* could not be found. The information message is constructed from |
|
2674 |
* @c R_EIK_TBUF_CANNOT_FIND_TEXT. |
|
2675 |
* |
|
2676 |
* @param aFindText The text that could not be found. |
|
2677 |
*/ |
|
2678 |
IMPORT_C void DisplayFindTextNotFound(TDes& aFindText); |
|
2679 |
||
2680 |
/** |
|
2681 |
* Not implemented. |
|
2682 |
* |
|
2683 |
* @param aStartPos Not used. |
|
2684 |
* @param aLength Not used. |
|
2685 |
*/ |
|
2686 |
IMPORT_C virtual void HandleTextPastedL(TInt aStartPos,TInt& aLength); |
|
2687 |
||
2688 |
/** |
|
2689 |
* Creates a new @c CLafEdwinCustomDrawBase instance. |
|
2690 |
* |
|
2691 |
* @return Pointer to new custom @c CLafEdwinCustomDrawBase object. |
|
2692 |
*/ |
|
2693 |
IMPORT_C virtual CLafEdwinCustomDrawBase* CreateCustomDrawL(); |
|
2694 |
||
2695 |
// Avkon editor extensions |
|
2696 |
/** |
|
2697 |
* Used in @c ConstructFromResourceL(). Sets Avkon editor properties. |
|
2698 |
* |
|
2699 |
* @param aReader A reader positioned for reading from an EDWIN resource. |
|
2700 |
*/ |
|
2701 |
IMPORT_C void ReadAknResourceL(TResourceReader& aReader); |
|
2702 |
||
2703 |
protected: // Internal to Symbian |
|
2704 |
||
2705 |
/** |
|
2706 |
* Creates new text layout. |
|
2707 |
* |
|
2708 |
* @param aLayDoc Pointer to the @c MLayDoc implementation that is the |
|
2709 |
* source of the text and formatting information. |
|
2710 |
*/ |
|
2711 |
IMPORT_C void CreateLayoutL(MLayDoc* aLayDoc); |
|
2712 |
||
2713 |
/** |
|
2714 |
* Creates new instance of @c CGlobalText and text layout based on it. |
|
2715 |
* |
|
2716 |
* @param aParaFormatLayer Paragraph format layer pointer for |
|
2717 |
* @c CGlobalText constructor. |
|
2718 |
* @param aCharFormatLayer Character format layer pointer for |
|
2719 |
* @c CGlobalText constructor. |
|
2720 |
*/ |
|
2721 |
IMPORT_C void CreateTextAndLayoutL(CParaFormatLayer* aParaFormatLayer, |
|
2722 |
CCharFormatLayer* aCharFormatLayer); |
|
2723 |
||
2724 |
/** |
|
2725 |
* Checks that is Edwin's extension created. If not, it will be created. |
|
2726 |
* |
|
2727 |
* @leave KErrNoMemory If the Edwin FEP support pointer is NULL. |
|
2728 |
*/ |
|
2729 |
IMPORT_C void CheckEdwinExtensionL(); |
|
2730 |
||
2731 |
/** |
|
2732 |
* Gets Edwin's extension. |
|
2733 |
* |
|
2734 |
* @return Pointer to Edwin's extension. |
|
2735 |
*/ |
|
2736 |
IMPORT_C CEikEdwinExtension* EdwinExtension(); |
|
2737 |
private: |
|
2738 |
// NOTE : the follow enume and the enum TEikEdwinFlags are both used for iEdwinInternalFlags |
|
2739 |
// it is very easy to conflict !!! So if you want add new flag please check if it has been |
|
2740 |
// declared in enum TEikEdwinFlags |
|
2741 |
enum |
|
2742 |
{ // internal flags |
|
2743 |
EWysiwygOn = 0x00000200, |
|
2744 |
EUnderOneScreenFormattedText = 0x00000400, |
|
2745 |
EPictureDelimits = 0x00000800, |
|
2746 |
EPunctuationDelimits = 0x00001000, |
|
2747 |
EPasteFromIrStore = 0x00002000, |
|
2748 |
ELockScrollBarState = 0x00004000, |
|
2749 |
EOnReformatting = 0x00008000 |
|
2750 |
}; |
|
2751 |
||
2752 |
private: // from CCoeControl |
|
2753 |
||
2754 |
IMPORT_C void SizeChanged(); |
|
2755 |
IMPORT_C TInt CountComponentControls() const; |
|
2756 |
IMPORT_C CCoeControl* ComponentControl(TInt aIndex) const; |
|
2757 |
IMPORT_C void Reserved_2(); |
|
2758 |
||
2759 |
private: |
|
2760 |
||
2761 |
IMPORT_C virtual void Reserved_3(); |
|
2762 |
IMPORT_C virtual void NotifyInvalidOperationOnReadOnlyL(); |
|
2763 |
IMPORT_C CEikScrollBarFrame* CreateScrollBarFrameL(TBool aPreAlloc); |
|
2764 |
void SetVirtualCursorStateL(TBool aIsFocused) const; |
|
2765 |
void SetHeightForNumOfLinesL(); |
|
2766 |
void ApplyAutoSelectionL(); |
|
2767 |
void SetScrollBarsL(); |
|
2768 |
void SetVertScrollBarModelByCharactersL(TEikScrollBarModel& aVertModel) const; |
|
2769 |
void RetrieveDataFromClipboardL(); |
|
2770 |
void SetCursorVisibilityL(TBool aEmphasis); |
|
2771 |
TBool OwnsScrollBars() const; |
|
2772 |
void CreateScrollBarFrameLayout(TEikScrollBarFrameLayout& aLayout) const; |
|
2773 |
void UpdateHorizScrollBarThumb(); |
|
2774 |
void UpdateVertScrollBarThumbL(); |
|
2775 |
void DoSetUndoBufferL(const TCursorSelection& aSelection); |
|
2776 |
void DoPasteFromStoreL(const CStreamStore& aStore,const CStreamDictionary& aDict); |
|
2777 |
void DoReplaceAllL(SEdwinFindModel* aModel,TBool& aTextFound,TBool& aReplaced); |
|
2778 |
void DeleteExtraParasL(TInt aStartPos,TInt aLength); |
|
2779 |
TInt LocateChar(TChar aChar,TInt aStartPos,TInt aLength); |
|
2780 |
TBool IsValidChar(TInt aChar) const; |
|
2781 |
TInt CalcMinimumHeightFromNumOfLinesL() const; |
|
2782 |
void CheckEdwinHeight(); |
|
2783 |
TBool IsNewHeightWithinMinimumAndMaximum(TInt aNewHeight) const; |
|
2784 |
void SetEdwinHeight(TInt aHeight); |
|
2785 |
void DoCreateCustomDrawL(); |
|
2786 |
void SetCursorSizeAndType(); |
|
2787 |
TKeyResponse DoOfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
2788 |
void DoCcpuCanPasteL() const; |
|
2789 |
void DoReportEventL(MCoeControlObserver::TCoeEvent aEvent); |
|
2790 |
void CheckIfEdwinIsResizable(); |
|
2791 |
void SetKeyboardRepeatRate(TTimeIntervalMicroSeconds32 aKeyRepeatRate) const; |
|
2792 |
HBufC* GetAllowedCharsLC() const; |
|
2793 |
TInt CheckAllowedCharsL(const TDesC& aChars, CClipboard& aClipboard, TBool aRichText) const; |
|
2794 |
||
2795 |
TInt CursorWidth() const; |
|
2796 |
TFontSpec CursorFontSpec() const; |
|
2797 |
||
2798 |
void BuildEdwinFepSupport(); |
|
2799 |
void MakeCharFormatLayerMatchL(CCharFormatLayer* aCharFormatLayer); |
|
2800 |
void MakeParaFormatLayerMatchL(CParaFormatLayer* aParaFormatLayer); |
|
2801 |
void UpdateCache(TInt aId); |
|
2802 |
void DrawBackgroundAroundTextView( |
|
2803 |
CWindowGc& gc, |
|
2804 |
const TRect& aOuterRect, |
|
2805 |
const TRect& aInnerRect, |
|
2806 |
const TRgb& aBackgroundColor ) const; |
|
2807 |
TInt CurrentAlignment() const; |
|
2808 |
void DoAlignment(); |
|
2809 |
void NewParagraphL(); |
|
2810 |
TKeyResponse ScrollReadOnlyNoCursorDisplayL(TUint aKeyCode); |
|
2811 |
void ReplaceParaDelimitersL( TInt aStartPos, TInt aLength ); |
|
2812 |
TRect AdjustedViewRect() const; |
|
2813 |
void SetVKBStatus(); |
|
2814 |
void ScrollViewToCursorLineL(); |
|
59
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2815 |
|
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2816 |
/** |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2817 |
* Scrolls view so that cursor is visible. |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2818 |
*/ |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2819 |
void MoveViewToCursorLineL(); |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2820 |
|
56 | 2821 |
void PerformRecordedOperationL(); |
2822 |
void ScrollIfAtTopOrBottomL(); |
|
2823 |
void SetSelectionVisibilityL( TBool aIsVisable ); |
|
2824 |
||
2825 |
/** |
|
2826 |
* Sets scrollbars with kinetic scrolling. |
|
2827 |
*/ |
|
2828 |
void SetKineticScrollingScrollBarsL(); |
|
2829 |
||
2830 |
/** |
|
2831 |
* Sets vertical scrollbar model with kinetic scrolling. |
|
2832 |
* |
|
2833 |
* @param aVertModel Vertical scrollbar model |
|
2834 |
*/ |
|
2835 |
void SetKineticScrollingScrollBarModel( |
|
2836 |
TEikScrollBarModel& aVertModel ) const; |
|
2837 |
||
2838 |
/** |
|
2839 |
* Enables rate scrolling in editor. |
|
2840 |
* |
|
2841 |
* @param aEnable ETrue if rate scrolling should be enabled. |
|
2842 |
*/ |
|
2843 |
void EnableRateScrolling( TBool aEnable ); |
|
2844 |
||
2845 |
private: |
|
2846 |
||
2847 |
void DrawFirstLineTextL() const; |
|
59
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2848 |
|
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2849 |
/** |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2850 |
* Draws "Tap to write" text to help user to navigate to virtual input |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2851 |
* This text is drawn when the text length of the editor field is zero |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2852 |
* |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2853 |
* @param none |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2854 |
* @return none |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2855 |
*/ |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2856 |
void DrawT2WTextL() const; |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2857 |
|
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2858 |
/** |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2859 |
* Draws "Tap to write" text if text length is zero |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2860 |
* |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2861 |
* @param aClean. When aClean is set to ETrue and the codition of "tap to write" is False, |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2862 |
* The editor will be redraw and "tap to write" will be clean. |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2863 |
* @return none |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2864 |
*/ |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2865 |
void TryToDrawT2W( TBool aClean = EFalse ); |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2866 |
|
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2867 |
/** |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2868 |
* Get the align of the first line text |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2869 |
* |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2870 |
* @param none |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2871 |
* @return text align for first line text |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2872 |
*/ |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2873 |
CGraphicsContext::TTextAlign AlignForFirstLineText( const TPtr & aReorderedTextPtr ) const; |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2874 |
|
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2875 |
/** |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2876 |
* Get the rect of the first line text |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2877 |
* |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2878 |
* @param none |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2879 |
* @return rect of the first line |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2880 |
*/ |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2881 |
TRect RectForFirstLineText() const; |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
2882 |
|
56 | 2883 |
CAknEdwinDrawingModifier* AknEdwinDrawingModifier(); |
2884 |
TBool EditorSupportsNeutralProtection() const; |
|
2885 |
||
2886 |
/** |
|
2887 |
* Main routine for neutral protection. This routine returns a boolean stating if there is a |
|
2888 |
* requirement for protection, but also returns the text that should replace the to-be-deleted text. |
|
2889 |
* |
|
2890 |
* @param aPosOfLosEndOfDelete index of the first character deleted |
|
2891 |
* @param aLengthToDelete length the text to be deleted |
|
2892 |
* @param aNewText neutral protection characters to replace the delete |
|
2893 |
* @param aForwardProtectionNeeded EFalse if only reverse protection needed; data valid only if |
|
2894 |
* method does not return EFalse. |
|
2895 |
* @return EFalse iff no deletion is to be performed |
|
2896 |
*/ |
|
2897 |
TBool NeedsNeutralProtection( TInt aPosOfLowEndOfDelete, TInt aLengthToDelete, TDes& aNewText, TBool& aForwardProtectionNeeded ); |
|
2898 |
||
2899 |
/** |
|
2900 |
* Returns whether the character is strongly directional |
|
2901 |
* |
|
2902 |
* @param aChar character to be examined |
|
2903 |
* @param aRightToLeft This is valid upon return only if EFalse is not returned. |
|
2904 |
* Value is EFalse if the strong directionality is Left-to-right |
|
2905 |
* @return EFalse if the character is not strongly directional. |
|
2906 |
*/ |
|
2907 |
TBool GetStrongDirectionality(TChar aChar, TBool& aRightToLeft ) const; |
|
2908 |
||
2909 |
/** |
|
2910 |
* Returns ETrue if the character at aPos is neutral |
|
2911 |
* |
|
2912 |
* @param aPos index in editor; must be a valid index |
|
2913 |
* @return EFalse iff the character is not neutral |
|
2914 |
*/ |
|
2915 |
TBool CharIsNeutral( TInt aPos ) const; |
|
2916 |
||
2917 |
/** |
|
2918 |
* Looks through the passed descriptor, looking for a strongly directional character. |
|
2919 |
* Direction of search can be set. Search starts at the begining if searching forward; |
|
2920 |
* starts at the end if searching backwards. |
|
2921 |
* |
|
2922 |
* Search is carried out until a strong character is found or the end (or beginning) |
|
2923 |
* of the descriptor has been reached. |
|
2924 |
* |
|
2925 |
* @param aText Descriptor to search. |
|
2926 |
* @param aForward If EFalse, then search is backward (decreasing index) in logical buffer |
|
2927 |
* @param aIsRightToLeft Set to ETrue on return if first strong character found is RTL |
|
2928 |
* |
|
2929 |
* @return EFalse if no strong character was found. |
|
2930 |
*/ |
|
2931 |
TBool GetExposedDirectionOfTextInDescriptor( const TDesC& aText, TBool aForward, TBool& aIsRightToLeft ) const; |
|
2932 |
||
2933 |
/** |
|
2934 |
* Looks through the editor's text starting at character aPos, looking for a |
|
2935 |
* strongly directional character. Direction of search can be set. |
|
2936 |
* Search is carried out until a strong character is found or the end (or beginning) |
|
2937 |
* of the editor text has been reached. |
|
2938 |
* |
|
2939 |
* @param aPos First character to look at |
|
2940 |
* @param aForward If EFalse, then search is backward (decreasing index) in logical buffer |
|
2941 |
* @param aIsRightToLeft Set to ETrue on return if first strong character found is RTL |
|
2942 |
* |
|
2943 |
* @return EFalse if no strong character was found. |
|
2944 |
*/ |
|
2945 |
TBool GetExposedDirectionOfText( TInt aPos, TBool aForward, TBool& aIsRightToLeft ) const; |
|
2946 |
||
2947 |
/** |
|
2948 |
* Routine to perform the operation of replacing a selection with new text. |
|
2949 |
* This is intended for internal use. |
|
2950 |
* |
|
2951 |
* The current selection, if non-zero length is deleted, and replace with aNewText if non-zero length |
|
2952 |
* iTextView must be set. |
|
2953 |
* |
|
2954 |
* @param aNewText Replacement text. May be zero length. |
|
2955 |
* @param aCursorPosInNewText This is the position, relative to the beginning of the newtext, |
|
2956 |
* that you want the cursor to be at when the operation is complete |
|
2957 |
* @param aFormatHasChanged Set this to ETrue if you want the reformatting to start at |
|
2958 |
* the beginning of the paragraph. EFalse if just to reformat the line. |
|
2959 |
* This variable may also be set by the call to DeleteHighlight that this |
|
2960 |
* code executes, so it may be set to ETrue upon return, even if EFalse was |
|
2961 |
* passed. |
|
2962 |
*/ |
|
2963 |
void ReplaceSelectionWithTextL( const TDesC& aNewText, |
|
2964 |
TInt aCursorPosInNewText, |
|
2965 |
TBool& aFormatHasChanged ); |
|
2966 |
||
2967 |
/** |
|
2968 |
* Returns EFalse iff ( phone number had only numeric input modes AND the keymap is a phone number |
|
2969 |
* type keymap ). |
|
2970 |
* Phone number type keymaps are: |
|
2971 |
* EAknEditorStandardNumberModeKeymap |
|
2972 |
* EAknEditorFixedDiallingNumberModeKeymap |
|
2973 |
* |
|
2974 |
* @return EFalse if the phone number will only contain a pure phone number |
|
2975 |
*/ |
|
2976 |
TBool IsPurePhoneNumberEditor() const; |
|
2977 |
||
2978 |
/** |
|
2979 |
* Standard check on upper and lower formatting thresholds versus current textview formatting mode. |
|
2980 |
* |
|
2981 |
* @return EFalse iff the formatting mode does not need changing |
|
2982 |
*/ |
|
2983 |
TBool NeedToChangeFormattingModeL() const; |
|
2984 |
||
2985 |
/** |
|
2986 |
* When Band formatting is started, this should be called to update the cached |
|
2987 |
* metrics used for the scroll bar calculations. |
|
2988 |
*/ |
|
2989 |
void CalculateLineMetricsForBandFormattingL(); |
|
2990 |
||
2991 |
/** |
|
2992 |
* check the selection content is visible character or not |
|
2993 |
*/ |
|
2994 |
TBool IsSelectionVisible(); |
|
2995 |
||
2996 |
||
2997 |
protected: // from MObjectProvider |
|
2998 |
||
2999 |
/** |
|
3000 |
* From @c MObjectProvider. |
|
3001 |
* |
|
3002 |
* Retrieves an object of the same type as that encapsulated in @c aId. |
|
3003 |
* |
|
3004 |
* This function is used to allow controls to ask their owners for access |
|
3005 |
* to other objects that they own. |
|
3006 |
* |
|
3007 |
* Other than in the case where NULL is returned, the object returned must |
|
3008 |
* be of the same object type - that is, the @c ETypeId member of the |
|
3009 |
* object pointed to by the pointer returned by this function must be equal |
|
3010 |
* to the @c iUid member of @c aId. |
|
3011 |
* |
|
3012 |
* @param aId An encapsulated object type ID. |
|
3013 |
* @return Encapsulates the pointer to the object provided. Note that the |
|
3014 |
* encapsulated pointer may be NULL. |
|
3015 |
*/ |
|
3016 |
IMPORT_C TTypeUid::Ptr MopSupplyObject(TTypeUid aId); |
|
3017 |
||
3018 |
public: // new since 3.0 |
|
3019 |
||
3020 |
/** |
|
3021 |
* Sets skin id for text. |
|
3022 |
* |
|
3023 |
* @param aAknSkinIdForTextColor The skin id. |
|
3024 |
*/ |
|
3025 |
IMPORT_C void SetTextSkinColorIdL(TInt aAknSkinIdForTextColor); |
|
3026 |
||
3027 |
/** |
|
3028 |
* Sets highlight style. |
|
3029 |
* |
|
3030 |
* @param aStyle The highlight style. |
|
3031 |
*/ |
|
3032 |
IMPORT_C void SetHighlightStyleL(TAknsHighlightStyle aStyle); |
|
3033 |
||
3034 |
// for custom drawer, not exported |
|
3035 |
/** |
|
3036 |
* Gets skin id. |
|
3037 |
* |
|
3038 |
* @return The skin id. |
|
3039 |
*/ |
|
3040 |
TInt SkinColorId() const; |
|
3041 |
||
3042 |
/** |
|
3043 |
* Gets highlight style. |
|
3044 |
* |
|
3045 |
* @return The highlight style. |
|
3046 |
*/ |
|
3047 |
TAknsHighlightStyle HighlightStyle() const; |
|
3048 |
||
3049 |
/** |
|
3050 |
* Called to determine the background color to draw. It is not to be used if skinning is |
|
3051 |
* being used to draw the background. |
|
3052 |
* |
|
3053 |
* This API can be used two ways: |
|
3054 |
* |
|
3055 |
* i) If the caller has a default color to offer (to be used as |
|
3056 |
* a fallback if SetBackgroundColorL has not been called), then he should use the |
|
3057 |
* Input/Output parameter aConditionalColor, and ignore the return value. The output |
|
3058 |
* parameter will only be over-written by the set background color if SetBackgroundColorL |
|
3059 |
* has been called. |
|
3060 |
* |
|
3061 |
* ii) If the caller does not have a default color to offer, then he should pass in a dummy |
|
3062 |
* input parameter and use the return value. |
|
3063 |
* |
|
3064 |
* @param aConditionalColor Output parameter. Returns a color set by |
|
3065 |
* SetBackgroundColorL. It is unchanged if |
|
3066 |
* background color has not been set by SetBackgroundColorL |
|
3067 |
* @return TRgb for the color to be used for background. |
|
3068 |
*/ |
|
3069 |
TRgb EditorBackgroundColor(TRgb& aConditionalColor) const; |
|
3070 |
||
3071 |
public: |
|
3072 |
/** |
|
3073 |
* Can be used by custom drawers to check if background drawing should be |
|
3074 |
* performed. This is meant to be used only if editor has |
|
3075 |
* MCoeControlBackground object attached. |
|
3076 |
* |
|
3077 |
* @return ETrue if custom drawer shouldn't draw background. |
|
3078 |
*/ |
|
3079 |
TBool SkipBackgroundDrawer() const; |
|
3080 |
||
3081 |
/** |
|
3082 |
* Scrolls view by amount of pixels. |
|
3083 |
* Stops scrolling when beginning or end of content exceeded. |
|
3084 |
* This function should be used when scrolling starts from inside content |
|
3085 |
* (in other words in normal situation when begin- or end-border has not |
|
3086 |
* yet exceeded) |
|
3087 |
* |
|
3088 |
* @param aPixelsToScroll Amount of pixels to scroll |
|
3089 |
* @param aBorderExceeded returns ETrue if border was exceeded |
|
3090 |
* @param aRestOfPixels Amount of pixels not scrolled because border |
|
3091 |
* was exceeded |
|
3092 |
* |
|
3093 |
* @return Amount of scrolled pixels. |
|
3094 |
*/ |
|
3095 |
TInt ScrollView( TInt aPixelsToScroll, TBool& aBorderExceeded, |
|
3096 |
TInt& aRestOfPixels ); |
|
3097 |
||
3098 |
/** |
|
3099 |
* Scrolls view by amount of pixels. |
|
3100 |
* |
|
3101 |
* This function should be used to scroll when we have already |
|
3102 |
* exceeded begin- or end-border (we are out of borders). |
|
3103 |
* This function supports scrolling so that there can be empty space |
|
3104 |
* above or below the editor content (used in bounce effect). |
|
3105 |
* Stops scrolling when we return back to inside borders. |
|
3106 |
* |
|
3107 |
* @param aPixelsToScroll Amount of pixels to scroll |
|
3108 |
* @param aEndOfBounce returns ETrue if content scrolled back |
|
3109 |
* to inside of borders |
|
3110 |
* @param aRestOfPixels Amount of pixels not scrolled |
|
3111 |
* |
|
3112 |
* @return Amount of scrolled pixels. |
|
3113 |
*/ |
|
3114 |
TInt ScrollViewWithBounce( TInt aPixelsToScroll, TBool& aEndOfBounce, |
|
3115 |
TInt& aRestOfPixels ); |
|
3116 |
||
3117 |
/** |
|
3118 |
* Returns amount of pixels how much we are out of borders. |
|
3119 |
* |
|
3120 |
* @return Amount of pixels scrolled out of borders. |
|
3121 |
*/ |
|
3122 |
TInt PixelsOutOfBorder() const; |
|
3123 |
||
3124 |
/** |
|
3125 |
* Handles scrollbar events with kinetic scrolling. |
|
3126 |
* |
|
3127 |
* @param aScrollBar The scrollbar. |
|
3128 |
*/ |
|
3129 |
void HandleScrollEventWithPhysics( CEikScrollBar* aScrollBar ); |
|
3130 |
||
3131 |
/** |
|
3132 |
* If cursor is visible, disables it and stores cursor visibility info. |
|
3133 |
*/ |
|
3134 |
void StoreCursorState(); |
|
3135 |
||
3136 |
/** |
|
3137 |
* Show cursor again if needed (based on stored cursor visibility info). |
|
3138 |
*/ |
|
3139 |
void RestoreCursorState(); |
|
3140 |
||
3141 |
/** |
|
3142 |
* Returns ETrue if kinetic scrolling is enabled. |
|
3143 |
* |
|
3144 |
* @return ETrue if kinetic scrolling is enabled. |
|
3145 |
*/ |
|
3146 |
TBool KineticScrollingEnabled() const; |
|
3147 |
||
3148 |
/** |
|
3149 |
* Draws background to the whole view area. Call with parameter value ETrue |
|
3150 |
* must be followed by a call with EFalse or otherwise window's redraw |
|
3151 |
* isn't ended properly and graphics context is not deactivated. |
|
3152 |
* |
|
3153 |
* @param aStart If true then window area occupied by editor's view is |
|
3154 |
* invalidated and redraw is began. Also graphics context is |
|
3155 |
* activated. EFalse ends the redraw and deactivates graphics |
|
3156 |
* context. |
|
3157 |
*/ |
|
3158 |
void DrawViewBackground( TBool aStart ) const; |
|
3159 |
||
3160 |
/** |
|
3161 |
* Returns ETrue if editor content fits to view rect. |
|
3162 |
* |
|
3163 |
* @return ETrue if editor content fits to view rect. |
|
3164 |
*/ |
|
3165 |
TBool ContentFitsToViewRect() const; |
|
3166 |
||
59
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
3167 |
/** |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
3168 |
* Set the "Tap To Write" enable or not |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
3169 |
* There are two ways to use this API. The first way is: after construct a editor you can |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
3170 |
* call EnableT2WL( ETrue ) to enable the feature, then editor will display or hide |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
3171 |
* "tap to write" by the internal status of editor. It means that "tap to write" will |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
3172 |
* display and hide automatically as internal logical of editor. |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
3173 |
* Enable the feature: |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
3174 |
* CEikEdwin *editor = new (ELeave) CEikEdwin; |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
3175 |
* editor->ConstructL(); |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
3176 |
* editor->EnableT2WL( ETrue ); |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
3177 |
* |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
3178 |
* The second way is application can call EnableT2WL( ETrue/EFalse ) |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
3179 |
* to display or hide "tap to write" immediately according to its own logic. |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
3180 |
* Display: |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
3181 |
* editor->EnableT2WL( ETrue ); |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
3182 |
* Hide: |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
3183 |
* editor->EnableT2WL( EFalse ); |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
3184 |
* |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
3185 |
* @param ETure for enable EFalse for not disable. |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
3186 |
* @return none. |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
3187 |
*/ |
978afdc0236f
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
3188 |
IMPORT_C void EnableT2WL( TBool aEnable ); |
56 | 3189 |
protected: |
3190 |
||
3191 |
/** |
|
3192 |
* Edwin user flags. |
|
3193 |
*/ |
|
3194 |
TUint32 iEdwinUserFlags; |
|
3195 |
||
3196 |
/** |
|
3197 |
* Internal Edwin flags. |
|
3198 |
*/ |
|
3199 |
TUint32 iEdwinInternalFlags; |
|
3200 |
||
3201 |
/** |
|
3202 |
* Edwin's text content. |
|
3203 |
*/ |
|
3204 |
CPlainText* iText; |
|
3205 |
||
3206 |
protected: // Internal to Symbian |
|
3207 |
||
3208 |
/** |
|
3209 |
* Edwin's text view. |
|
3210 |
*/ |
|
3211 |
CTextView* iTextView; |
|
3212 |
||
3213 |
/** |
|
3214 |
* Edwin's text layout. |
|
3215 |
*/ |
|
3216 |
CTextLayout* iLayout; |
|
3217 |
||
3218 |
protected: |
|
3219 |
||
3220 |
/** |
|
3221 |
* Maximum length ot the edwin. |
|
3222 |
*/ |
|
3223 |
TInt iTextLimit; |
|
3224 |
||
3225 |
/** |
|
3226 |
* Number of lines in Edwin. |
|
3227 |
*/ |
|
3228 |
TInt iNumberOfLines; |
|
3229 |
||
3230 |
/** |
|
3231 |
* Current zoom factor. |
|
3232 |
*/ |
|
3233 |
MGraphicsDeviceMap* iZoomFactor; |
|
3234 |
||
3235 |
/** |
|
3236 |
* Cursor position. |
|
3237 |
*/ |
|
3238 |
TInt iLastPointerDocPos; |
|
3239 |
||
3240 |
/** |
|
3241 |
* Edwin's margins. |
|
3242 |
*/ |
|
3243 |
TMargins8 iMargins; |
|
3244 |
||
3245 |
private: |
|
3246 |
||
3247 |
friend class CEikEdwinFepSupport; |
|
3248 |
friend class CEikEdwinExtension; |
|
3249 |
// added this class to allow additional data members without breaking BC |
|
3250 |
CEikEdwinExtension* iEdwinExtension; // replaced iSetScrollBar |
|
3251 |
CEikScrollBarFrame* iSBFrame; |
|
3252 |
MEikEdwinObserver* iEdwinObserver; |
|
3253 |
CArrayPtr<MEikEdwinObserver>* iObserverArray; |
|
3254 |
CEikEdwinFepSupport* iEdwinFepSupport; |
|
3255 |
CUndoBuffer* iUndoStore; |
|
3256 |
TInt iAvgLinesInViewRect; |
|
3257 |
TInt iAvgCharsPerLine; |
|
3258 |
TInt iRightWrapGutter; |
|
3259 |
TInt iLayoutWidth; |
|
3260 |
MEikEdwinSizeObserver* iEdwinSizeObserver; |
|
3261 |
TInt iMinimumHeight; |
|
3262 |
TInt iMaximumHeight; |
|
3263 |
/* |
|
3264 |
iMaximumHeightInLines |
|
3265 |
--------------------- |
|
3266 |
This is simply a holder for the number, used to simplify some Avkon LAF requirements. |
|
3267 |
The viewable region of an edwin is actually measured in pixels, However, if certain LAF |
|
3268 |
requirements are enforced (that the view region has to be smaller than the number of |
|
3269 |
lines viewable * the baseline separation (in pixels)) some undesired scrolling effects |
|
3270 |
occur. |
|
3271 |
||
3272 |
||
3273 |
That is to say, by simply setting iMaximumHeightInLines, this will not affect |
|
3274 |
the actual maximum height of the edwin. To do this, you must set the iMaximumHeight |
|
3275 |
||
3276 |
One of the use cases of this member variable is for AknLayoutUtils::LayoutEdwin. |
|
3277 |
That method uses iMaximumHeightInLines along with the baseline separation, to set |
|
3278 |
the iMaximumHeight. |
|
3279 |
||
3280 |
The general formula is very simple, to remove unneeded scrolling. |
|
3281 |
iMaximumHeight=baselineSeparation*iMaximumNumberOfLines |
|
3282 |
||
3283 |
If you cannot allocate sufficient space to the edwin, to permit so much viewable region |
|
3284 |
then the method AlterViewRect can be called on the TextView() component. This will introduce |
|
3285 |
a clipping rectangle, which allows blank space required by the edwin layout component |
|
3286 |
to not be shown. |
|
3287 |
*/ |
|
3288 |
TInt iMaximumHeightInLines; |
|
3289 |
CLafEdwinCustomDrawBase* iCustomDrawer; |
|
3290 |
TInt iLastPointerAnchorPos; |
|
3291 |
CAknCcpuSupport* iCcpuSupport; |
|
3292 |
CCharFormatLayer* iCharFormatLayer; |
|
3293 |
CParaFormatLayer* iParaFormatLayer; |
|
3294 |
TInt iSpare_1; |
|
3295 |
TInt iSpare_2; |
|
3296 |
}; |
|
3297 |
||
3298 |
||
3299 |
inline CEikScrollBarFrame* CEikEdwin::CreatePreAllocatedScrollBarFrameL() |
|
3300 |
{ return CreateScrollBarFrameL(ETrue);} |
|
3301 |
inline CEikScrollBarFrame* CEikEdwin::ScrollBarFrame() |
|
3302 |
{ return ((CEikScrollBarFrame* const)iSBFrame); } |
|
3303 |
inline TInt CEikEdwin::AvgLinesInViewRect() const |
|
3304 |
{ return iAvgLinesInViewRect; } |
|
3305 |
inline TInt CEikEdwin::AvgCharsPerLine() const |
|
3306 |
{ return iAvgCharsPerLine;} |
|
3307 |
inline void CEikEdwin::SetAvgLinesInViewRect(TInt aAvgLines) |
|
3308 |
{ iAvgLinesInViewRect=aAvgLines; } |
|
3309 |
inline void CEikEdwin::SetAvgCharsPerLine(TInt aAvgChars) |
|
3310 |
{ iAvgCharsPerLine=aAvgChars; } |
|
3311 |
||
3312 |
inline void CEikEdwin::SetMaxLength(TInt aLength ) |
|
3313 |
{ SetTextLimit(aLength); } |
|
3314 |
inline TInt CEikEdwin::MaxLength() const |
|
3315 |
{ return iTextLimit; } |
|
3316 |
||
3317 |
#endif |