|
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // CImapCompoundDeleteFolderFolder.h |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef __CIMAPCOMPOUNDDELETEFOLDER_H__ |
|
19 #define __CIMAPCOMPOUNDDELETEFOLDER_H__ |
|
20 |
|
21 #include "cimapcompoundbase.h" |
|
22 #include "tmessageflaginfo.h" |
|
23 |
|
24 // Forward declarations |
|
25 class CImapFolder; |
|
26 |
|
27 /** |
|
28 Compound operation class performs the sequence of IMAP Session calls necessary |
|
29 to delete a remote folder (mailbox). This requires the contents of the mailbox |
|
30 to be deleted before issuing the DELETE command. Also calls CImapSyncManager |
|
31 methods to remove the folder from the local mail store as appropriate. |
|
32 |
|
33 Stop For Migrate Policy: |
|
34 If multiple folders selected for delete, will complete the current folder |
|
35 |
|
36 @internalTechnology |
|
37 @prototype |
|
38 */ |
|
39 class CImapCompoundDeleteFolder : public CImapCompoundBase |
|
40 { |
|
41 public: |
|
42 ~CImapCompoundDeleteFolder(); |
|
43 |
|
44 static CImapCompoundDeleteFolder* NewL(CImapSyncManager& aSyncManager, CMsvServerEntry& aServerEntry, CImapSettings& aImapSettings, const CMsvEntrySelection& aSourceSel); |
|
45 |
|
46 virtual void StartOperation(TRequestStatus& aStatus, CImapSession& aSession); |
|
47 virtual void Progress(TImap4CompoundProgress& aCompoundProgress); |
|
48 |
|
49 // Support for Bearer Mobility |
|
50 virtual void ResumeOperationL(TRequestStatus& aStatus, CImapSession& aSession); |
|
51 |
|
52 private: |
|
53 CImapCompoundDeleteFolder(CImapSyncManager& aSyncManager, CMsvServerEntry& aServerEntry, CImapSettings& aImapSettings); |
|
54 void ConstructL(const CMsvEntrySelection& aSourceSel); |
|
55 |
|
56 TBool DoRunLoopL(); |
|
57 void DoCancel(); |
|
58 |
|
59 virtual TInt ProcessNegativeServerResponse(); |
|
60 |
|
61 void SelectSourceMailboxL(); |
|
62 void DeleteAllMessagesL(); |
|
63 void DeleteLocalFolderL(); |
|
64 |
|
65 void IncrementProgress(); |
|
66 |
|
67 private: |
|
68 CMsvEntrySelection* iDeleteSel; |
|
69 |
|
70 // no ownership of iFolder - this is a pointer to an |
|
71 // CImapFolder object owned by the CImapSyncManager |
|
72 CImapFolder* iFolder; |
|
73 |
|
74 // number of folders to delete |
|
75 TInt iFoldersToDelete; |
|
76 TInt iFoldersDone; |
|
77 |
|
78 // set true if failed to delete remote folder |
|
79 TBool iRemoteFolderNotDeleted; |
|
80 |
|
81 |
|
82 RArrayMessageFlagInfo iOutMessageFlagInfo; |
|
83 }; |
|
84 |
|
85 #endif // __CIMAPCOMPOUNDDELETEFOLDER_H__ |