|
1 /* |
|
2 * Copyright (c) 2007 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 the License "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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef THttpConnUtils_H |
|
19 #define THttpConnUtils_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32base.h> |
|
23 #include <BrCtlDefs.h> |
|
24 #include "HttpDefs.h" |
|
25 |
|
26 // CONSTANTS |
|
27 |
|
28 // MACROS |
|
29 |
|
30 // DATA TYPES |
|
31 |
|
32 // FUNCTION PROTOTYPES |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 |
|
36 // CLASS DECLARATION |
|
37 class RStringPool; |
|
38 class RStringF; |
|
39 class THTTPHdrVal; |
|
40 class RString; |
|
41 class RFs; |
|
42 |
|
43 /** |
|
44 * This is an internal utility class |
|
45 */ |
|
46 class THttpConnUtils |
|
47 { |
|
48 public: // New functions |
|
49 |
|
50 /** |
|
51 * Panic the loader |
|
52 * @since 3.1 |
|
53 * @param aError OS wide error code |
|
54 * @return |
|
55 */ |
|
56 static void PanicLoader( TInt aError ); |
|
57 |
|
58 /** |
|
59 * Write log |
|
60 * @since 3.1 |
|
61 * @param |
|
62 * @return |
|
63 */ |
|
64 static void WriteLog( TPtrC aBuf, TInt aStatus ); |
|
65 |
|
66 /** |
|
67 * Checks if the content is wml |
|
68 * @since 3.1 |
|
69 * @param |
|
70 * @return |
|
71 */ |
|
72 static TBool WmlContent( const TDesC& aContentType ); |
|
73 |
|
74 /** |
|
75 * Checks if the content is wml |
|
76 * @since 3.1 |
|
77 * @param |
|
78 * @return |
|
79 */ |
|
80 static TInt MapHttpErrors( TInt aError ); |
|
81 /** |
|
82 * return true if intrapage navigation is needed |
|
83 * @since 3.1 |
|
84 * @param aUrl1 |
|
85 * @param aUrl2 |
|
86 * @return |
|
87 */ |
|
88 static TBool IsIntraPageNavigation( const TDesC& aUrl1, const TDesC& aUrl2 ); |
|
89 |
|
90 /** |
|
91 * Convert the settings characterset from TUint to RString |
|
92 * @since 3.1 |
|
93 * @param aStringPool The stringpool used for creating the RString. |
|
94 * @param aCharset The characterset representation to be converted. |
|
95 * @return The corresponding charset. |
|
96 */ |
|
97 static THTTPHdrVal ConvertCharset( RStringPool aStringPool, TUint aCharset ); |
|
98 |
|
99 /** |
|
100 * Create an RString object from a UCS2 buffer. |
|
101 * @since 3.1 |
|
102 * @param aStringPool The stringpool to use for creating the string. |
|
103 * @param aStr The UCS2 string to be converted. |
|
104 * @param aString The new RString object. |
|
105 * @return KErrNone or KErrNoMemory. |
|
106 */ |
|
107 static TInt OpenStringFromUnicode( RStringPool aStringPool, TUint16* aStr, |
|
108 RString& aString ); |
|
109 |
|
110 /** |
|
111 * Convert a UCS2 buffer to ascii. |
|
112 * @since 3.1 |
|
113 * @param aUsc2Ptr A descriptor to the buffer to convert. |
|
114 * @param aAsciiPtr A descriptor to the converted buffer. |
|
115 * @return KErrNone or KErrNoMemory. |
|
116 */ |
|
117 static TInt ConvertPtrUsc2ToAscii( const TPtrC& aUsc2Ptr, TPtrC8& aAsciiPtr, TUint8** retPtr ); |
|
118 |
|
119 }; |
|
120 |
|
121 #endif // THttpConnUtils_H |
|
122 |
|
123 // End of File |