|
1 /** |
|
2 * Copyright (c) 2006-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 the License "Symbian Foundation License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * This is the header file for CT_MsgUtilsDeleteAllChildren |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 /** |
|
25 @file |
|
26 */ |
|
27 |
|
28 |
|
29 #ifndef __T_UTILS_DELETE_ALL_CHILDREN_H__ |
|
30 #define __T_UTILS_DELETE_ALL_CHILDREN_H__ |
|
31 |
|
32 |
|
33 // epoc includes |
|
34 #include <msvids.h> |
|
35 |
|
36 // Forward Declaration |
|
37 class CMsvSession; |
|
38 class CMsvOperation; |
|
39 |
|
40 |
|
41 /** |
|
42 Implements a utilty that performs deletion of all the children entries |
|
43 */ |
|
44 class CT_MsgUtilsDeleteAllChildren : public CActive |
|
45 { |
|
46 public: |
|
47 IMPORT_C CT_MsgUtilsDeleteAllChildren(CMsvSession* aSession,TMsvId aParentId = KMsvRootIndexEntryId); |
|
48 ~CT_MsgUtilsDeleteAllChildren(); |
|
49 |
|
50 IMPORT_C void StartL(TRequestStatus& aStatus); |
|
51 IMPORT_C void StartL(TBool aBlockDelete, TRequestStatus& aStatus); |
|
52 |
|
53 // Returns the number of the children entries that are not deleted |
|
54 TInt Undeleted() {return (iUndeletedChildren);} |
|
55 |
|
56 // Gets information about a completed operation. |
|
57 IMPORT_C TInt FinalProgressStatus(CMsvOperation& aOperation,const TRequestStatus& aStatus); |
|
58 |
|
59 protected: |
|
60 void DoCancel(); |
|
61 void RunL(); |
|
62 |
|
63 private: |
|
64 CMsvSession* iSession; |
|
65 TMsvId iParentId; |
|
66 CMsvEntry* iEntry; |
|
67 CMsvEntrySelection* iSelection; |
|
68 TRequestStatus* iRequestStatus; |
|
69 TInt iTotalChildren; |
|
70 TInt iCurrentChild; |
|
71 TInt iUndeletedChildren; |
|
72 CMsvOperation* iOperation; |
|
73 |
|
74 private: |
|
75 enum State |
|
76 { |
|
77 EStateThisLevel, |
|
78 EStateNextLevel, |
|
79 EBlockDelete |
|
80 }; |
|
81 TInt iState; |
|
82 |
|
83 private: |
|
84 CT_MsgUtilsDeleteAllChildren* iNextLevel; |
|
85 }; |
|
86 |
|
87 |
|
88 #endif //__T_UTILS_DELETE_ALL_CHILDREN_H__ |