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