# examples/ForumNokia/S60_3rd_Edition_TextMTM_Example/modules/Viewer/inc/TxtViewerAppView.h

    00001
    00002
    00003 #ifndef __TXTVIEWVERAPPVIEW_H__
    00004 #define __TXTVIEWVERAPPVIEW_H__
    00005
    00006 // INCLUDES
    00007 #include <eikedwin.h>
    00008 #include "EIKRTED.H"
    00009 #include <TXTCMDS.HRH>
    00010 #include <coecntrl.h>
    00011 #include <MSVSTD.H>
    00012 #include <msvapi.h>
    00013 class CTextMtmClient;
    00014 class CTextMtmUi;
    00015
    00016 class CMsvSession;
    00017 class CMsvStore;
    00018 class CEikRichTextEditor;
    00019 class CClientMtmRegistry;
    00020 class CMtmUiRegistry;
    00021 class CMsvOperation;
    00022 class CMsvEntrySelection;
    00023 // CLASS DECLARATION
    00024 class TDummyObserver : public MMsvSessionObserver
    00025         {
    00026 public:
    00027         void HandleSessionEventL(TMsvSessionEvent /*aEvent*/, TAny* /*aArg1*/, TAny* /*aArg2*/, TAny* /*aArg3*/) {};
    00028         };
    00029 class CTxtViewerAppView : public CCoeControl
    00030     {
    00031     public: // New methods
    00032                 TRequestStatus* it;
    00033                 CMsvOperation* iop;
    00034                 CMsvEntrySelection* iselection;
    00035
    00036                 TBuf8<1> iscrap;
    00037
    00038         //Loads body from the store to the editor
    00039         void LoadBodyL();
    00040
    00041         //Saves body from the editor to the store
    00042         void SaveBodyL();
    00043
    00044         void ExportToFileL( const TDes& aFileName );
    00045
    00046                 CTextMtmUi* UiMtm()
    00047                 {
    00048                         return iUiMtm;
    00049                 }
    00050
    00051                 TMsvId EntryId();
    00052
    00053                 TBool OpenedForEditing();
    00054
    00055                 void Notify();
    00056
    00064         static CTxtViewerAppView* NewL( const TRect& aRect );
    00065
    00074         static CTxtViewerAppView* NewLC( const TRect& aRect );
    00075
    00080         virtual ~CTxtViewerAppView();
    00081
    00082     public:  // Functions from base classes
    00083 void InitializeMTMsL();
    00084
    00090         void Draw( const TRect& aRect ) const;
    00091
    00096         virtual void SizeChanged();
    00097
    00098            TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType);
    00099
    00100
    00101
    00102     private: // Constructors
    00103
    00111         void ConstructL(const TRect& aRect);
    00112
    00117         CTxtViewerAppView();
    00118
    00119
    00120
    00121
    00122
    00123
    00124         private:
    00125                 CMsvSession* iSession;
    00126                 CMsvStore* iStore;
    00127                 CEikRichTextEditor* iEditor;
    00128                 HBufC* iText;
    00129                 CTextMtmClient* iClientMtm;
    00130                 CTextMtmUi* iUiMtm;
    00131                 CClientMtmRegistry* iClientReg;
    00132                 CMtmUiRegistry* iUiReg;
    00133
    00134                 TDummyObserver iOb;
    00135
    00136
    00137     };
    00138
    00139 #endif // __TXTVIEWVERAPPVIEW_H__
    00140
    00141 // End of File
    00142