1 // Copyright (c) 1999-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // WAP Engine Standard
15 // Standard status codes used by data handlers and the WAP engine. Note that some are exact duplicates of error
16 // codes from sub-components (e.g. HTTP) or from components outside of the WAP Browser (e.g. NetDial, ETEL)
26 #ifndef __WAPENGINESTANDARD_H__
27 #define __WAPENGINESTANDARD_H__
34 // Status code offset for HTTP status values and stack connection progress
35 // e.g. HTTP/200 becomes KHttpPluginStatusBase + 200
37 const TInt KHttpPluginStatusBase = 1000;
38 const TInt KWapDocumentLoadStatusBase = 2000;
40 typedef enum TWapEngineStatus
43 // Some of these errors MAY be handled in the control level.
46 // HTTP/1.1 Status/Error codes from 40x and 50x series
48 EWapErrHttp_505_HTTPVersionNotSupported = -20505, // has to be 1.1 at the client end; talking to a 1.0 origin server might cause this? Or the client erroneously claiming to do HTTP/3 or something.
49 EWapErrHttp_504_GatewayTimeout = -20504, // not sure if this refers to Gateway in the WAP sense
50 EWapErrHttp_503_ServiceUnavailable = -20503, // ?
51 EWapErrHttp_502_BadGateway = -20502, // could occur with a badly configured WAP GW = e.g. the gateway uses a proxy which cannot be reached = there should probably be some indication to the user.
52 EWapErrHttp_501_NotImplemented = -20501, // duh. Bad server.
53 EWapErrHttp_500_InternalServerError = -20500, // bad news again; this one can either come from the origin server _or_ from the WAP GW, which may convert a different server code into 500 if the WML is bad. Report.
55 EWapErrHttp_415_UnsupportedMediaType = -20415, // see RFC2068
56 EWapErrHttp_414_RequestUriTooLong = -20414, // report to user
57 EWapErrHttp_413_RequestEntityTooLarge = -20413, // see RFC2068
58 EWapErrHttp_412_PreconditionFailed = -20412, // see RFC2068
59 EWapErrHttp_411_LengthRequired = -20411, // error in our use of HTTP if this occurs.
60 EWapErrHttp_410_Gone = -20410, // like 404, except more definite! report to user.
61 EWapErrHttp_409_Conflict = -20409, // see RFC2068
62 EWapErrHttp_408_RequestTimeout = -20408, // dealt with in HTTP, shouldn't have to be presented to the user
63 EWapErrHttp_407_ProxyAuthenticationRequired = -20407,// - not sure, we don't correctly deal with this at the moment. Is it needed?
64 EWapErrHttp_406_NotAcceptable = -20406, // this is returned if the resource requested is not acceptable to the client according to its own accept- strings in the HTTP request header. e.g. accept-charset, accept (content types). accept-language. This shows that we're getting our headers wrong, so should be considered a software error and not be reported. I think.
65 EWapErrHttp_405_MethodNotAllowed = -20405, // e.g. attempt to POST to a URL that is not appropriate for POSTing. Probably a result of poor site design?
66 EWapErrHttp_404_NotFound = -20404, // document missing on origin server. This one would be a good one to report to the user since it happens frequently with badly maintained sites!
67 EWapErrHttp_403_Forbidden = -20403, // the server HTTPD does refuses to return the requested document, for internal reasons not necessarily disclosed to the client
68 EWapErrHttp_402_PaymentRequired = -20402, // I don't think this is used in our world of e-commerce. RFC2068 says it is reserved for future use.
70 // // NOTE THAT HTTP/401 IS NOT TREATED AS AN ERROR, BECAUSE IT IS
71 // // FULLY HANDLED IN HTTP - see HTTP status codes below
73 EWapErrHttp_400_BadRequest = -20400, // client sent a request with a malformed syntax (in HTTP request headers) = I assume this indicates a programming error on our part ,and should not happen, or be reported?
76 // HTTP Data Provider plug-in 'inherited' error codes
78 EWapErrHttpReceivingErrorDeck = -20014, // Could not find document, so receiving an error deck
79 EWapErrHttpCancellationAbort = -20013, // Error code for leave when cancellation has occured during RunL()
80 EWapErrHttpGatewaySessionDisconnect = -20012, // The session was disconnected by the WAP Gateway
81 EWapErrHttpGatewayTransactionAbort = -20011, // A transaction was aborted by the gateway or the stack
82 EWapErrHttpGatewayCannotBeReached = -20010, // A session could not be established with the WAP Gateway
83 // Note that EWapErrHttpAuthenticationFailed and EWapErrHttpAuthenticationCancelled are now information status codes - see below.
84 EWapErrHttpWtlsCipherRejected = -20009, // The user rejected the cipher strength negotiated in WTLS
85 EWapErrHttpWtlsServerCertRejected = -20008, // The user rejected the certificate from the WAP GW
86 EWapErrHttpWtlsBadServerCert = -20007, // WTLS rejected the certificate obtained from the WAP GW
87 EWapErrHttpWtlsConfigFailed = -20006, // Failed to configure the WTLS layer of the WAP Stack
88 EWapErrHttpNetDialSetupFailed = -20005, // Failed to configure Net Dial
89 EWapErrHttpWapAPReadFailure = -20004, // An error occurred when reading the WAP AP from CommsDB
90 EWapErrHttpUnsupportedMethod = -20003, // An HTTP method was specified that is not supported
91 EWapErrHttpCannotFindPlugin = -20002, // Plug-in server failed to create an HTTP plugin
92 EWapErrHttpCannotFindServer = -20001, // URL specified a non-existent or inaccessible domain
93 EWapErrHttpGeneralError = -20000, // Unspecified error condition
100 #define XmlLibErrorBase -13200
101 EWapErrXmlLibInvalidDocument = XmlLibErrorBase,
102 EWapErrXmlLibDocumentBuffered = XmlLibErrorBase - 1,
103 EWapErrXmlLibDocumentAlreadyValid = XmlLibErrorBase - 2,
104 EWapErrXmlLibInvalidDTD = XmlLibErrorBase - 3,
107 #define XmlValidatorErrorBase -13100
108 EWapErrXmlLibIllegalTagName = XmlValidatorErrorBase,
109 EWapErrXmlLibIllegalFixedAttributeValue = XmlValidatorErrorBase - 1,
110 EWapErrXmlLibMissingRequiredAttribute = XmlValidatorErrorBase - 2,
111 EWapErrXmlLibMissingDocument = XmlValidatorErrorBase - 4,
112 EWapErrXmlLibInvalidDocumentStructure = XmlValidatorErrorBase - 6,
113 EWapErrXmlLibIllegalAttributeValue = XmlValidatorErrorBase - 7,
116 #define XmlParserErrorBase -13000
117 EWapErrXmlLibMissingCDATASectionEndTag = XmlParserErrorBase,
118 EWapErrXmlLibInvalidAttributeDeclaration = XmlParserErrorBase - 1,
119 EWapErrXmlLibEndTagMismatch = XmlParserErrorBase - 2,
120 EWapErrXmlLibInvalidCharacterReference = XmlParserErrorBase - 3,
121 EWapErrXmlLibUnknownEntityReference = XmlParserErrorBase - 4,
122 EWapErrXmlLibNoDTD = XmlParserErrorBase - 5,
123 EWapErrXmlLibMissingDocumentRootNode = XmlParserErrorBase - 6,
124 EWapErrXmlLibInvalidXmlVersionDefinition = XmlParserErrorBase - 7,
125 EWapErrXmlLibRootElementNameMismatch = XmlParserErrorBase - 8,
129 // WMLLIB ERROR CODES
133 // No WmlLib (interface module) specific errors defined
136 #define WmlValidatorErrorBase -12100
137 EWapErrWmlLibAccessViolation = WmlValidatorErrorBase - 1,
138 EWapErrWmlLibInvalidVariableReference = WmlValidatorErrorBase - 2,
139 EWapErrWmlLibInvalidConversionMethod = WmlValidatorErrorBase - 3,
140 EWapErrWmlLibIllegalVariableName = WmlValidatorErrorBase - 4,
141 EWapErrWmlLibIllegalTaskCountOnAnchor = WmlValidatorErrorBase - 5,
142 EWapErrWmlLibNULLVariableName = WmlValidatorErrorBase - 6,
143 EWapErrWmlLibNestedTables = WmlValidatorErrorBase - 7,
144 EWapErrWmlLibDuplicateDoNodeName = WmlValidatorErrorBase - 8,
145 EWapErrWmlLibUsageOfReservedWord = WmlValidatorErrorBase - 9,
146 EWapErrWmlLibZeroTableColumns = WmlValidatorErrorBase - 10,
147 EWapErrWmlLibNonWmlDocument = WmlValidatorErrorBase - 11,
148 EWapErrWmlLibMultipleMetaPropertyName = WmlValidatorErrorBase - 12,
149 EWapErrWmlLibEventBindingConflict = WmlValidatorErrorBase - 14,
150 EWapErrWmlLibMultipleAccessElements = WmlValidatorErrorBase - 15,
151 EWapErrWmlLibNonUniqueIds = WmlValidatorErrorBase - 16,
152 EWapErrWmlLibVariableInInvalidLocation = WmlValidatorErrorBase - 17,
155 #define WmlParserErrorBase -12000
156 EWapErrWmlLibNullNode = WmlParserErrorBase,
157 EWapErrWmlLibCDATANodeWithoutParent = WmlParserErrorBase - 1,
161 // WAP Engine 'native' error codes
163 EWapErrSubDocumentNotFound = -10027,
164 EWapErrCannotCreateDeck = -10026, // Failed to create a deck
165 EWapErrMimeTypeMissing = -10025, // Engine tried to access the mime-type attribute in a
166 // tree node but it was missing
167 EWapErrUnknownDocument = -10024,
168 EWapErrInvalidDTD = -10023,
169 EWapErrDTDUnavailable = -10022, // Document cannot be validated as DTD is not available
171 EWapErrUnknownScheme = -10021, // unknown scheme
172 EWapErrCorruptScheme = -10020, // scheme contains invalid characters
173 EWapErrCorruptUrl = -10019, // part of url contains invalid characters
175 EWapErrPluginNotFound = -10018, // couldn't find the requested plugin
177 EWapErrImageConversionFailed = -10017, // image data handler got error from media server
179 EWapErrAccessPointNotSetUpForCSD = -10016, // Access point lacked info for Data call
180 EWapErrAccessPointNotSetUpForSMS = -10015,
181 EWapErrAccessPointNotSetUpForUSSD = -10014,
182 EWapErrAccessPointNotSetUpGeneric = -10013,
183 EWapErrProtocolNotSupported = -10012, // Current network does not support the requested service
185 EWapErrAuthorizationFailed = -10011,
187 EWapErrScriptObscureLibraryCall = -10010, // The script function was unavailable
188 EWapErrScriptIllegalAction = -10009, // The script attempted an illegal action and was terminated
189 EWapErrScriptCorrupt = -10008, // Script had errors
190 EWapErrScriptError = -10007, // Script returned a fatal error
191 EWapErrScriptNotFound = -10006, // Requested script was not found
193 EWapErrDataCallUnavailable = -10005, // The data call is being used by another application
194 EWapErrDataCallDropped = -10004, // CSD connection was closed
196 EWapErrAccessViolation = -10003, // Access to the document was denied
197 EWapErrDocumentCorrupted = -10002,
198 EWapErrDocumentNotFound = -10001,
199 EWapErrGeneral = -10000,
202 // PPP connection 'inherited' error codes
204 EWapErrPppIfLRDBadLine = -3059, // ??
205 EWapErrPppIfDNSNotFound = -3058, // ??
206 EWapErrPppIfCallbackNotAcceptable = -3057, // NTRAS: client requested server Callback but was refused
207 EWapErrPppIfChangingPassword = -3056, // NTRAS: User's password is currently being changed
208 EWapErrPppIfNoDialInPermission = -3055, // NTRAS: User has not got dial-in permission on the server
209 EWapErrPppIfPasswdExpired = -3054, // NTRAS: User's password has expired
210 EWapErrPppIfRestrictedLogonHours = -3053, // NTRAS: User is attempting to log-in outside their hours
211 EWapErrPppIfAccountDisabled = -3052, // NTRAS: User's account has been disabled
212 EWapErrPppIfAuthNotSecure = -3051, // ??
213 EWapErrPppIfAuthenticationFailure = -3050, // The supplied password was wrong??
216 // NetDial 'inherited' error codes
218 EWapErrNetDialScriptError = -3005, // NetDial Exit Condition - Script Error
219 EWapErrNetDialScriptTimeOut = -3004, // NetDial Exit Condition - Script Timed Out
220 EWapErrNetDialLoginFail = -3003, // NetDial Exit Condition - Login Failure
221 EWapErrNetDialModemError = -3002, // NetDial Exit Condition - Modem error
222 EWapErrNetDialNoModem = -3001, // NetDial Exit Condition - No Modem Response
225 // ETEL 'inherited' error codes
227 EWapErrEtelModemSettingsCorrupt = -2018,
228 EWapErrEtelModemNotDetected = -2017,
229 EWapErrEtelAnswerAlreadyOutstanding = -2016,
230 EWapErrEtelUnknownModemCapability = -2015,
231 EWapErrEtelWrongModemType = -2014,
232 EWapErrEtelPortNotLoanedToClient = -2013,
233 EWapErrEtelNotFaxOwner = -2012,
234 EWapErrEtelFaxChunkNotCreated = -2011,
235 EWapErrEtelConfigPortFailure = -2010,
236 EWapErrEtelNoDialTone = -2009,
237 EWapErrEtelNoAnswer = -2008,
238 EWapErrEtelCallNotActive = -2007,
239 EWapErrEtelInitialisationFailure = -2006,
240 EWapErrEtelNoClientInterestedInThisCall= -2005,
241 EWapErrEtelBusyDetected = -2004,
242 EWapErrEtelNoCarrier = -2003,
243 EWapErrEtelAlreadyCallOwner = -2002,
244 EWapErrEtelDuplicatePhoneName = -2001,
245 EWapErrEtelNotCallOwner = -2000,
248 // General EPOC 'inherited' error codes
250 EWapErrEpocTimedOut = -33,
251 EWapErrEpocNotFound = -1,
252 EWapErrEpocAccessDenied = -21,
256 // Wap engine status messages
258 EWapStatusDownloadProgress = 1, // Amount complete in aValue (0...100)
259 EWapStatusDownloadComplete, // Document fetch is complete
260 EWapStatusSubDocumentChanged, // XML subdocument (card in WML) has changed
261 EWapStatusRefreshRequest, // Observer is requested to refresh display
262 EWapStatusError, // Error
263 EWapStatusInformational, // Information other than download progress
264 EWapStatusInitialisingConnection = KHttpPluginStatusBase,
265 EWapStatusConnecting = KHttpPluginStatusBase + 1,
266 EWapStatusAuthenticating = KHttpPluginStatusBase + 2,
267 EWapStatusConnected = KHttpPluginStatusBase + 3,
268 EWapStatusDisconnecting = KHttpPluginStatusBase + 4,
269 EWapStatusHttpAuthenticationFailed = KHttpPluginStatusBase + 10, // The user's password was rejected by the origin server
270 EWapStatusHttpAuthenticationAborted = KHttpPluginStatusBase + 11, // The user cancelled the password box
271 EWapStatusHttp_401_Unauthorized = KHttpPluginStatusBase + 401, // occurs when HTTP authentication is used, username/password dialogs raised as a response. Need to consider how UI deals with authentication failures here.
272 EWapStatusValidating = KWapDocumentLoadStatusBase, // Validating document
273 EWapStatusReceivingErrorDeck = KWapDocumentLoadStatusBase + 1 // Receiving error deck
279 EWmlFetchNoFlag = 0x00,
280 EWmlFetchReload = 0x01,
281 EWmlFetchTimerFetch = 0x02
284 #endif // __WAPENGINESTANDARD_H__