|
1 /* |
|
2 * Copyright (c) 2003 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: HTTP Connection Handler filter |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CHTTPFILTERIOP_H |
|
21 #define CHTTPFILTERIOP_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <http/mhttpfilter.h> |
|
25 #include "httpfilteriopinterface.h" |
|
26 #include <httpstringconstants.h> |
|
27 |
|
28 |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 // MACROS |
|
33 |
|
34 // DATA TYPES |
|
35 |
|
36 // FUNCTION PROTOTYPES |
|
37 |
|
38 // FORWARD DECLARATIONS |
|
39 class MIopRedirectCallback; |
|
40 |
|
41 // CLASS DECLARATION |
|
42 |
|
43 /** |
|
44 * Http Filter Iop implementation class. |
|
45 * |
|
46 * @lib cannot link with Ecom plugins |
|
47 * @since 2.0 |
|
48 */ |
|
49 |
|
50 class CHttpFilterIop : public CHttpFilterIopInterface, public MHTTPFilter |
|
51 { |
|
52 public: // Constructors and destructor |
|
53 |
|
54 /** |
|
55 * Two-phased constructor. This function replaces NewL |
|
56 */ |
|
57 static CHttpFilterIop* InstallFilterL(TAny* aConnParams); |
|
58 |
|
59 /** |
|
60 * Destructor. |
|
61 */ |
|
62 virtual ~CHttpFilterIop(); |
|
63 |
|
64 public: // Functions from base classes |
|
65 |
|
66 |
|
67 /** |
|
68 * From MHTTPFilterBase Process a transaction event. |
|
69 * @since 2.0 |
|
70 * @param aTransaction The transaction for which an event occured |
|
71 * @param aEvent The event to be processed |
|
72 * @return void |
|
73 */ |
|
74 virtual void MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent); |
|
75 |
|
76 /** |
|
77 * From MHTTPFilterBase Process a session event. |
|
78 * @since 2.0 |
|
79 * @param aEvent The event to be processed |
|
80 * @return void |
|
81 */ |
|
82 virtual void MHFSessionRunL(const THTTPSessionEvent& aEvent); |
|
83 |
|
84 /** |
|
85 * From MHTTPFilterBase Process an error that occured while processing the transaction. |
|
86 * @since 2.0 |
|
87 * @param aError The error that occured |
|
88 * @param aTransaction The transaction for which the error occured |
|
89 * @param aEvent The event during which the error occured |
|
90 * @return KErrNone |
|
91 */ |
|
92 virtual TInt MHFRunError(TInt aError, |
|
93 RHTTPTransaction aTransaction, |
|
94 const THTTPEvent& aEvent); |
|
95 |
|
96 /** |
|
97 * From MHTTPFilterBase Called when MHFRunL leaves from a session event. |
|
98 * @since 2.0 |
|
99 * @param aError The error that occured |
|
100 * @param aEvent The event during which the error occured |
|
101 * @return KErrNone |
|
102 */ |
|
103 virtual TInt MHFSessionRunError(TInt aError, const THTTPSessionEvent& aEvent); |
|
104 |
|
105 /** |
|
106 * From MHTTPFilter Called when the filter is being removed from a session's filter queue. |
|
107 * @since 2.0 |
|
108 * @param aSession The session it's being removed from |
|
109 * @param aHandle The filter handle. |
|
110 * @return void |
|
111 */ |
|
112 virtual void MHFUnload(RHTTPSession aSession, THTTPFilterHandle aHandle); |
|
113 |
|
114 /** |
|
115 * From MHTTPFilter Called when the filter is being added to the session's filter queue. |
|
116 * @since 2.0 |
|
117 * @param aSession The session it's being added to. |
|
118 * @param aHandle The filter handle. |
|
119 * @return void |
|
120 */ |
|
121 virtual void MHFLoad(RHTTPSession aSession, THTTPFilterHandle aHandle); |
|
122 |
|
123 private: |
|
124 |
|
125 /** |
|
126 * C++ default constructor. |
|
127 */ |
|
128 CHttpFilterIop(RHTTPSession* aSession, MIopRedirectCallback* aIopRedirectCallback, TUint aIopCapabilities); |
|
129 |
|
130 /** |
|
131 * By default Symbian 2nd phase constructor is private. |
|
132 */ |
|
133 void ConstructL(); |
|
134 |
|
135 /** |
|
136 * Function to handle only 301 "Moved Permanently", |
|
137 * 302 "Found", and 303 "See Other" and 307 "Temporary Redirect" |
|
138 */ |
|
139 void HandleRedirectL(RHTTPTransaction aTransaction); |
|
140 |
|
141 private: // Data |
|
142 |
|
143 // Counter for how many times the filter was loaded |
|
144 TInt iLoadCount; |
|
145 |
|
146 // The HTTP Session for which the filter was loaded |
|
147 RHTTPSession* iSession; |
|
148 |
|
149 // The redirect callback |
|
150 MIopRedirectCallback* iIopRedirectCallback; |
|
151 |
|
152 // The Iop capabilities options |
|
153 TUint iIopCapabilities; |
|
154 |
|
155 }; |
|
156 |
|
157 #endif // CHTTPFILTERIOP_H |
|
158 |
|
159 // End of File |