epoc32/include/mw/eikrted.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(__EIKRTED_H__)
williamr@2
    20
#define __EIKRTED_H__
williamr@2
    21
williamr@2
    22
#if !defined(__EIKGTED_H__)
williamr@2
    23
#include <eikgted.h>
williamr@2
    24
#endif
williamr@2
    25
williamr@2
    26
#if !defined(__APPARC_H__)
williamr@2
    27
#include <apparc.h>
williamr@2
    28
#endif
williamr@2
    29
williamr@2
    30
#if !defined(__TXTMRTSR_H__)
williamr@2
    31
#include <txtmrtsr.h>
williamr@2
    32
#endif
williamr@2
    33
williamr@2
    34
#if !defined(__GDI_H__)
williamr@2
    35
#include <gdi.h>
williamr@2
    36
#endif
williamr@2
    37
williamr@2
    38
class CRichText;
williamr@2
    39
class TResourceReader;
williamr@2
    40
class TPictureHeader;
williamr@2
    41
class CEikRubberBand;
williamr@2
    42
class CBufStore;
williamr@2
    43
class CStreamStore;
williamr@2
    44
class CApaDoor;
williamr@2
    45
class CEikParserManager;
williamr@2
    46
class MEikRichTextEditorParserObserver;
williamr@2
    47
class MParser;
williamr@2
    48
williamr@2
    49
/**
williamr@2
    50
 * Rich text editor.
williamr@2
    51
 * 
williamr@2
    52
 * This is an edit window that supports rich text, including embedded objects
williamr@2
    53
 * represented either by icons or glass doors. 
williamr@2
    54
 *
williamr@2
    55
 * @since Symbian 5.0
williamr@2
    56
 */
williamr@2
    57
class CEikRichTextEditor : public CEikGlobalTextEditor, 
williamr@2
    58
                           public MApaEmbeddedDocObserver, 
williamr@2
    59
                           public MRichTextStoreResolver, 
williamr@2
    60
                           public MPictureFactory
