1/* 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. 9 * 2. Redistributions in binary form must reproduce the above copyright 10 * notice, this list of conditions and the following disclaimer in the 11 * documentation and/or other materials provided with the distribution. 12 * 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26cpp_quote("#define WebURLErrorDomain TEXT(\"CFURLErrorDomain\")") 27/*! 28 @enum NSURL-related Error Codes 29 @abstract Constants used by NSError to indicate errors in the WebFoundation domain 30 @discussion Documentation on each constant forthcoming. 31*/ 32enum 33{ 34 WebURLErrorUnknown = -1, 35 WebURLErrorCancelled = -999, 36 WebURLErrorBadURL = -1000, 37 WebURLErrorTimedOut = -1001, 38 WebURLErrorUnsupportedURL = -1002, 39 WebURLErrorCannotFindHost = -1003, 40 WebURLErrorCannotConnectToHost = -1004, 41 WebURLErrorNetworkConnectionLost = -1005, 42 WebURLErrorDNSLookupFailed = -1006, 43 WebURLErrorHTTPTooManyRedirects = -1007, 44 WebURLErrorResourceUnavailable = -1008, 45 WebURLErrorNotConnectedToInternet = -1009, 46 WebURLErrorRedirectToNonExistentLocation = -1010, 47 WebURLErrorBadServerResponse = -1011, 48 WebURLErrorUserCancelledAuthentication = -1012, 49 WebURLErrorUserAuthenticationRequired = -1013, 50 WebURLErrorZeroByteResource = -1014, 51 WebURLErrorFileDoesNotExist = -1100, 52 WebURLErrorFileIsDirectory = -1101, 53 WebURLErrorNoPermissionsToReadFile = -1102, 54 WebURLErrorSecureConnectionFailed = -1200, 55 WebURLErrorServerCertificateHasBadDate = -1201, 56 WebURLErrorServerCertificateUntrusted = -1202, 57 WebURLErrorServerCertificateHasUnknownRoot = -1203, 58 WebURLErrorServerCertificateNotYetValid = -1204, 59 WebURLErrorClientCertificateRejected = -1205, 60 WebURLErrorClientCertificateRequired = -1206, 61 WebURLErrorCannotLoadFromNetwork = -2000, 62 63 // Download and file I/O errors 64 WebURLErrorCannotCreateFile = -3000, 65 WebURLErrorCannotOpenFile = -3001, 66 WebURLErrorCannotCloseFile = -3002, 67 WebURLErrorCannotWriteToFile = -3003, 68 WebURLErrorCannotRemoveFile = -3004, 69 WebURLErrorCannotMoveFile = -3005, 70 WebURLErrorDownloadDecodingFailedMidStream = -3006, 71 WebURLErrorDownloadDecodingFailedToComplete =-3007, 72}; 73 74cpp_quote("#define WebKitErrorDomain TEXT(\"WebKitErrorDomain\")") 75/*! 76 @enum 77 @abstract Policy errors 78 @constant WebKitErrorCannotShowMIMEType 79 @constant WebKitErrorCannotShowURL 80 @constant WebKitErrorFrameLoadInterruptedByPolicyChange 81*/ 82enum { 83 WebKitErrorCannotShowMIMEType = 100, 84 WebKitErrorCannotShowURL = 101, 85 WebKitErrorFrameLoadInterruptedByPolicyChange = 102, 86 WebKitErrorCannotUseRestrictedPort = 103, 87}; 88 89/*! 90 @enum 91 @abstract Plug-in and java errors 92 @constant WebKitErrorCannotFindPlugIn 93 @constant WebKitErrorCannotLoadPlugIn 94 @constant WebKitErrorJavaUnavailable 95*/ 96enum { 97 WebKitErrorCannotFindPlugIn = 200, 98 WebKitErrorCannotLoadPlugIn = 201, 99 WebKitErrorJavaUnavailable = 202, 100}; 101 102cpp_quote("#define WebKitErrorMIMETypeKey TEXT(\"WebKitErrorMIMETypeKey\")") 103cpp_quote("#define WebKitErrorPlugInNameKey TEXT(\"WebKitErrorPlugInNameKey\")") 104cpp_quote("#define WebKitErrorPlugInPageURLStringKey TEXT(\"WebKitErrorPlugInPageURLStringKey\")") 105 106cpp_quote("#define WebPOSIXErrorDomain TEXT(\"NSPOSIXErrorDomain\")") 107cpp_quote("#define WebPOSIXErrorECONNRESET 54") 108 109#ifndef DO_NO_IMPORTS 110import "oaidl.idl"; 111import "ocidl.idl"; 112#endif 113 114[ 115 object, 116 oleautomation, 117 hidden, 118 uuid(89E3B189-0B60-4d6b-A87A-3F1172CB5538), 119 pointer_default(unique) 120] 121interface IWebError : IUnknown 122{ 123 HRESULT init([in] BSTR domain, [in] int code, [in] BSTR url); 124 125 /* 126 - (int)code 127 */ 128 HRESULT code([out, retval] int* result); 129 130 /* 131 - (NSString *)domain 132 */ 133 HRESULT domain([out, retval] BSTR* result); 134 135 /* 136 - (NSString *)localizedDescription 137 */ 138 HRESULT localizedDescription([out, retval] BSTR* result); 139 140 /* 141 - (NSString *)localizedFailureReason 142 */ 143 HRESULT localizedFailureReason([out, retval] BSTR* result); 144 145 /* 146 - (NSArray *)localizedRecoveryOptions 147 */ 148 HRESULT localizedRecoveryOptions([out, retval] IEnumVARIANT** enumOptions); 149 150 /* 151 - (NSString *)localizedRecoverySuggestion 152 */ 153 HRESULT localizedRecoverySuggestion([out, retval] BSTR* result); 154 155 /* 156 - (id)recoverAttempter 157 */ 158 HRESULT recoverAttempter([out, retval] IUnknown** result); 159 160 /* 161 - (NSDictionary *)userInfo 162 */ 163 HRESULT userInfo([out, retval] IPropertyBag** result); 164 165 HRESULT failingURL([out, retval] BSTR* result); 166 167 HRESULT isPolicyChangeError([out, retval] BOOL* result); 168} 169