00001
00002
00003
00004
00005
00006 #if !defined(__EIKRTED_H__)
00007 #define __EIKRTED_H__
00008
00009 #if !defined(__EIKGTED_H__)
00010 #include <eikgted.h>
00011 #endif
00012
00013 #if !defined(__APPARC_H__)
00014 #include <apparc.h>
00015 #endif
00016
00017 #if !defined(__TXTMRTSR_H__)
00018 #include <txtmrtsr.h>
00019 #endif
00020
00021 #if !defined(__GDI_H__)
00022 #include <gdi.h>
00023 #endif
00024
00025 class CRichText;
00026 class TResourceReader;
00027 class TPictureHeader;
00028 class CEikRubberBand;
00029 class CBufStore;
00030 class CStreamStore;
00031 class CApaDoor;
00032 class CEikParserManager;
00033 class MEikRichTextEditorParserObserver;
00034 class MParser;
00035
00044 class CEikRichTextEditor : public CEikGlobalTextEditor,
00045 public MApaEmbeddedDocObserver,
00046 public MRichTextStoreResolver,
00047 public MPictureFactory
00048 {
00049
00050 public:
00051
00057 enum TObjectFormat
00058 {
00060 EAlwaysIconic,
00061
00066 EGlassIfPossible
00067 };
00068
00075 enum
00076 {
00081 EShowAllPicturesAsIconic =0x00100000,
00082
00089 ENoTextParsers =0x00200000,
00090
00097 EPasteAsPlainText =0x00400000
00098 };
00099
00100 public:
00101
00105 IMPORT_C CEikRichTextEditor();
00106
00112 IMPORT_C CEikRichTextEditor(const TGulBorder& aBorder);
00113
00117 IMPORT_C ~CEikRichTextEditor();
00118
00146 IMPORT_C void ConstructL(const CCoeControl* aParent,
00147 TInt aNumberOfLines,
00148 TInt aTextLimit,
00149 TInt aEdwinFlags,
00150 TInt aFontControlFlags=EGulFontControlAll,
00151 TInt aFontNameFlags=EGulNoSymbolFonts);
00152
00158 IMPORT_C CRichText* RichText() const;
00159
00174 IMPORT_C void InsertObjectL(TObjectFormat aFormat);
00175
00189 IMPORT_C void InsertObjectL();
00190
00209 IMPORT_C void InsertObjectL(const TDesC& aAppDllName,
00210 TUid aAppDllUid,
00211 TObjectFormat aFormat);
00212
00231 IMPORT_C void InsertObjectL(TUid aPictureType,
00232 CBase* aData);
00233
00243 IMPORT_C void ReEditObjectL();
00244
00256 IMPORT_C TInt ObjectCursorPos() const;
00257
00269 IMPORT_C TBool CheckForObjectL();
00270
00285 IMPORT_C void EditPictureFormatL();
00286
00294 IMPORT_C void PictureFormatChangedL();
00295
00310 IMPORT_C void GetEmbeddedAppL(CApaDoor*& aDoor,
00311 CApaDocument*& aDoc,
00312 TInt aDocPos);
00313
00325 IMPORT_C void UpdatePictureFormatL();
00326
00342 IMPORT_C void UpdatePictureFormatL(TInt aStartPos,TInt aLength);
00343
00352 IMPORT_C void SetDefaultIconicDoorSize(const TSize& aSize);
00353
00359 IMPORT_C const TSize& DefaultIconicDoorSize() const;
00360
00370 IMPORT_C void UpdatePictureSizeL();
00371
00385 IMPORT_C void UpdatePictureSizeL(TInt aStartPos,TInt aLength);
00386
00399 IMPORT_C void SetParserObserver(
00400 MEikRichTextEditorParserObserver* aObserver);
00401
00408 IMPORT_C void SetPhoneNumberGrouping( TBool aEnable );
00409
00410 public:
00411
00429 IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
00430
00441 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
00442
00455 IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
00456
00468 IMPORT_C void ActivateL();
00469
00470 private:
00471
00475 IMPORT_C void* ExtensionInterface( TUid aInterface );
00476
00477 public:
00478
00488 IMPORT_C void CopyDocumentContentL(CGlobalText& aInText,CGlobalText& aOutText);
00489
00490 protected:
00491
00495 enum
00496 {
00498 ECropFromLeft =0x00010000,
00499
00501 ECropFromRight =0x00020000,
00502
00504 ECropFromTop =0x00040000,
00505
00507 ECropFromBottom =0x00080000,
00508
00510 EReEditingObject =0x00100000
00511 };
00512
00513 protected:
00514
00522 IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
00523
00524 protected:
00525
00534 IMPORT_C void EditObserver(TInt aStartEdit,TInt aEditLength);
00535
00536 private:
00537
00538 IMPORT_C void Draw(const TRect& aRect) const;
00539
00540 IMPORT_C void Reserved_2();
00541
00542 private:
00543
00544 IMPORT_C void HandleTextPastedL(TInt aStartPos,TInt& aLength);
00545 IMPORT_C void Reserved_3();
00546
00547 private:
00548
00549 IMPORT_C void NotifyExit(TExitMode aMode);
00550
00551 private:
00552
00553 IMPORT_C const CStreamStore& StreamStoreL(TInt aPos) const;
00554
00555 private:
00556
00557 IMPORT_C void NewPictureL(TPictureHeader& aHdr,const CStreamStore& aDeferredPictureStore) const;
00558
00559 private:
00560
00561 void CommonConstructL();
00562
00563 static TInt InsertEmbeddedDocL(TAny *aThis);
00564
00565 static TInt DeleteEmbeddedDoc(TAny *aThis);
00566
00567 static TInt UpdateEmbeddedDocL(TAny* aThis);
00568
00569 static TInt TryDeleteEmbeddedDocL(TAny *aThis);
00570
00571 void InsertPictureL(const TPictureHeader& aPictureHeader);
00572
00573 void DoInsertPictureL(TBool& aFormatHasChanged,const TPictureHeader& aPictureHeader);
00574
00575 void DoReEditObjectL(TInt aDocPos);
00576
00577 void RoomForObjectL();
00578
00579 void InsertObjectL(CApaDocument* aDoc,TObjectFormat aFormat);
00580
00581 void SetTextObserver(CRichText& aText);
00582
00583 inline void DoReportEdwinEventL(MEikEdwinObserver::TEdwinEvent aEventType);
00584
00585 protected:
00586
00590 TSize iDefaultIconicDoorSize;
00591
00592 private:
00593
00594 TPictureHeader iEmbeddedDoc;
00595
00596 CIdle* iEmbeddedDocUpdate;
00597
00598 CBufStore* iBufStore;
00599
00600 CEikParserManager* iParserManager;
00601
00602 private:
00603
00604 friend class CEikParserManager;
00605
00606 public:
00607
00611 IMPORT_C void RefreshParsersL();
00612
00613 };
00614
00615 class MEikRichTextEditorParserObserver
00616 {
00617 public:
00618 virtual void HandleCursorOverParserL(const TDesC& aDoItText)=0;
00619 };
00620
00621 inline void CEikRichTextEditor::DoReportEdwinEventL(MEikEdwinObserver::TEdwinEvent aEventType)
00622 {ReportEdwinEventL(aEventType);}
00623
00624
00625 #endif
00626
00627