examples/ForumNokia/S60_3rd_Edition_TextMTM_Example/modules/UI/inc/txtu.h

00001 //
00002 // © 2004 Nokia Corporation.  All rights reserved.
00003 //
00004 
00005 
00006 #ifndef __TXTU_H__
00007 #define __TXTU_H__
00008 
00009 // system include
00010 #include <mtmuibas.h>       // CBaseMtmUi
00011 
00012 // user include
00013 #include "../../Util/inc/txut.h"         //service settings
00014 
00015 //
00016 // CTextMtmUi: User Interface MTM
00017 //
00018 
00019 class CTextMtmUi : public CBaseMtmUi
00020         {
00021 public:
00022         // Construction
00023         static CTextMtmUi* NewL(CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll);
00024         // Destruction
00025         ~CTextMtmUi();
00026 
00027 
00028 
00029 public:
00030         // Context-specific APIs from CBaseMtmUi
00031         virtual CMsvOperation* CancelL(TRequestStatus& aStatus, const CMsvEntrySelection& aSelection);
00032 
00033         virtual CMsvOperation* OpenL(TRequestStatus& aStatus); 
00034         virtual CMsvOperation* OpenL(TRequestStatus& aStatus, const CMsvEntrySelection& aSelection); 
00035 
00036         virtual CMsvOperation* CloseL(TRequestStatus& aStatus); 
00037         virtual CMsvOperation* CloseL(TRequestStatus& aStatus, const CMsvEntrySelection& aSelection);
00038 
00039         // Launches editor/settings dialog as appropriate  
00040         virtual CMsvOperation* EditL(TRequestStatus& aStatus);
00041         virtual CMsvOperation* EditL(TRequestStatus& aStatus, const CMsvEntrySelection& aSelection) ;
00042 
00043         // Launches viewer/settings dialog as appropriate  
00044         virtual CMsvOperation* ViewL(TRequestStatus& aStatus);
00045         virtual CMsvOperation* ViewL(TRequestStatus& aStatus, const CMsvEntrySelection& aSelection);
00046 
00047         // Copy and move
00048         virtual CMsvOperation* CopyToL(const CMsvEntrySelection& aSelection, TRequestStatus& aStatus);
00049         virtual CMsvOperation* MoveToL(const CMsvEntrySelection& aSelection, TRequestStatus& aStatus);
00050         virtual CMsvOperation* CopyFromL(const CMsvEntrySelection& aSelection, TMsvId aTargetId, TRequestStatus& aStatus);
00051         virtual CMsvOperation* MoveFromL(const CMsvEntrySelection& aSelection, TMsvId aTargetId, TRequestStatus& aStatus);
00052 
00053         // Creat reply/forward message entries
00054     virtual CMsvOperation* ReplyL(TMsvId aDestination, TMsvPartList aPartList, TRequestStatus& aCompletionStatus);
00055         virtual CMsvOperation* ForwardL(TMsvId aDestination, TMsvPartList aPartList, TRequestStatus& aCompletionStatus);
00056 
00057         // Create/delete/undelete
00058         virtual CMsvOperation* CreateL(const TMsvEntry& aEntry, CMsvEntry& aParent, TRequestStatus& aStatus);
00059         virtual CMsvOperation* DeleteFromL(const CMsvEntrySelection& aSelection,TRequestStatus& aStatus);
00060         CMsvOperation* DeleteServiceL(const TMsvEntry& aService, TRequestStatus& aStatus);
00061 
00062 public:
00063         // Operation APIs from CBaseMtmUi
00064         virtual void InvokeSyncFunctionL(TInt aFunctionId, const CMsvEntrySelection& aSelection, TDes8& aParameter);
00065         virtual CMsvOperation* InvokeAsyncFunctionL(TInt aFunctionId, const CMsvEntrySelection& aSelection, TRequestStatus& aCompletionStatus, TDes8& aParameter);
00066         virtual TInt GetProgress(const TDesC8& aProgress, TBuf<EProgressStringMaxLen>& aReturnString, TInt& aTotalEntryCount, TInt& aEntriesDone,
00067                 TInt& aCurrentEntrySize, TInt& aCurrentBytesTrans) const;
00068 
00069 
00070 public:
00071         CMsvOperation* LaunchEditorApplicationL(TRequestStatus& aStatus, TMsvId aId, TBool aReadOnly);
00072     CMsvOperation* LaunchViewerApplicationL(TRequestStatus& aStatus, TMsvId aId);
00073 
00074 
00075 protected: 
00076         // from CBaseMtmUi
00077         void GetResourceFileName(TFileName& aFileName) const;
00078 
00079 protected:
00080         CTextMtmUi(CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll);
00081         void TxtConstructL();
00082 
00083 private:
00084     // private utility methods
00085         CMsvOperation* DoCopyMoveToL(const CMsvEntrySelection& aSelection, TRequestStatus& aStatus, TBool aCopy);
00086         CMsvOperation* DoCopyMoveFromL(const CMsvEntrySelection& aSelection, TMsvId aTargetId, TRequestStatus& aStatus, TBool aCopy);
00087         void ValidateSelectionL(const CMsvEntry& aParent, const CMsvEntrySelection& aSelection);
00088         CMsvOperation* MessageEditL(TRequestStatus& aStatus);
00089         CMsvOperation* ServiceEditL(TRequestStatus& aStatus);
00090         void SetProgressSuccess(TPckgBuf<TMsvLocalOperationProgress>& aProgress,TMsvId aId);
00091     void CallNewMessagesL();
00092 
00093         void CreateBodyIfNoneL();
00094 
00095 private:
00096         TMsvId iServiceId;
00097     TInt iNewResourceFileOffset;
00098     HBufC* iResourceFileName;
00099    
00100         };
00101 
00102 
00103 //
00104 //      CEditRemoteOperation: remote edit operation
00105 //
00106 class CEditRemoteOperation : public CMsvOperation
00107         {
00108         enum TEditRemoteState
00109                 {
00110                 EStateFinished=0,
00111                 EStateEditing,
00112                 EStateCopying,
00113                 };
00114         
00115         public:
00116                 CEditRemoteOperation(CTextMtmUi& aMtmUi, CMsvSession& aMsvSession, 
00117                         TInt aPriority, TRequestStatus& aObserverRequestStatus);
00118                 ~CEditRemoteOperation();
00119 
00120     public:
00121         void StartL(TMsvEntry& aSourceEntry);
00122         
00123 
00124         public: // from CMsvOperation           
00125                 virtual const TDesC8& ProgressL();
00126 
00127         public: // from CActive
00128                 virtual void DoCancel();
00129                 virtual void RunL();
00130 
00131         private:
00132                 CTextMtmUi& iMtmUi;
00133                 TBuf8<10> iProgress;
00134                 CMsvOperation* iCopyOperation;
00135                 CMsvOperation* iEditOperation;
00136                 TEditRemoteState iState;
00137         };
00138 
00139 #endif // __TXTU_H__

Generated by  doxygen 1.6.2