|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Operation to delete mail messages locally i.e. just remove body and |
|
16 * attachments from the flash but leave header. So don't delete message |
|
17 * from mail server. After operation user is able to fetch message again. |
|
18 * |
|
19 * |
|
20 */ |
|
21 |
|
22 |
|
23 #ifndef IMUMDELETEMESSAGESLOCALLY_H |
|
24 #define IMUMDELETEMESSAGESLOCALLY_H |
|
25 |
|
26 // INCLUDES |
|
27 #include <e32base.h> // Basic Symbian Includes |
|
28 #include <cacheman.h> // CImCacheManager |
|
29 #include <MsvPrgReporter.h> // MMsvProgressDecoder |
|
30 #include <centralrepository.h> // CRepository |
|
31 #include <ImumInternalApi.h> // CImumInternalApi |
|
32 |
|
33 // CONSTANTS |
|
34 // MACROS |
|
35 // DATA TYPES |
|
36 // FUNCTION PROTOTYPES |
|
37 // FORWARD DECLARATIONS |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * Operation to delete mail messages locally i.e. just remove body and |
|
42 * attachments from the flash but leave header. So don't delete message |
|
43 * from mail server. After operation user is able to fetch message again. |
|
44 */ |
|
45 class CImumDeleteMessagesLocally : |
|
46 public CImCacheManager, |
|
47 public MMsvProgressDecoder |
|
48 { |
|
49 public: // Constructors and destructor |
|
50 |
|
51 /** |
|
52 * Two-phased constructor. |
|
53 * @param aMessageSelection array of message ids to be purged |
|
54 * @param aMsvSession |
|
55 * @param aObserverRequestStatus |
|
56 * @param aDiskSpaceRequest: If ETrue, request disk space |
|
57 * @return pointer to created CImumDeleteMessagesLocally object. |
|
58 */ |
|
59 static CImumDeleteMessagesLocally* NewL( |
|
60 CMsvEntrySelection& aMessageSelection, |
|
61 CImumInternalApi& aMailboxApi, |
|
62 TRequestStatus& aObserverRequestStatus, |
|
63 TBool aDiskSpaceRequest = ETrue); |
|
64 |
|
65 /** |
|
66 * destructor |
|
67 */ |
|
68 virtual ~CImumDeleteMessagesLocally(); |
|
69 |
|
70 public: // Functions from base classes |
|
71 /** |
|
72 * From MMsvProgressDecoder |
|
73 */ |
|
74 virtual TInt DecodeProgress ( |
|
75 const TDesC8& aProgress, |
|
76 TBuf<CBaseMtmUi::EProgressStringMaxLen>& aReturnString, |
|
77 TInt& aTotalEntryCount, |
|
78 TInt& aEntriesDone, |
|
79 TInt& aCurrentEntrySize, |
|
80 TInt& aCurrentBytesTrans, |
|
81 TBool aInternal); |
|
82 |
|
83 |
|
84 protected: // Constructors |
|
85 /** |
|
86 * Symbian OS constructor. |
|
87 * @param aMessageSelection array of message ids to be purged |
|
88 */ |
|
89 void ConstructL(CMsvEntrySelection& aMessageSelection ); |
|
90 |
|
91 private: |
|
92 /** |
|
93 * from CImCacheManager |
|
94 */ |
|
95 TBool Filter() const; |
|
96 |
|
97 private: // Constructors |
|
98 /** |
|
99 * C++ constructor |
|
100 */ |
|
101 CImumDeleteMessagesLocally( |
|
102 CImumInternalApi& aMailboxApi, |
|
103 TRequestStatus& aObserverRequestStatus, |
|
104 TBool aDiskSpaceRequest); |
|
105 |
|
106 private: // data |
|
107 |
|
108 CMsvEntrySelection* iMessageSelection; |
|
109 // File session |
|
110 RFs iFileSession; |
|
111 // Flag to inform of reserved disk space |
|
112 TBool iDiskSpaceRequest; |
|
113 // Currently used drive for deletion |
|
114 TInt iDriveNo; |
|
115 // Text buffer for progress note |
|
116 HBufC* iProgressText; |
|
117 }; |
|
118 |
|
119 #endif // IMUMDELETEMESSAGESLOCALLY_H |
|
120 |
|
121 // End of File |