williamr@2
    61
	{
williamr@2
    62
williamr@2
    63
public:
williamr@2
    64
    
williamr@2
    65
    /** 
williamr@2
    66
     * Identifies how an embedded object should be represented.
williamr@2
    67
     *
williamr@2
    68
     * One of these values is specified when the object is inserted.
williamr@2
    69
     */ 
williamr@2
    70
	enum TObjectFormat
williamr@2
    71
		{
williamr@2
    72
        /** The object is always represented by an icon */
williamr@2
    73
		EAlwaysIconic,
williamr@2
    74
williamr@2
    75
        /** 
williamr@2
    76
         * The object is represented by a glass door, if possible, or by icon,
williamr@2
    77
         * if not.
williamr@2
    78
         */
williamr@2
    79
		EGlassIfPossible
williamr@2
    80
		};
williamr@2
    81
williamr@2
    82
    /** 
williamr@2
    83
     * Edit window attribute flags specific to the rich text editor.
williamr@2
    84
     *
williamr@2
    85
     * These may be specified during construction in addition to the values 
williamr@2
    86
     * contained in the @c TFlags enum in class @c CEikEdwin.
williamr@2
    87
     */
williamr@2
    88
	enum // user flag
williamr@2
    89
		{
williamr@2
    90
        /** 
williamr@2
    91
         * All embedded objects are represented by icon rather than 
williamr@2
    92
         * glass doors. 
williamr@2
    93
         */
williamr@2
    94
        EShowAllPicturesAsIconic	=0x00100000,
williamr@2
    95
		
williamr@2
    96
        /**
williamr@2
    97
         * The editor has no text parsers.
williamr@2
    98
         *
williamr@2
    99
         * Text parsers are used to recognise and tag special text strings,
williamr@2
   100
         * e.g. URLs.
williamr@2
   101
         */
williamr@2
   102
        ENoTextParsers				=0x00200000,
williamr@2
   103
        
williamr@2
   104
        /**
williamr@2
   105
         * When pasting text into the editor, the text is
williamr@2
   106
         * stripped of all formatting.
williamr@2
   107
         *
williamr@2
   108
         * @since 3.2
williamr@2
   109
         */
williamr@2
   110
        EPasteAsPlainText           =0x00400000
williamr@2
   111
		};
williamr@2
   112
williamr@2
   113
public:
williamr@2
   114
williamr@2
   115
    /**
williamr@2
   116
     * C++ default constructor.
williamr@2
   117
     */
williamr@2
   118
    IMPORT_C CEikRichTextEditor();
williamr@2
   119
williamr@2
   120
    /**
williamr@2
   121
     * C++ constructor.
williamr@2
   122
     * 
williamr@2
   123
     * @param aBorder Border for the rich text editor. 
williamr@2
   124
     */ 
williamr@2
   125
	IMPORT_C CEikRichTextEditor(const TGulBorder& aBorder);
williamr@2
   126
williamr@2
   127
    /**
williamr@2
   128
     * Destructor.
williamr@2
   129
     */ 
williamr@2
   130
    IMPORT_C ~CEikRichTextEditor();
williamr@2
   131
williamr@2
   132
    /** 
williamr@2
   133
     * By default Symbian 2nd phase constructor is private.
williamr@2
   134
     *
williamr@2
   135
     * Completes construction of the rich text editor.
williamr@2
   136
     *
williamr@2
   137
     * The editor's paragraph and character formatting are set to default
williamr@2
   138
     * values, unless the @c CEikEdwin::EUserSuppliedText flag is specified 
williamr@2
   139
     * in @c aEdwinFlags.
williamr@2
   140
     *
williamr@2
   141
     * @param aParent If not NULL, the editor's parent control. 
williamr@2
   142
     *        If NULL, the editor has no parent.
williamr@2
   143
     * @param aNumberOfLines The number of lines visible in the editor. 
williamr@2
   144
     *        This controls the editor's height.
williamr@2
   145
     * @param aTextLimit The maximum number of characters that can be entered
williamr@2
   146
     *        into the editor.
williamr@2
   147
     * @param aEdwinFlags Edit window attribute flags. 
williamr@2
   148
     *        See @c CEikEdwin::TFlags().
williamr@2
   149
     * @param aFontControlFlags = EGulFontControlAll Flags that specify which 
williamr@2
   150
     *        font-related controls should not appear in font dialogs launched 
williamr@2
   151
     *        from the edit window. For instance @c EGulFontControlBold removes 
williamr@2
   152
     *        the bold checkbox control. The default shows all. For possible 
williamr@2
   153
     *        values, see @c gulftflg.hrh.
williamr@2
   154
     * @param aFontNameFlags = EGulNoSymbolFonts The font flags. These control 
williamr@2
   155
     *        whether symbol and monospace fonts should be displayed in font
williamr@2
   156
     *        dialogs launched from the edit window. For possible values, see 
williamr@2
   157
     *        @c gulftflg.hrh.
williamr@2
   158
     */
williamr@2
   159
    IMPORT_C void ConstructL(const CCoeControl* aParent,
williamr@2
   160
                             TInt aNumberOfLines,
williamr@2
   161
                             TInt aTextLimit,
williamr@2
   162
                             TInt aEdwinFlags,
williamr@2
   163
                             TInt aFontControlFlags=EGulFontControlAll,
williamr@2
   164
                             TInt aFontNameFlags=EGulNoSymbolFonts);
williamr@2
   165
	
williamr@2
   166
    /** 
williamr@2
   167
     * Gets a pointer to the rich text object owned by the editor.
williamr@2
   168
     *
williamr@2
   169
     * @return Pointer to the rich text object.
williamr@2
   170
     */
williamr@2
   171
    IMPORT_C CRichText* RichText() const;
williamr@2
   172
	
williamr@2
   173
    /** 
williamr@2
   174
     * Launches an insert object dialog (@c CEikInsertObjectDialog),
williamr@2
   175
     * and inserts a default document of the application type selected 
williamr@2
   176
     * by the user.
williamr@2
   177
     * 
williamr@2
   178
     * The object can be displayed either as a glass door, if supported, 
williamr@2
   179
     * or as an icon, and the inserted object is opened for editing.
williamr@2
   180
     *
williamr@2
   181
     * Displays an info message and leaves if the editor's text limit 
williamr@2
   182
     * has been reached.
williamr@2
   183
     * 
williamr@2
   184
     * @param aFormat Specifies whether the embedded document should be 
williamr@2
   185
     *        displayed as an icon or as a glass door.
williamr@2
   186
     */ 
williamr@2
   187
    IMPORT_C void InsertObjectL(TObjectFormat aFormat);
williamr@2
   188
	
williamr@2
   189
    /** 
williamr@2
   190
     * Launches an insert object dialog (@c CEikInsertObjectDialog),
williamr@2
   191
     * and inserts a default document of the application type selected 
williamr@2
   192
     * by the user.
williamr@2
   193
     * 
williamr@2
   194
     * The object is displayed as a glass door rather than as an icon, 
williamr@2
   195
     * if supported and the inserted object is opened for editing.
williamr@2
   196
     *
williamr@2
   197
     * Displays an info message and leaves if the editor's text limit 
williamr@2
   198
     * has been reached.
williamr@2
   199
     *
williamr@2
   200
     * Default is @c EGlassIfPossible.
williamr@2
   201
     */
williamr@2
   202
    IMPORT_C void InsertObjectL(); // defaults to EGlassIfPossible
williamr@2
   203
	
williamr@2
   204
    /** 
williamr@2
   205
     * Creates and inserts a default document of the specified 
williamr@2
   206
     * application type.
williamr@2
   207
     * 
williamr@2
   208
     * @c CApaProcess::AddNewDocumentL() is used to create the document.
williamr@2
   209
     * 
williamr@2
   210
     * The object can be displayed either as a glass door, if supported, 
williamr@2
   211
     * or as an icon, and the inserted object is opened for editing.
williamr@2
   212
     *
williamr@2
   213
     * Displays an info message and leaves if no suitable application DLL 
williamr@2
   214
     * can be found, or if the editor's text limit has been reached.
williamr@2
   215
     *
williamr@2
   216
     * @since Symbian 7.0
williamr@2
   217
     * @param aAppDllName Filename of the application DLL.
williamr@2
   218
     * @param aAppDllUid UID of the application. The default is @c KNullUid.
williamr@2
   219
     * @param aFormat Specifies whether the embedded document should be 
williamr@2
   220
     *        displayed as an icon or as a glass door.
williamr@2
   221
     */
williamr@2
   222
    IMPORT_C void InsertObjectL(const TDesC& aAppDllName,
williamr@2
   223
                                TUid aAppDllUid,
williamr@2
   224
                                TObjectFormat aFormat);
williamr@2
   225
	
williamr@2
   226
    /** 
williamr@2
   227
     * Creates and inserts a new embedded object of the specified type.
williamr@2
   228
     *
williamr@2
   229
     * First, an attempt is made to find an extended picture factory that
williamr@2
   230
     * supports the insertion of pictures of the specified type. If one is
williamr@2
   231
     * not found, the function leaves; if one is found, the picture is inserted
williamr@2
   232
     * at the cursor position.
williamr@2
   233
     *
williamr@2
   234
     * Displays an info message and leaves if the editor's text limit has
williamr@2
   235
     * been reached.
williamr@2
   236
     * 
williamr@2
   237
     * @since Symbian 6.1
williamr@2
   238
     * @param aPictureType The picture type.
williamr@2
   239
     * @param aData The base address of the data. 
williamr@2
   240
     * @leave KErrNotSupported No picture factory which supports the specified 
williamr@2
   241
     *                         type is available in the control's @c Uikon 
williamr@2
   242
     *                         environment.
williamr@2
   243
     */
williamr@2
   244
    IMPORT_C void InsertObjectL(TUid aPictureType,
williamr@2
   245
                                CBase* aData);
williamr@2
   246
	
williamr@2
   247
    /** 
williamr@2
   248
     * Re-edits the embedded object at the cursor position.
williamr@2
   249
     *
williamr@2
   250
     * If there is no embedded object at the cursor position, or if there is a 
williamr@2
   251
     * selection, an info message is displayed.
williamr@2
   252
     *
williamr@2
   253
     * If there is a valid object at the cursor position, it is opened for 
williamr@2
   254
     * editing (or for viewing if the editor is read-only).
williamr@2
   255
     */
williamr@2
   256
    IMPORT_C void ReEditObjectL();
williamr@2
   257
	
williamr@2
   258
    /** 
williamr@2
   259
     * Gets the document position and checks whether there is an embedded 
williamr@2
   260
     * object at the cursor position.
williamr@2
   261
     *
williamr@2
   262
     * If there is no embedded object at the cursor position, or if there 
williamr@2
   263
     * is a selection, an info message is displayed.
williamr@2
   264
     *
williamr@2
   265
     * @return The document position of the embedded object, or 
williamr@2
   266
     *         @c KErrNotFound if there is no embedded object at the cursor 
williamr@2
   267
     *         position, or if there is a selection
williamr@2
   268
     */
williamr@2
   269
    IMPORT_C TInt ObjectCursorPos() const;
williamr@2
   270
	
williamr@2
   271
    /**
williamr@2
   272
     * Tests whether there is an embedded object at the cursor position.
williamr@2
   273
     *
williamr@2
   274
     * If there is one, it is opened for editing (or for viewing if the editor
williamr@2
   275
     * is read-only).
williamr@2
   276
     *
williamr@2
   277
     * @return @c ETrue if there is an embedded object at the cursor 
williamr@2
   278
     *         position and it could be opened. @c EFalse if there is no 
williamr@2
   279
     *         embedded object at the cursor position, or if the object has
williamr@2
   280
     *         a NULL UID.
williamr@2
   281
     */ 
williamr@2
   282
    IMPORT_C TBool CheckForObjectL();
williamr@2
   283
	
williamr@2
   284
    /**
williamr@2
   285
     * Launches a format object dialog (@c CEikFormatObjectDialog) if there 
williamr@2
   286
     * is an embedded object at the cursor position, and the object supports 
williamr@2
   287
     * being displayed as a glass door.
williamr@2
   288
     *
williamr@2
   289
     * If the object does not support being displayed as a glass door, an 
williamr@2
   290
     * object information dialog (@c CEikObjectInfoDialog) is launched instead.
williamr@2
   291
     *
williamr@2
   292
     * If the embedded object's associated application cannot be found, an 
williamr@2
   293
     * info message is displayed and the function leaves.
williamr@2
   294
     *
williamr@2
   295
     * The function has no effect if there is no embedded object at the cursor
williamr@2
   296
     * position.
williamr@2
   297
     */ 
williamr@2
   298
    IMPORT_C void EditPictureFormatL();
williamr@2
   299
	
williamr@2
   300
    /**
williamr@2
   301
     * Handles a change to the format of an embedded object, by updating the 
williamr@2
   302
     * view, the scroll bars and reporting the event to its observers.
williamr@2
   303
     *
williamr@2
   304
     * There is no need to call this function after calling 
williamr@2
   305
     * @c EditPictureFormatL().
williamr@2
   306
     */
williamr@2
   307
    IMPORT_C void PictureFormatChangedL();
williamr@2
   308
	
williamr@2
   309
    /**
williamr@2
   310
     * Gets a pointer to the embedded object located at the specified position. 
williamr@2
   311
     *
williamr@2
   312
     * If the object is not in memory, the function loads it.  
williamr@2
   313
     *
williamr@2
   314
     * If the object's associated application cannot be found, an info message
williamr@2
   315
     * is displayed and the function leaves.
williamr@2
   316
     *
williamr@2
   317
     * @param aDoor On return, the embedded document's wrapper object (icon or 
williamr@2
   318
     *        glass door).
williamr@2
   319
     * @param aDoc On return, the embedded document.
williamr@2
   320
     * @param aDocPos The document position in the editor at which the embedded 
williamr@2
   321
     *        object is located.
williamr@2
   322
     */
williamr@2
   323
    IMPORT_C void GetEmbeddedAppL(CApaDoor*& aDoor,
williamr@2
   324
                                  CApaDocument*& aDoc,
williamr@2
   325
                                  TInt aDocPos);
williamr@2
   326
	
williamr@2
   327
    /** 
williamr@2
   328
     * Changes all embedded objects displayed as glass doors into temporarily 
williamr@2
   329
     * iconic.
williamr@2
   330
     * 
williamr@2
   331
     * The function operates throughout the editor.
williamr@2
   332
     *
williamr@2
   333
     * Only needed when pictures are temporarily iconic. 
williamr@2
   334
     *
williamr@2
   335
     * Has no effect if there are no embedded objects in the editor or if the 
williamr@2
   336
     * @c EShowAllPicturesAsIconic attribute flag was set during construction.
williamr@2
   337
     */
williamr@2
   338
    IMPORT_C void UpdatePictureFormatL(); 
williamr@2
   339
	
williamr@2
   340
    /**
williamr@2
   341
     * Changes all embedded objects displayed as glass doors into temporarily 
williamr@2
   342
     * iconic.
williamr@2
   343
     * 
williamr@2
   344
     * The function operates over a specified range of characters.
williamr@2
   345
     *
williamr@2
   346
     * Has no effect if there are no embedded objects in the editor or if the 
williamr@2
   347
     * @c EShowAllPicturesAsIconic attribute flag was set during construction.
williamr@2
   348
     *
williamr@2
   349
     * Only needed when pictures are temporarily iconic.
williamr@2
   350
     *
williamr@2
   351
     * @param aStartPos The start position.
williamr@2
   352
     * @param aLength The number of characters, beginning at @c aStartPos over 
williamr@2
   353
     *        which the function operates.
williamr@2
   354
     */
williamr@2
   355
    IMPORT_C void UpdatePictureFormatL(TInt aStartPos,TInt aLength); 
williamr@2
   356
	
williamr@2
   357
    /** 
williamr@2
   358
     * Changes the size of the icons used to represent embedded objects.
williamr@2
   359
     *
williamr@2
   360
     * Any existing iconic doors can be updated to the new size by calling 
williamr@2
   361
     * @c UpdatePictureSizeL().
williamr@2
   362
     *
williamr@2
   363
     * @param aSize The new iconic door size in twips.
williamr@2
   364
     */ 
williamr@2
   365
    IMPORT_C void SetDefaultIconicDoorSize(const TSize& aSize); 
williamr@2
   366
	
williamr@2
   367
    /** 
williamr@2
   368
     * Gets the size of iconic doors.
williamr@2
   369
     * 
williamr@2
   370
     * @return The size of iconic doors. 
williamr@2
   371
     */ 
williamr@2
   372
    IMPORT_C const TSize& DefaultIconicDoorSize() const;
williamr@2
   373
	
williamr@2
   374
    /** 
williamr@2
   375
     * Changes the size of all icons representing embedded objects to the 
williamr@2
   376
     * default iconic door size.
williamr@2
   377
     *
williamr@2
   378
     * Also updates any objects currently displayed as glass doors, so that
williamr@2
   379
     * if displayed as icons, they will use the correct size. 
williamr@2
   380
     *
williamr@2
   381
     * The function operates throughout the editor.
williamr@2
   382
     */
williamr@2
   383
    IMPORT_C void UpdatePictureSizeL();
williamr@2
   384
	
williamr@2
   385
    /**
williamr@2
   386
     * Changes the size of all icons representing embedded objects to the 
williamr@2
   387
     * default iconic door size.
williamr@2
   388
     *
williamr@2
   389
     * Also updates any objects currently displayed as glass doors, so that 
williamr@2
   390
     * if displayed as icons, they will use the correct size. 
williamr@2
   391
     *
williamr@2
   392
     * The function operates over a specified range of characters.
williamr@2
   393
     *
williamr@2
   394
     * @param aStartPos The start position.
williamr@2
   395
     * @param aLength The number of characters, beginning at @c aStartPos over
williamr@2
   396
     *        which the function operates.
williamr@2
   397
     */
williamr@2
   398
    IMPORT_C void UpdatePictureSizeL(TInt aStartPos,TInt aLength);
williamr@2
   399
	
williamr@2
   400
    /** 
williamr@2
   401
     * Sets a parser observer.
williamr@2
   402
     *
williamr@2
   403
     * If the @c CEikEdwin::ENoTextParsers attribute flag was specified on 
williamr@2
   404
     * construction, this function has no effect.
williamr@2
   405
     *
williamr@2
   406
     * Its @c HandleCursorOverParserL() function is called when the cursor is 
williamr@2
   407
     * positioned over text that has been tagged by the parser, for instance 
williamr@2
   408
     * a URL.
williamr@2
   409
     *
williamr@2
   410
     * @param aObserver The parser observer.
williamr@2
   411
     */ 
williamr@2
   412
    IMPORT_C void SetParserObserver(
williamr@2
   413
                    MEikRichTextEditorParserObserver* aObserver);
williamr@2
   414
    
williamr@2
   415
    /**
williamr@2
   416
     * Activate/Disable phone number grouping.
williamr@2
   417
     *
williamr@2
   418
     * @param aEnable @c ETrue if phone number grouping is to be activated,
williamr@2
   419
     *        @c EFalse otherwise.
williamr@2
   420
     */ 
williamr@2
   421
    IMPORT_C void SetPhoneNumberGrouping( TBool aEnable );
williamr@2
   422
williamr@2
   423
public: // from CCoeControl
williamr@2
   424
williamr@2
   425
    /** 
williamr@2
   426
     * From @c CCoeControl.
williamr@2
   427
     * 
williamr@2
   428
     * Handles key events.
williamr@2
   429
     *
williamr@2
   430
     * Has no effect (apart from returning @c EKeyWasConsumed) if the 
williamr@2
   431
     * @c CEikEdwin::EDisplayOnly attribute flag was specified on construction.
williamr@2
   432
     *
williamr@2
   433
     * Handles rich text-specific hot keys, for instance to insert an object; 
williamr@2
   434
     * otherwise calls @c CEikGlobalTextEditor::OfferKeyEventL(). 
williamr@2
   435
     *
williamr@2
   436
     * @param aKeyEvent The key event.
williamr@2
   437
     * @param aType The type of the event. The editor only consumes events of 
williamr@2
   438
     *        type @c EEventKey.
williamr@2
   439
     * @return Indicates whether or not the editor consumed the 
williamr@2
   440
     *         key event.
williamr@2
   441
     */
williamr@2
   442
    IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
williamr@2
   443
	
williamr@2
   444
    /**
williamr@2
   445
     * From @c CCoeControl.
williamr@2
   446
     * 
williamr@2
   447
     * Handles pointer events inside the editor.
williamr@2
   448
     *
williamr@2
   449
     * Has no effect if the @c CEikEdwin::EDisplayOnly attribute flag was 
williamr@2
   450
     * specified on construction.
williamr@2
   451
     * 
williamr@2
   452
     * @param aPointerEvent The pointer event to be handled.
williamr@2
   453
     */
williamr@2
   454
    IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
williamr@2
   455
	
williamr@2
   456
    /** 
williamr@2
   457
     * From @c CCoeControl.
williamr@2
   458
     *
williamr@2
   459
     * Completes the construction of the rich text editor from a resource file.
williamr@2
   460
     *
williamr@2
   461
     * The editor's paragraph and character formatting are set to default 
williamr@2
   462
     * values, unless the @c CEikEdwin::EUserSuppliedText flag is specified in 
williamr@2
   463
     * the resource.
williamr@2
   464
     *
williamr@2
   465
     * @param aReader A resource reader positioned for reading from an 
williamr@2
   466
     *        RTXTED resource.
williamr@2
   467
     */
williamr@2
   468
    IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
williamr@2
   469
	
williamr@2
   470
    /** 
williamr@2
   471
     * From @c CCoeControl. 
williamr@2
   472
     * 
williamr@2
   473
     * Activates the editor so that it is ready for use.
williamr@2
   474
     *
williamr@2
   475
     * For instance, the text view is created, the editor is set to observe its
williamr@2
   476
     * rich text object, the editor's parser manager is set up, which handles
williamr@2
   477
     * the changes that occur when the cursor is moved over tagged text
williamr@2
   478
     * (for instance a URL), and all embedded objects are set to be displayed
williamr@2
   479
     * as icons, of the default size.
williamr@2
   480
     */ 
williamr@2
   481
    IMPORT_C void ActivateL();
williamr@2
   482
williamr@2
   483
private:
williamr@2
   484
williamr@2
   485
    /**
williamr@2
   486
    * From CAknControl.
williamr@2
   487
    */
williamr@2
   488
    IMPORT_C void* ExtensionInterface( TUid aInterface );
williamr@2
   489
williamr@2
   490
public: // from CEikEdwin
williamr@2
   491
williamr@2
   492
    /** 
williamr@2
   493
     * From @c CEikEdwin.
williamr@2
   494
     * 
williamr@2
   495
     * Copies the contents of one text object into another.
williamr@2
   496
     *
williamr@2
   497
     * @param[in] aInText The rich text object to copy.
williamr@2
   498
     * @param[out] aOutText On return, contains a copy of @c aInText.
williamr@2
   499
     * @panic 26 In debug mode, if either @c aInText or @c aOutText is @c NULL.
williamr@2
   500
     */ 
williamr@2
   501
    IMPORT_C void CopyDocumentContentL(CGlobalText& aInText,CGlobalText& aOutText);
williamr@2
   502
williamr@2
   503
protected:
williamr@2
   504
williamr@2
   505
    /** 
williamr@2
   506
     * Internal flags used for indicating operations. 
williamr@2
   507
     */
williamr@2
   508
    enum // internal flags
williamr@2
   509
		{
williamr@2
   510
        /** Crop from left. */ 
williamr@2
   511
        ECropFromLeft			=0x00010000,
williamr@2
   512
		
williamr@2
   513
        /** Crop from right. */
williamr@2
   514
        ECropFromRight			=0x00020000,
williamr@2
   515
      
williamr@2
   516
        /** Crop from top. */
williamr@2
   517
        ECropFromTop			=0x00040000,
williamr@2
   518
williamr@2
   519
        /** Crop from bottom. */ 
williamr@2
   520
        ECropFromBottom			=0x00080000,
williamr@2
   521
williamr@2
   522
        /** Object is being re-edited. */
williamr@2
   523
        EReEditingObject		=0x00100000
williamr@2
   524
		};
williamr@2
   525
williamr@2
   526
protected: // from CCoeControl
williamr@2
   527
williamr@2
   528
    /** 
williamr@2
   529
     * From @c CCoeControl.
williamr@2
   530
     *
williamr@2
   531
     * Writes the internal state to the specified stream.
williamr@2
   532
     * 
williamr@2
   533
     * @param aWriteStream Target stream.
williamr@2
   534
     */
williamr@2
   535
    IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
williamr@2
   536
williamr@2
   537
protected: // from MEditObserver
williamr@2
   538
williamr@2
   539
    /** 
williamr@2
   540
     * From @c MEditObserver. 
williamr@2
   541
     * 
williamr@2
   542
     * This member is internal an not meant to be used. 
williamr@2
   543
     *
williamr@2
   544
     * @param aStartEdit Start position for editing.
williamr@2
   545
     * @param aEditLength The length of the edited object.
williamr@2
   546
     */
williamr@2
   547
    IMPORT_C void EditObserver(TInt aStartEdit,TInt aEditLength);
williamr@2
   548
williamr@2
   549
private: // from CoeControl
williamr@2
   550
williamr@2
   551
    IMPORT_C void Draw(const TRect& aRect) const;
williamr@2
   552
williamr@2
   553
    IMPORT_C void Reserved_2();
williamr@2
   554
williamr@2
   555
private: // from CEikEdwin
williamr@2
   556
williamr@2
   557
    IMPORT_C void HandleTextPastedL(TInt aStartPos,TInt& aLength);
williamr@2
   558
    IMPORT_C void Reserved_3();
williamr@2
   559
williamr@2
   560
private: // from MApaEmbeddedDocObserver
williamr@2
   561
williamr@2
   562
    IMPORT_C void NotifyExit(TExitMode aMode);
williamr@2
   563
williamr@2
   564
private: // from MRichTextStoreResolver
williamr@2
   565
williamr@2
   566
    IMPORT_C const CStreamStore& StreamStoreL(TInt aPos) const;
williamr@2
   567
williamr@2
   568
private: // from MPictureFactory
williamr@2
   569
williamr@2
   570
    IMPORT_C void NewPictureL(TPictureHeader& aHdr,const CStreamStore& aDeferredPictureStore) const;
williamr@2
   571
williamr@2
   572
private:
williamr@2
   573
williamr@2
   574
    void CommonConstructL();
williamr@2
   575
	
williamr@2
   576
    static TInt InsertEmbeddedDocL(TAny *aThis);
williamr@2
   577
	
williamr@2
   578
    static TInt DeleteEmbeddedDoc(TAny *aThis);
williamr@2
   579
	
williamr@2
   580
    static TInt UpdateEmbeddedDocL(TAny* aThis);
williamr@2
   581
williamr@2
   582
    static TInt TryDeleteEmbeddedDocL(TAny *aThis);
williamr@2
   583
	
williamr@2
   584
    void InsertPictureL(const TPictureHeader& aPictureHeader);
williamr@2
   585
	
williamr@2
   586
    void DoInsertPictureL(TBool& aFormatHasChanged,const TPictureHeader& aPictureHeader);
williamr@2
   587
	
williamr@2
   588
    void DoReEditObjectL(TInt aDocPos);
williamr@2
   589
	
williamr@2
   590
    void RoomForObjectL();
williamr@2
   591
	
williamr@2
   592
    void InsertObjectL(CApaDocument* aDoc,TObjectFormat aFormat);
williamr@2
   593
	
williamr@2
   594
    void SetTextObserver(CRichText& aText);
williamr@2
   595
	
williamr@2
   596
    inline void DoReportEdwinEventL(MEikEdwinObserver::TEdwinEvent aEventType);
williamr@2
   597
williamr@2
   598
protected:
williamr@2
   599
williamr@2
   600
    /** 
williamr@2
   601
     * Default size of iconic door.
williamr@2
   602
     */
williamr@2
   603
    TSize iDefaultIconicDoorSize;
williamr@2
   604
williamr@2
   605
private:
williamr@2
   606
williamr@2
   607
    TPictureHeader iEmbeddedDoc;
williamr@2
   608
williamr@2
   609
    CIdle* iEmbeddedDocUpdate;
williamr@2
   610
	
williamr@2
   611
    CBufStore* iBufStore;
williamr@2
   612
	
williamr@2
   613
    CEikParserManager* iParserManager;
williamr@2
   614
williamr@2
   615
private:
williamr@2
   616
williamr@2
   617
    friend class CEikParserManager;
williamr@2
   618
williamr@2
   619
public: // new methods
williamr@2
   620
williamr@2
   621
    /**
williamr@2
   622
     * Force everything to be parsed.
williamr@2
   623
     */ 
williamr@2
   624
    IMPORT_C void RefreshParsersL();
williamr@2
   625
	
williamr@2
   626
    };
williamr@2
   627
williamr@2
   628
class MEikRichTextEditorParserObserver
williamr@2
   629
	{
williamr@2
   630
public:
williamr@2
   631
	virtual void HandleCursorOverParserL(const TDesC& aDoItText)=0;
williamr@2
   632
	};
williamr@2
   633
williamr@2
   634
inline void CEikRichTextEditor::DoReportEdwinEventL(MEikEdwinObserver::TEdwinEvent aEventType)
williamr@2
   635
	{ReportEdwinEventL(aEventType);}
williamr@2
   636
williamr@2
   637
#endif  // __EIKRTED_H__
williamr@2
   638
williamr@2
   639
// End of file