00001
00002
00003
00004
00005
00006 #ifndef __TXTU_H__
00007 #define __TXTU_H__
00008
00009
00010 #include <mtmuibas.h>
00011
00012
00013 #include "../../Util/inc/txut.h"
00014
00015
00016
00017
00018
00019 class CTextMtmUi : public CBaseMtmUi
00020 {
00021 public:
00022
00023 static CTextMtmUi* NewL(CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll);
00024
00025 ~CTextMtmUi();
00026
00027
00028
00029 public:
00030
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
00040 virtual CMsvOperation* EditL(TRequestStatus& aStatus);
00041 virtual CMsvOperation* EditL(TRequestStatus& aStatus, const CMsvEntrySelection& aSelection) ;
00042
00043
00044 virtual CMsvOperation* ViewL(TRequestStatus& aStatus);
00045 virtual CMsvOperation* ViewL(TRequestStatus& aStatus, const CMsvEntrySelection& aSelection);
00046
00047
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
00054 virtual CMsvOperation* ReplyL(TMsvId aDestination, TMsvPartList aPartList, TRequestStatus& aCompletionStatus);
00055 virtual CMsvOperation* ForwardL(TMsvId aDestination, TMsvPartList aPartList, TRequestStatus& aCompletionStatus);
00056
00057
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
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
00077 void GetResourceFileName(TFileName& aFileName) const;
00078
00079 protected:
00080 CTextMtmUi(CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll);
00081 void TxtConstructL();
00082
00083 private:
00084
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
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:
00125 virtual const TDesC8& ProgressL();
00126
00127 public:
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__