|
1 // Copyright (c) 2001-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 // |
|
15 |
|
16 #ifndef __CMULTIPARTRELANDALTCONTENTHANDLER_H__ |
|
17 #define __CMULTIPARTRELANDALTCONTENTHANDLER_H__ |
|
18 |
|
19 // System includes |
|
20 // |
|
21 #include <e32base.h> |
|
22 #include <push/pushmessage.h> |
|
23 #include <push/ccontenthandlerbase.h> |
|
24 #include "cmultipartbiniterator.h" |
|
25 |
|
26 // Local includes |
|
27 // |
|
28 |
|
29 // Constants |
|
30 // |
|
31 const TUid KUidPushMultiPartRelAndAltContentHandler = { 0x101F3E65 }; |
|
32 |
|
33 // Forward class declarations |
|
34 // |
|
35 class CWapPushMsgUtils; |
|
36 |
|
37 /** |
|
38 * The MultiPart/Alternative & Multipart/Alternative Content Handler |
|
39 * |
|
40 * Saves the whole message in the Message Server, each part getting saved as a child |
|
41 * entry to the main part. |
|
42 * |
|
43 */ |
|
44 //##ModelId=3B659EE400DB |
|
45 class CMultiPartRelAndAltContentHandler : public CContentHandlerBase |
|
46 /** |
|
47 @internalComponent |
|
48 @released |
|
49 */ |
|
50 { |
|
51 public: // Methods |
|
52 |
|
53 static CMultiPartRelAndAltContentHandler* NewL(); |
|
54 |
|
55 virtual ~CMultiPartRelAndAltContentHandler(); |
|
56 |
|
57 private: // Methods from CPushHandlerBase |
|
58 |
|
59 virtual void HandleMessageL(CPushMessage* aPushMsg, TRequestStatus& aStatus); |
|
60 |
|
61 virtual void HandleMessageL(CPushMessage* aPushMsg); |
|
62 |
|
63 virtual void CancelHandleMessage(); |
|
64 |
|
65 virtual void CPushHandlerBase_Reserved1(); |
|
66 |
|
67 virtual void CPushHandlerBase_Reserved2(); |
|
68 |
|
69 private: // Methods from CActive |
|
70 |
|
71 virtual void DoCancel(); |
|
72 |
|
73 virtual void RunL(); |
|
74 |
|
75 virtual TInt RunError(TInt aError); |
|
76 |
|
77 private: // Methods |
|
78 |
|
79 CMultiPartRelAndAltContentHandler(); |
|
80 |
|
81 void ConstructL(); |
|
82 |
|
83 void LoadMultiPartMsgL(); |
|
84 |
|
85 void HandlePartL(); |
|
86 |
|
87 void NextPartL(); |
|
88 |
|
89 void SaveMsgRootL(); |
|
90 |
|
91 void LoadMsgDataL(); |
|
92 |
|
93 void SetMsgCorruptFlagL(); |
|
94 |
|
95 private: // Attributes |
|
96 |
|
97 enum TState { ELoadMsgData, EHandlePart, EDone, ENextPart }; |
|
98 |
|
99 RFs iFs; |
|
100 |
|
101 TInt iState; //state machine |
|
102 |
|
103 TMsvId iMsgEntryId; |
|
104 |
|
105 CWapPushMsgUtils* iPushUtilities; |
|
106 |
|
107 CMultipartIteratorBase* iMultiMessage; |
|
108 |
|
109 }; |
|
110 |
|
111 |
|
112 #endif // __CMULTIPARTRELANDALTCONTENTHANDLER_H__ |