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