|
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 __ROCONTENTHANDLER_H__ |
|
17 #define __ROCONTENTHANDLER_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 const TUid KUidPushROContentHandler = { 0x20002247 }; |
|
31 _LIT(KROContentHandlerData,"application/vnd.oma.drm.rights+xml||application/vnd.oma.drm.rights+wbxml"); |
|
32 |
|
33 |
|
34 /** |
|
35 * CROContentHandler handles Rights Object content |
|
36 * |
|
37 * This handler takes ownership of the RO message and processes it |
|
38 * |
|
39 * OVERVIEW: |
|
40 * The main body of this class and its functionality lies within |
|
41 * HandleMessage (asynchonous). This : |
|
42 * 1. takes ownership of the push message |
|
43 * 2. processes the received message |
|
44 * 3. finishes |
|
45 */ |
|
46 |
|
47 class CROContentHandler : public CContentHandlerBase |
|
48 |
|
49 /** |
|
50 @internalComponent |
|
51 @released |
|
52 */ |
|
53 { |
|
54 public: // Methods |
|
55 |
|
56 static CROContentHandler* NewL(); |
|
57 |
|
58 virtual ~CROContentHandler(); |
|
59 |
|
60 private: // Methods from CPushHandlerBase |
|
61 |
|
62 virtual void HandleMessageL(CPushMessage* aPushMsg, TRequestStatus& aStatus); |
|
63 |
|
64 virtual void HandleMessageL(CPushMessage* aPushMsg); |
|
65 |
|
66 virtual void CancelHandleMessage(); |
|
67 |
|
68 virtual void CPushHandlerBase_Reserved1(); |
|
69 |
|
70 virtual void CPushHandlerBase_Reserved2(); |
|
71 |
|
72 private: // Methods from CActive |
|
73 |
|
74 virtual void DoCancel(); |
|
75 |
|
76 virtual void RunL(); |
|
77 |
|
78 virtual TInt RunError(TInt aError); |
|
79 |
|
80 private: // Methods |
|
81 |
|
82 CROContentHandler(); |
|
83 |
|
84 void ConstructL(); |
|
85 |
|
86 void ConvertPushMsgL(); |
|
87 |
|
88 void SaveROToXMLFileL(); |
|
89 |
|
90 //call to ROCHCAFInterface |
|
91 void ProcessToCAFL(); |
|
92 |
|
93 void DeleteTempROFile(); |
|
94 |
|
95 |
|
96 private: // Attributes |
|
97 |
|
98 enum TState { EConverting, EStoring, ECAFInterface, EDeleteFile, EDone }; |
|
99 |
|
100 RFs iFs; |
|
101 |
|
102 TInt iPushMsgAction; |
|
103 |
|
104 HBufC8* iData; |
|
105 |
|
106 CROCHCAFInterface* iCAFInterface; |
|
107 |
|
108 }; |
|
109 |
|
110 |
|
111 #endif // __CROContentHandler_H__ |