Add NSConnectionDataDelegate protocol and NSRequestNetworkServiceType

This commit is contained in:
Gregory John Casamento 2021-11-21 02:16:24 -05:00
parent e68b97d58b
commit eb743541aa
3 changed files with 81 additions and 0 deletions

View file

@ -1,3 +1,10 @@
2021-11-21 Gregory John Casamento <greg.casamento@gmail.com>
* Headers/Foundation/NSURLConnection.h: Add
NSURLConnectionDataDelegate protocol.
* Headers/Foundation/NSURLRequest.h: Add enum for
NSURLNetworkServiceType.
2021-11-11 Frederik Seiffert <frederik@algoriddim.com>
* Headers/Foundation/NSBundle.h:

View file

@ -261,6 +261,37 @@ GS_EXPORT_CLASS
redirectResponse: (NSURLResponse *)response;
@end
#if OS_API_VERSION(MAC_OS_X_VERSION_10_2,GS_API_LATEST)
@protocol NSURLConnectionDataDelegate <NSURLConnectionDelegate>
#if GS_PROTOCOLS_HAVE_OPTIONAL
@optional
#endif
- (NSURLRequest *) connection: (NSURLConnection *)connection
willSendRequest: (NSURLRequest *)request
redirectResponse: (NSURLResponse *)response;
- (void) connection: (NSURLConnection *)connection
didReceiveResponse: (NSURLResponse *)response;
- (void) connection: (NSURLConnection *) connection didReceiveData: (NSData *)data;
- (NSInputStream *) connection: (NSURLConnection *)connection
needNewBodyStream: (NSURLRequest *)request;
- (void) connection: (NSURLConnection *)connection
didSendBodyData: (NSInteger)bytesWritten
totalBytesWritten: (NSInteger)totalBytesWritten
totalBytesExpectedToWrite: (NSInteger)totalBytesExpectedToWrite;
- (NSCachedURLResponse *) connection: (NSURLConnection *)connection
willCacheResponse:(NSCachedURLResponse *)cachedResponse;
- (void) connectionDidFinishLoading: (NSURLConnection *)connection;
@end
#endif
/**
* An interface to perform synchronous loading of URL requests.
*/

View file

@ -81,6 +81,49 @@ enum {
*/
typedef NSUInteger NSURLRequestCachePolicy;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_7,GS_API_LATEST)
enum
{
NSURLNetworkServiceTypeDefault = 0, // Standard internet traffic
NSURLNetworkServiceTypeVoIP = 1, // Voice over IP control traffic
NSURLNetworkServiceTypeVideo = 2, // Video traffic
NSURLNetworkServiceTypeBackground = 3, // Background traffic
NSURLNetworkServiceTypeVoice = 4, // Voice data
#if OS_API_VERSION(MAC_OS_X_VERSION_10_12,GS_API_LATEST)
NSURLNetworkServiceTypeCallSignaling = 11 // Call Signaling - enumeration cases
#endif
};
/**
* <deflist>
* <term>NSURLNetworkServiceTypeDefault</term>
* <desc>
* Specifies standard network traffic. Most connections should be made using this service type
* this is the default.
* </desc>
* <term>NSURLNetworkServiceTypeVoIP</term>
* <desc>
* Specifies that the request is for VoIP traffic.
* </desc>
* <term>NSURLNetworkServiceTypeVideo</term>
* <desc>
* Specifies that the request is for video traffic.
* </desc>
* <term>NSURLNetworkServiceTypeBackground</term>
* <desc>
* Specifies that the request is for background traffic.
* </desc>
* <term>NSURLNetworkServiceTypeVoice</term>
* <desc>
* Specifies that the request is for voice traffic.
* </desc>
* <term>NSURLNetworkServiceTypeCallSignaling</term>
* <desc>
* Call Signaling - enumeration cases.
* </desc>
* </deflist>
*/
typedef NSUInteger NSURLRequestNetworkServiceType;
#endif
/**
* This class encapsulates information about a request to load a