00001
00002
00003
00004
00005
00006 #ifndef _TXTSCPMV_H_
00007 #define _TXTSCPMV_H_
00008
00009 #if !defined(__MSVSTD_H__)
00010 #include <msvstd.h>
00011 #endif
00012 #if !defined(__MSVENTRY_H__)
00013 #include <msventry.h>
00014 #endif
00015
00016 #if !defined(__TXUT_H__)
00017 #include "txut.h"
00018 #endif
00019
00020 #define ETxtRetrievingMessage 1
00021 #define ETxtFinished 0
00022
00023
00024 const TInt KMsgTxtRefreshMailboxPriority = 1;
00025
00026 class CParaFormatLayer;
00027 class CCharFormatLayer;
00028 class CMsvServerEntry;
00029 class CTxtCopyMoveBase;
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 class CTxtActiveOper : public CActive
00040 {
00041 public:
00042 CTxtActiveOper(RFs& aFs, CMsvServerEntry& aServerEntry);
00043 virtual ~CTxtActiveOper();
00044 void Start(TMsvId& aSourceId, TMsvId& aDestId, TRequestStatus& aStatus);
00045 void SetCurrentCaller(CTxtCopyMoveBase* aCurrentCaller);
00046 public:
00047 virtual CTxtActiveOper* CopyConstructL()=0;
00048
00049
00050 virtual TBool CopiedHeader() const = 0;
00051
00052
00053 virtual TBool DeleteSourceAfterwards() const = 0;
00054
00055
00056
00057
00058 virtual TBool MoveIsToService() const = 0;
00059 protected:
00060
00061
00062 void RunL();
00063 virtual void DoRunL()=0;
00064 virtual void DoCancel();
00065 protected:
00066 TRequestStatus* iReportStatus;
00067 CMsvServerEntry& iServerEntry;
00068 RFs &iFs;
00069 TMsvId iSourceId;
00070 TMsvId iDestId;
00071 CTxtCopyMoveBase* iCurrentCaller;
00072 TFileName iFileName;
00073 };
00074
00075
00076
00077
00078
00079
00080
00081 class CTxtCopyMoveBase : public CActive
00082 {
00083 public:
00084 static CTxtCopyMoveBase* NewL(CTxtActiveOper* aActiveOperation, const CMsvEntrySelection& aSource,
00085 CMsvServerEntry& aDestination, TMsvId& aServiceEntryId, TParse& aParse);
00086 CTxtCopyMoveBase* CopyConstructL(const CMsvEntrySelection& aSource);
00087 ~CTxtCopyMoveBase();
00088 void Start(TRequestStatus& aStatus);
00089 TTxtProgress& Progress();
00090 protected:
00091 CTxtCopyMoveBase(CTxtActiveOper* aActiveOperation, const CMsvEntrySelection& aSource,
00092 CMsvServerEntry& aDestination, TMsvId& aServiceEntryId, TParse& aParse);
00093 void ConstructL();
00094 void DoCancel();
00095 void RunL();
00096 void DoRunL();
00097 private:
00098 void CheckDeleteSource();
00099 void SetupNewEntryL(TMsvId& SourceMsgId, TMsvId& newDestMsvId);
00100 private:
00101 TInt iTxtCopyMoveState;
00102 CTxtActiveOper* iActiveOperation;
00103 const CMsvEntrySelection& iSource;
00104 CMsvServerEntry& iDestination;
00105 TMsvId iServiceEntryId;
00106 TMsvId iDestId;
00107 TInt iMsgCounter;
00108 TTxtProgress iProgress;
00109 TRequestStatus* iReportStatus;
00110 public:
00111
00112 TParse& iServiceDestinationpath;
00113 };
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125 class CTxtCopyToLocalOp : public CTxtActiveOper
00126 {
00127 public:
00128 CTxtActiveOper* CopyConstructL();
00129 CTxtCopyToLocalOp(RFs& aFs, CMsvServerEntry& aServerEntry)
00130 : CTxtActiveOper(aFs, aServerEntry) {};
00131 TBool CopiedHeader() const;
00132 virtual TBool DeleteSourceAfterwards() const;
00133 TBool MoveIsToService() const;
00134 protected:
00135 void DoRunL();
00136 private:
00137 void DoMessageCopyToLocalL();
00138 };
00139
00140 class CTxtCopyFromLocalOp : public CTxtActiveOper
00141 {
00142 public:
00143 CTxtActiveOper* CopyConstructL();
00144 CTxtCopyFromLocalOp(RFs& aFs, CMsvServerEntry& aServerEntry)
00145 : CTxtActiveOper(aFs, aServerEntry) {};
00146 TBool CopiedHeader() const;
00147 virtual TBool DeleteSourceAfterwards() const;
00148 TBool MoveIsToService() const;
00149 protected:
00150 void DoRunL();
00151 private:
00152 void DoMessageCopyFromLocalL(const TMsvEntry& aEntry);
00153 };
00154
00155 class CTxtCopyWithinServiceOp : public CTxtActiveOper
00156 {
00157 public:
00158 CTxtActiveOper* CopyConstructL();
00159 CTxtCopyWithinServiceOp(RFs& aFs, CMsvServerEntry& aServerEntry)
00160 : CTxtActiveOper(aFs, aServerEntry) {};
00161 TBool CopiedHeader() const;
00162 virtual TBool DeleteSourceAfterwards() const;
00163 TBool MoveIsToService() const ;
00164 protected:
00165 void DoRunL();
00166 private:
00167 void DoMessageCopyWithinServiceL();
00168 };
00169
00170
00171
00172
00173
00174
00175
00176 class CTxtMoveToLocalOp : public CTxtCopyToLocalOp
00177 {
00178 public:
00179 CTxtActiveOper* CopyConstructL();
00180 CTxtMoveToLocalOp(RFs& aFs, CMsvServerEntry& aServerEntry)
00181 : CTxtCopyToLocalOp(aFs, aServerEntry) {};
00182 TBool DeleteSourceAfterwards() const;
00183 };
00184
00185 class CTxtMoveFromLocalOp : public CTxtCopyFromLocalOp
00186 {
00187 public:
00188 CTxtActiveOper* CopyConstructL();
00189 CTxtMoveFromLocalOp(RFs& aFs, CMsvServerEntry& aServerEntry)
00190 : CTxtCopyFromLocalOp(aFs, aServerEntry) {};
00191 TBool DeleteSourceAfterwards() const;
00192 };
00193
00194 class CTxtMoveWithinServiceOp : public CTxtCopyWithinServiceOp
00195 {
00196 public:
00197 CTxtActiveOper* CopyConstructL();
00198 CTxtMoveWithinServiceOp(RFs& aFs, CMsvServerEntry& aServerEntry)
00199 : CTxtCopyWithinServiceOp(aFs, aServerEntry) {};
00200 TBool DeleteSourceAfterwards() const;
00201 };
00202
00203
00204
00205
00206
00207 class CTxtDeleteOp : public CTxtActiveOper
00208 {
00209 public:
00210 CTxtActiveOper* CopyConstructL();
00211 CTxtDeleteOp(RFs& aFs, CMsvServerEntry& aServerEntry)
00212 : CTxtActiveOper(aFs, aServerEntry) {};
00213 TBool CopiedHeader() const;
00214 TBool DeleteSourceAfterwards() const;
00215 TBool MoveIsToService() const;
00216 protected:
00217 void DoRunL();
00218 };
00219
00220
00221 inline void CTxtActiveOper::SetCurrentCaller(CTxtCopyMoveBase* aCurrentCaller)
00222 {
00223 iCurrentCaller = aCurrentCaller;
00224 }
00225
00226
00227 #endif
00228