|
1 /* |
|
2 * Copyright (c) 2009 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: Operation which performs either copy or deletion of entries from the sim. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __SIMMESSAGEDELETECOPYOPERATION_H__ |
|
19 #define __SIMMESSAGEDELETECOPYOPERATION_H__ |
|
20 |
|
21 |
|
22 // INCLUDES |
|
23 #include <msvstd.h> // TMsvId |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CSmsMtmUi; |
|
27 class CMsvSession; |
|
28 class CCoeEnv; |
|
29 class CAknProgressDialog; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * CSimDeleteCopyOperation |
|
35 * Operation which performs either copy or delete entries from the sim |
|
36 * Gets array of messages to be copied or deleted and then performs |
|
37 * copy or delete operation one by one and updates progress dialog |
|
38 * after every copy or delete operation. |
|
39 * Does not take ownership of progress note, it should be created |
|
40 * and deleted by other components. |
|
41 */ |
|
42 NONSHARABLE_CLASS( CSimDeleteCopyOperation ) : public CMsvOperation |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * Two-phased constructor, copying operation |
|
48 * @param aMsvSession: reference to object of CMsvSession |
|
49 * @param aSmsMtmUi: reference to sms mtm ui object |
|
50 * @param aObserverRequestStatus: TRequest of the observing object |
|
51 * @param aSelection: pointer to the array of messages to be deleted or copied. |
|
52 * Note! Copies array so does not take ownership for the array |
|
53 * @param aDestination: if of the folder where messages are copied |
|
54 * @param aProgressDialog: reference to progress dialog, which is updated |
|
55 * @param aCoeEnv: pointer to CCoeEnv for StringLoader |
|
56 */ |
|
57 static CSimDeleteCopyOperation* NewL( |
|
58 CMsvSession& aMsvSession, |
|
59 CSmsMtmUi& aSmsMtmUi, |
|
60 TRequestStatus& aObserverRequestStatus, |
|
61 CMsvEntrySelection* aSelection, |
|
62 TMsvId aDestinationId, |
|
63 CAknProgressDialog& aProgressDialog, |
|
64 CCoeEnv* aCoeEnv ); |
|
65 |
|
66 /** |
|
67 * Constructor, deleting operation |
|
68 * @param aMsvSession: reference to object of CMsvSession |
|
69 * @param aSmsMtmUi: reference to sms mtm ui object |
|
70 * @param aObserverRequestStatus: TRequest of the observing object |
|
71 * @param aSelection: pointer to the array of messages to be deleted or copied. |
|
72 * Note! Copies array so does not take ownership for the array |
|
73 * @param aProgressDialog: reference to progress dialog, which is updated |
|
74 * @param aCoeEnv: pointer to CCoeEnv for StringLoader |
|
75 */ |
|
76 static CSimDeleteCopyOperation* NewL( |
|
77 CMsvSession& aMsvSession, |
|
78 CSmsMtmUi& aSmsMtmUi, |
|
79 TRequestStatus& aObserverRequestStatus, |
|
80 CMsvEntrySelection* aSelection, |
|
81 CAknProgressDialog& aProgressDialog, |
|
82 CCoeEnv* aCoeEnv ); |
|
83 |
|
84 /** |
|
85 * Destructor. |
|
86 */ |
|
87 virtual ~CSimDeleteCopyOperation(); |
|
88 |
|
89 public: // New functions |
|
90 |
|
91 /** |
|
92 * Sets operation to be cancelled after next copy or delete |
|
93 * operation is completed. |
|
94 */ |
|
95 void CancelAfterCurrentCompleted(); |
|
96 |
|
97 public: // Functions from base classes |
|
98 |
|
99 /** |
|
100 * from CMsvOperation |
|
101 */ |
|
102 virtual const TDesC8& ProgressL(); |
|
103 |
|
104 public: // New functions |
|
105 |
|
106 /** |
|
107 * Starts next copy or move operation, traps MakeNextDeleteCopyL |
|
108 */ |
|
109 void DeleteCopyNext(); |
|
110 |
|
111 /** |
|
112 * Starts next copy or move operation |
|
113 */ |
|
114 void MakeNextDeleteCopyL(); |
|
115 |
|
116 private: // Functions from base classes |
|
117 |
|
118 /** |
|
119 * From CActive |
|
120 */ |
|
121 void DoCancel(); |
|
122 /** |
|
123 * From CActive |
|
124 */ |
|
125 void RunL(); |
|
126 |
|
127 private: |
|
128 |
|
129 /** |
|
130 * Constructor. |
|
131 */ |
|
132 CSimDeleteCopyOperation( |
|
133 CMsvSession& aMsvSession, |
|
134 CSmsMtmUi& aSmsMtmUi, |
|
135 TRequestStatus& aObserverRequestStatus, |
|
136 TMsvId aDestinationId, |
|
137 CAknProgressDialog& aProgressDialog, |
|
138 TBool aCopying, |
|
139 CCoeEnv* aCoeEnv ); |
|
140 |
|
141 /** |
|
142 * Constructor. |
|
143 */ |
|
144 void ConstructL( |
|
145 CMsvEntrySelection* aSelection ); |
|
146 |
|
147 |
|
148 private: // Data |
|
149 CMsvOperation* iOperation; |
|
150 CMsvEntrySelection* iEntrySelection; |
|
151 TMsvId iDestinationId; |
|
152 TBool iCopying; |
|
153 TInt iCurrentEntryIndex; |
|
154 TInt iEntryCount; |
|
155 TBool iCanceling; |
|
156 CSmsMtmUi& iSmsMtmUi; |
|
157 CAknProgressDialog& iProgressDialog; |
|
158 CCoeEnv* iCoeEnv; |
|
159 TBuf8<1> iBlank; |
|
160 TMsvId iSmsServiceId; |
|
161 HBufC* iNoteString; |
|
162 }; |
|
163 |
|
164 #endif |
|
165 |
|
166 // End of File |