|
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 __CSLCONTENTHANDLER_H__ |
|
17 #define __CSLCONTENTHANDLER_H__ |
|
18 |
|
19 // System includes |
|
20 // |
|
21 #include <e32base.h> |
|
22 #include <push/ccontenthandlerbase.h> |
|
23 |
|
24 #include <push/sislpushmsgutils.h> |
|
25 #include "CMsgParser.h" |
|
26 // Constants |
|
27 // |
|
28 const TUid KUidPushSLContentHandler = { 0x101F3E63 }; |
|
29 _LIT(KSLContentHandlerData,"text/vnd.wap.sl||application/vnd.wap.slc"); |
|
30 |
|
31 // Forward class declarations |
|
32 // |
|
33 class CSLPushMsgEntry; |
|
34 |
|
35 /** |
|
36 * CSLContentHandler Handles Service Loading Content |
|
37 * |
|
38 */ |
|
39 //##ModelId=3B659DA80207 |
|
40 class CSLContentHandler : public CContentHandlerBase, public MWAPElementHandler |
|
41 /** |
|
42 @internalComponent |
|
43 @released |
|
44 */ |
|
45 { |
|
46 public: // Methods |
|
47 |
|
48 static CSLContentHandler* NewL(); |
|
49 |
|
50 virtual ~CSLContentHandler(); |
|
51 |
|
52 private: // Methods from CPushHandlerBase |
|
53 |
|
54 virtual void HandleMessageL(CPushMessage* aPushMsg, TRequestStatus& aStatus); |
|
55 |
|
56 virtual void HandleMessageL(CPushMessage* aPushMsg); |
|
57 |
|
58 virtual void CancelHandleMessage(); |
|
59 |
|
60 virtual void CPushHandlerBase_Reserved1(); |
|
61 |
|
62 virtual void CPushHandlerBase_Reserved2(); |
|
63 private: |
|
64 // From MWAPElementHandler |
|
65 void HandleElementL ( const RString& aTag, const RString& aAttributeName, const RString& aAttributeValue ); |
|
66 void HandleContentL ( const TDesC8& aBytes ); |
|
67 |
|
68 private: // Methods from CActive |
|
69 |
|
70 virtual void DoCancel(); |
|
71 |
|
72 virtual void RunL(); |
|
73 |
|
74 virtual TInt RunError(TInt aError); |
|
75 |
|
76 private: // Methods |
|
77 |
|
78 CSLContentHandler(); |
|
79 |
|
80 void ConstructL(); |
|
81 |
|
82 void ParsePushMsgL(); |
|
83 |
|
84 void SetSlPushMsgEntryFieldsL(CSLPushMsgEntry& aSlPushMsgEntry); |
|
85 |
|
86 void SearchingForDuplicatesMsgEntryL(); |
|
87 |
|
88 void ProcessingPushMsgEntryL(); |
|
89 |
|
90 private: // Attributes |
|
91 |
|
92 enum TState { EParsing, ESearching, EProcessing, EDone }; |
|
93 |
|
94 CSISLPushMsgUtils* iWapPushUtils; |
|
95 |
|
96 TInt iPushMsgAction; |
|
97 |
|
98 HBufC* iHrefBuf; |
|
99 |
|
100 TMsvId iSlMsgEntryId; |
|
101 |
|
102 }; |
|
103 |
|
104 #endif // __CSLCONTENTHANDLER_H__ |