|
1 // Copyright (c) 2006-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 __ROAPTCONTENTHANDLER_H__ |
|
17 #define __ROAPTCONTENTHANDLER_H__ |
|
18 |
|
19 // System includes |
|
20 // |
|
21 #include <e32base.h> |
|
22 #include <push/ccontenthandlerbase.h> |
|
23 #include "MessageComposer.h" |
|
24 // Local includes |
|
25 // |
|
26 #include "ROCHCAFInterface.h" |
|
27 |
|
28 // Constants |
|
29 // |
|
30 _LIT(KROAPTContentHandlerData,"application/vnd.oma.drm.roap-trigger+xml||application/vnd.oma.drm.roap-trigger+wbxml"); |
|
31 |
|
32 |
|
33 /** |
|
34 * CROAPTContentHandler handles ROAP Trigger content |
|
35 * |
|
36 * This handler takes ownership of the ROAP Trigger message and processes it |
|
37 * |
|
38 * OVERVIEW: |
|
39 * The main body of this class and its functionality lies within |
|
40 * HandleMessage (asynchonous). This : |
|
41 * 1. takes ownership of the push message |
|
42 * 2. processes the received message |
|
43 * 3. finishes |
|
44 */ |
|
45 |
|
46 class CROAPTContentHandler : public CContentHandlerBase |
|
47 /** |
|
48 @internalComponent |
|
49 @released |
|
50 */ |
|
51 { |
|
52 public: // Methods |
|
53 |
|
54 static CROAPTContentHandler* NewL(); |
|
55 |
|
56 virtual ~CROAPTContentHandler(); |
|
57 |
|
58 private: // Methods from CPushHandlerBase |
|
59 |
|
60 virtual void HandleMessageL(CPushMessage* aPushMsg, TRequestStatus& aStatus); |
|
61 |
|
62 virtual void HandleMessageL(CPushMessage* aPushMsg); |
|
63 |
|
64 virtual void CancelHandleMessage(); |
|
65 |
|
66 virtual void CPushHandlerBase_Reserved1(); |
|
67 |
|
68 virtual void CPushHandlerBase_Reserved2(); |
|
69 |
|
70 private: // Methods from CActive |
|
71 |
|
72 virtual void DoCancel(); |
|
73 |
|
74 virtual void RunL(); |
|
75 |
|
76 virtual TInt RunError(TInt aError); |
|
77 |
|
78 private: // Methods |
|
79 |
|
80 CROAPTContentHandler(); |
|
81 |
|
82 void ConstructL(); |
|
83 |
|
84 void ConvertPushMsgL(); |
|
85 |
|
86 void SaveROAPTToXMLFileL(); |
|
87 |
|
88 //call to ROAPTCHCAFInterface |
|
89 void ProcessToCAFL(); |
|
90 |
|
91 void DeleteTempROAPTFile(); |
|
92 |
|
93 |
|
94 private: // Attributes |
|
95 |
|
96 enum TState { EConverting, EStoring, ECAFInterface, EDeleteFile, EDone }; |
|
97 |
|
98 RFs iFs; |
|
99 |
|
100 TInt iPushMsgAction; |
|
101 |
|
102 HBufC8* iData; |
|
103 |
|
104 CROCHCAFInterface* iCAFInterface; |
|
105 |
|
106 }; |
|
107 |
|
108 |
|
109 #endif // __CROAPTContentHandler_H__ |