|
1 /* |
|
2 * Copyright (c) 2002-2007 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: State machine -based operation for restoring sinle attachment. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CMSGMAILRESTOREATTAOP_H |
|
21 #define CMSGMAILRESTOREATTAOP_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "cmsgmailbaseop.h" |
|
25 #include <msvapi.h> |
|
26 |
|
27 // DATA TYPES |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class MsgMailDRMHandler; |
|
31 class MMsvAttachmentManager; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 /** |
|
35 * State machine -based operation for restoring sinle attachment. |
|
36 * This class is used by it's parent CMsgMailRestoreAttaOp. |
|
37 * This operation modifies the attachment model as necessary. |
|
38 */ |
|
39 NONSHARABLE_CLASS( CMsgMailRestoreAttaOp ) : public CMsgMailBaseOp |
|
40 { |
|
41 protected: |
|
42 |
|
43 enum TLaunchState |
|
44 { |
|
45 ECheckAttaMime = EFirstFreeState, // check & update mime type |
|
46 ECheckAttaDRM, // check DRM status |
|
47 EFinalize // finalize operation |
|
48 }; |
|
49 |
|
50 public: // Constructors and destructor |
|
51 |
|
52 /** |
|
53 * Two-phased constructor. |
|
54 * @aIndex attachment's index |
|
55 * @param aDocument Editor's document |
|
56 */ |
|
57 static CMsgMailRestoreAttaOp* NewL( |
|
58 TInt aIndex, |
|
59 CMsgMailEditorDocument& aDocument ); |
|
60 |
|
61 /** |
|
62 * Destructor. Cancels operation. |
|
63 */ |
|
64 ~CMsgMailRestoreAttaOp(); |
|
65 |
|
66 protected: // from CMsgMailBaseOp |
|
67 |
|
68 void SetNextState(); |
|
69 |
|
70 void HandleStateActionL(); |
|
71 |
|
72 void HandleOperationCancel(); |
|
73 |
|
74 private: // Implementation |
|
75 |
|
76 void CheckAttaMimeL(); |
|
77 |
|
78 void CheckAttaDRML(); |
|
79 |
|
80 void Finalize(); |
|
81 |
|
82 private: |
|
83 |
|
84 /** |
|
85 * Constructor. |
|
86 * @aIndex attachment's index |
|
87 * @param aDocument Editor's document |
|
88 */ |
|
89 CMsgMailRestoreAttaOp( TInt aIndex, |
|
90 CMsgMailEditorDocument& aDocument ); |
|
91 |
|
92 /** |
|
93 * By default Symbian 2nd phase constructor is private. |
|
94 */ |
|
95 void ConstructL(); |
|
96 |
|
97 private: |
|
98 |
|
99 // Boolean which tells if DRM check noticed that attachment is |
|
100 // forward locked and thereby removed from attachment list |
|
101 TBool iIsFLAtta; |
|
102 |
|
103 // Index of this attachment |
|
104 TInt iIndex; |
|
105 |
|
106 // Attachment manager, not own |
|
107 MMsvAttachmentManager* iManager; |
|
108 |
|
109 // DRM handler, own |
|
110 MsgMailDRMHandler* iDrmHandler; |
|
111 }; |
|
112 |
|
113 #endif // CMSGMAILRESTOREATTAOP_H |
|
114 |
|
115 // End of File |