/usr/include/GNUstep/Foundation/NSURLProtocol.h is in libgnustep-base-dev 1.24.0-1ubuntu3.
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 | /* Interface for NSURLProtocol 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 __NSURLProtocol_h_GNUSTEP_BASE_INCLUDE
#define __NSURLProtocol_h_GNUSTEP_BASE_INCLUDE
#import <GNUstepBase/GSVersionMacros.h>
#if OS_API_VERSION(100200,GS_API_LATEST) && GS_API_VERSION( 11300,GS_API_LATEST)
#import <Foundation/NSObject.h>
#if defined(__cplusplus)
extern "C" {
#endif
#import <Foundation/NSURLCache.h>
@class NSCachedURLResponse;
@class NSError;
@class NSMutableURLRequest;
@class NSURLAuthenticationChallenge;
@class NSURLConnection;
@class NSURLProtocol;
@class NSURLRequest;
@class NSURLResponse;
/**
* Defines the API for NSURLProtocol loading
*/
@protocol NSURLProtocolClient <NSObject>
/**
* Informs a client that a cached response is valid.
*/
- (void) URLProtocol: (NSURLProtocol *)protocol
cachedResponseIsValid: (NSCachedURLResponse *)cachedResponse;
/**
* Informs a client that loading of a request has failed.
*/
- (void) URLProtocol: (NSURLProtocol *)protocol
didFailWithError: (NSError *)error;
/**
* Informs a client that data has been loaded. Only new data since the
* last call to this method must be provided.
*/
- (void) URLProtocol: (NSURLProtocol *)protocol
didLoadData: (NSData *)data;
/**
* Informs a client that an authentication challenge has been received.
*/
- (void) URLProtocol: (NSURLProtocol *)protocol
didReceiveAuthenticationChallenge: (NSURLAuthenticationChallenge *)challenge;
/**
* Informs a client that a response for the current load has been created.<br />
* Also supplies the policy to be used for caching the response.
*/
- (void) URLProtocol: (NSURLProtocol *)protocol
didReceiveResponse: (NSURLResponse *)response
cacheStoragePolicy: (NSURLCacheStoragePolicy)policy;
/**
* Informs a client that a redirect has occurred.<br />
*/
- (void) URLProtocol: (NSURLProtocol *)protocol
wasRedirectedToRequest: (NSURLRequest *)request
redirectResponse: (NSURLResponse *)redirectResponse;
/**
* Informs a client that loading of a request has successfully finished.
*/
- (void) URLProtocolDidFinishLoading: (NSURLProtocol *)protocol;
/**
* Informs a client that an authentication challenge has been cancelled.
*/
- (void) URLProtocol: (NSURLProtocol *)protocol
didCancelAuthenticationChallenge: (NSURLAuthenticationChallenge *)challenge;
@end
/**
* <p>Subclasses of NSURLProtocol implement basic handling of URL
* loading for specific protocols. The NSURLProtocol class
* itsself is a semi-abstract class giving the essential
* structure for the subclasses.
* </p>
* <p>You never instantiate NSURLProtocol yourself ... it should only
* ever be done by other classes within mthe URL loading system.
* </p>
*/
@interface NSURLProtocol : NSObject
{
#if GS_EXPOSE(NSURLProtocol)
void *_NSURLProtocolInternal;
#endif
}
/**
* Allows subclasses to provide access to proptocol specific
* properties, returning the property of request stored by the
* name key or nil if no property had been stored using that
* key in the request.
*/
+ (id) propertyForKey: (NSString *)key inRequest: (NSURLRequest *)request;
/**
* Registers the specified class so that it can be used to load requests.<br />
* When the system is determining which class to use to handle a
* request it examines them in a most recently registered first order.<br />
* The +canInitWithRequest: method is used to determine whether a class
* may be used to handle a particular request or not.
* Returns YES if registered (ie the class is an NSURLProtocol subclass),
* NO otherwise.
*/
+ (BOOL) registerClass: (Class)protocolClass;
/**
* Allows subclasses to provide a way to set protocol specific properties,
* setting the property named key to value in the request.
*/
+ (void) setProperty: (id)value
forKey: (NSString *)key
inRequest: (NSMutableURLRequest *)request;
/**
* Unregisters a class which was previously registered using the
* +registerClass: method.
*/
+ (void) unregisterClass: (Class)protocolClass;
/**
* Returns the cachedResponse of the receiver.
*/
- (NSCachedURLResponse *) cachedResponse;
/**
* Returns the client associated with the receiver.
*/
- (id <NSURLProtocolClient>) client;
/**
* Initialises the receiver with request, cachedResponse and client.<br />
* The cachedResponse may be the result of a previous load of the
* request (in which case the protocol may validate and use it).<br />
* The client is the object which receives messages about the progress
* of the load.
*/
- (id) initWithRequest: (NSURLRequest *)request
cachedResponse: (NSCachedURLResponse *)cachedResponse
client: (id <NSURLProtocolClient>)client;
/**
* Returns the request handled by the receiver.
*/
- (NSURLRequest *) request;
@end
/**
* This category lists the methods which a subclass must implement
* in order to produce a working protocol.
*/
@interface NSURLProtocol (Subclassing)
/** <override-subclass />
* This method is called to decide whether a class can deal with
* the specified request. The abstract class implementation
* raises an exception.
*/
+ (BOOL) canInitWithRequest: (NSURLRequest *)request;
/** <override-subclass />
* Returns the 'canonical' version of the request.<br />
* The canonical form is used to look up requests in the cache by
* checking for equality.<br />
* The abnstract class implementation simply returns request.
*/
+ (NSURLRequest *) canonicalRequestForRequest: (NSURLRequest *)request;
/** <override-subclass />
* Compares two requests for equivalence for caching purposes.<br />
* The abstract class implementaton just uses [NSObject-isEqual:]
*/
+ (BOOL) requestIsCacheEquivalent: (NSURLRequest *)a
toRequest: (NSURLRequest *)b;
/** <override-subclass />
* Starts loading of a request.
*/
- (void) startLoading;
/** <override-subclass />
* Stops loading of a request (eg when the load is cancelled).
*/
- (void) stopLoading;
@end
#if defined(__cplusplus)
}
#endif
#endif
#endif
|