/usr/include/GNUstep/Foundation/NSURLConnection.h is in libgnustep-base-dev 1.24.7-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | /* Interface for NSURLConnection for GNUstep
Copyright (C) 2006 Software Foundation, Inc.
Written by: Richard Frith-Macdonald <frm@gnu.org>
Date: 2006
This file is part of the GNUstep Base Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02111 USA.
*/
#ifndef __NSURLConnection_h_GNUSTEP_BASE_INCLUDE
#define __NSURLConnection_h_GNUSTEP_BASE_INCLUDE
#import <GNUstepBase/GSVersionMacros.h>
#if OS_API_VERSION(MAC_OS_X_VERSION_10_2,GS_API_LATEST) && GS_API_VERSION( 11300,GS_API_LATEST)
#import <Foundation/NSObject.h>
#if defined(__cplusplus)
extern "C" {
#endif
@class NSCachedURLResponse;
@class NSData;
@class NSError;
@class NSURLAuthenticationChallenge;
@class NSURLRequest;
@class NSURLResponse;
/**
*/
@interface NSURLConnection : NSObject
{
#if GS_EXPOSE(NSURLConnection)
void *_NSURLConnectionInternal;
#endif
}
/**
* Performs a preliminary check to see if a load of the specified
* request can be handled by an instance of this class.<br />
* The results of this method may be invalidated by subsequent
* changes to the request or changes to the registered protocols
* etc.
*/
+ (BOOL) canHandleRequest: (NSURLRequest *)request;
/**
* Allocates and returns the autoreleased instance which it initialises
* using the -initWithRequest:delegate: method.
*/
+ (NSURLConnection *) connectionWithRequest: (NSURLRequest *)request
delegate: (id)delegate;
/**
* Cancel the asynchronous load in progress (if any) for this connection.
*/
- (void) cancel;
/** <init />
* Initialises the receiver with the specified request (performing
* a deep copy so that the request does not change during loading)
* and delegate.<br />
* This automatically initiates an asynchronous load for the request.<br />
* Processing of the request is done in the thread which calls this
* method, so the thread must run its current run loop
* (in NSDefaultRunLoopMode) for processing to continue/complete.<br />
* The delegate will receive callbacks informing it of the progress
* of the load.<br />
* This method breaks with convention and retains the delegate object,
* releasing it when the connection finished loading, fails, or is cancelled.
*/
- (id) initWithRequest: (NSURLRequest *)request delegate: (id)delegate;
@end
/**
* This category is an informal protocol specifying how an NSURLConnection
* instance will communicate with its delegate to inform it of (and allow
* it to manage) the progress of a load request.<br />
* A load operation is performed by asynchronous I/O using the
* run loop of the thread in which it was initiated, so all callbacks
* will occur in that thread.<br />
* The process of loading a resource occurs as follows -<br />
* <list>
* <item>
* Any number of -connection:willSendRequest:redirectResponse:
* messages may be sent to the delegate before any other messages
* in this list are sent. This permits a chain of redirects to
* be followed before eventual loading of 'real' data.
* </item>
* <item>
* A -connection:didReceiveAuthenticationChallenge: message may be
* sent to the delegate (where authentication is required) before
* response data can be downloaded.
* </item>
* <item>
* Any number of -connection:didReceiveResponse: messages
* may be be sent to the delegate before a
* -connection:didReceiveData: message. Usually there is exactly one
* of these, but for multipart/x-mixed-replace there may be multiple
* responses for each part, and if an error occurs in the download
* the delegate may not receive a response at all.<br />
* Delegates should discard previously handled data when they
* receive a new response.
* </item>
* <item>
* Any number of -connection:didReceiveData: messages may
* be sent before the load completes as described below.
* </item>
* <item>
* A single -connection:willCacheResponse: message may
* be sent to the delegate after any -connection:didReceiveData:
* messages are sent but before a -connectionDidFinishLoading: message
* is sent.
* </item>
* <item>
* Unless the NSURLConnection receives a -cancel message,
* the delegate will receive one and only one of
* -connectionDidFinishLoading:, or
* -connection:didFailWithError: message, but never
* both.<br />
* Once either of these terminal messages is sent the
* delegate will receive no further messages from the
* NSURLConnection.
* </item>
* </list>
*/
@interface NSObject (NSURLConnectionDelegate)
/**
* Instructs the delegate that authentication for challenge has
* been cancelled for the request loading on connection.
*/
- (void) connection: (NSURLConnection *)connection
didCancelAuthenticationChallenge: (NSURLAuthenticationChallenge *)challenge;
/*
* Called when an NSURLConnection has failed to load successfully.
*/
- (void) connection: (NSURLConnection *)connection
didFailWithError: (NSError *)error;
/**
* Called when an NSURLConnection has finished loading successfully.
*/
- (void) connectionDidFinishLoading: (NSURLConnection *)connection;
/**
* Called when an authentication challenge is received ... the delegate
* should send -useCredential:forAuthenticationChallenge: or
* -continueWithoutCredentialForAuthenticationChallenge: or
* -cancelAuthenticationChallenge: to the challenge sender when done.
*/
- (void) connection: (NSURLConnection *)connection
didReceiveAuthenticationChallenge: (NSURLAuthenticationChallenge *)challenge;
/**
* Called when content data arrives during a load operations ... this
* may be incremental or may be the compolete data for the load.
*/
- (void) connection: (NSURLConnection *)connection
didReceiveData: (NSData *)data;
/**
* Called when enough information to build a NSURLResponse object has
* been received.
*/
- (void) connection: (NSURLConnection *)connection
didReceiveResponse: (NSURLResponse *)response;
/**
* Called with the cachedResponse to be stored in the cache.
* The delegate can inspect the cachedResponse and return a modified
* copy if if wants changed to what whill be stored.<br />
* If it returns nil, nothing will be stored in the cache.
*/
- (NSCachedURLResponse *) connection: (NSURLConnection *)connection
willCacheResponse: (NSCachedURLResponse *)cachedResponse;
/**
* Informs the delegate that the connection must change the URL of
* the request in order to continue with the load operation.<br />
* This allows the delegate to ionspect and/or modify a copy of the request
* before the connection continues loading it. Normally the delegate
* can return the request unmodifield.<br />
* The redirection can be rejectected by the delegate calling -cancel
* or returning nil.<br />
* Cancelling the load will simply stop it, but returning nil will
* cause it to complete with a redirection failure.<br />
* As a special case, this method may be called with a nil response,
* indicating a change of URL made internally by the system rather than
* due to a response from the server.
*/
- (NSURLRequest *) connection: (NSURLConnection *)connection
willSendRequest: (NSURLRequest *)request
redirectResponse: (NSURLResponse *)response;
@end
/**
* An interface to perform synchronous loading of URL requests.
*/
@interface NSURLConnection (NSURLConnectionSynchronousLoading)
/**
* Performs a synchronous load of request and returns the
* [NSURLResponse] in response.<br />
* Returns the result of the load or nil if the load failed.
*/
+ (NSData *) sendSynchronousRequest: (NSURLRequest *)request
returningResponse: (NSURLResponse **)response
error: (NSError **)error;
@end
#if defined(__cplusplus)
}
#endif
#endif
#endif
|