123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314 |
- #import <Foundation/Foundation.h>
- #import "SDWebImageCompat.h"
- #import "SDWebImageDefine.h"
- #import "SDWebImageOperation.h"
- #import "SDWebImageDownloaderConfig.h"
- #import "SDWebImageDownloaderRequestModifier.h"
- #import "SDWebImageDownloaderResponseModifier.h"
- #import "SDWebImageDownloaderDecryptor.h"
- #import "SDImageLoader.h"
- typedef NS_OPTIONS(NSUInteger, SDWebImageDownloaderOptions) {
-
- SDWebImageDownloaderLowPriority = 1 << 0,
-
-
- SDWebImageDownloaderProgressiveLoad = 1 << 1,
-
- SDWebImageDownloaderUseNSURLCache = 1 << 2,
-
- SDWebImageDownloaderIgnoreCachedResponse = 1 << 3,
-
-
- SDWebImageDownloaderContinueInBackground = 1 << 4,
-
- SDWebImageDownloaderHandleCookies = 1 << 5,
-
- SDWebImageDownloaderAllowInvalidSSLCertificates = 1 << 6,
-
- SDWebImageDownloaderHighPriority = 1 << 7,
-
-
- SDWebImageDownloaderScaleDownLargeImages = 1 << 8,
-
-
- SDWebImageDownloaderAvoidDecodeImage = 1 << 9,
-
-
- SDWebImageDownloaderDecodeFirstFrameOnly = 1 << 10,
-
-
- SDWebImageDownloaderPreloadAllFrames = 1 << 11,
-
-
- SDWebImageDownloaderMatchAnimatedImageClass = 1 << 12,
- };
- FOUNDATION_EXPORT NSNotificationName _Nonnull const SDWebImageDownloadStartNotification;
- FOUNDATION_EXPORT NSNotificationName _Nonnull const SDWebImageDownloadReceiveResponseNotification;
- FOUNDATION_EXPORT NSNotificationName _Nonnull const SDWebImageDownloadStopNotification;
- FOUNDATION_EXPORT NSNotificationName _Nonnull const SDWebImageDownloadFinishNotification;
- typedef SDImageLoaderProgressBlock SDWebImageDownloaderProgressBlock;
- typedef SDImageLoaderCompletedBlock SDWebImageDownloaderCompletedBlock;
- @interface SDWebImageDownloadToken : NSObject <SDWebImageOperation>
- - (void)cancel;
- @property (nonatomic, strong, nullable, readonly) NSURL *url;
- @property (nonatomic, strong, nullable, readonly) NSURLRequest *request;
- @property (nonatomic, strong, nullable, readonly) NSURLResponse *response;
- @property (nonatomic, strong, nullable, readonly) NSURLSessionTaskMetrics *metrics API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
- @end
- @interface SDWebImageDownloader : NSObject
- @property (nonatomic, copy, readonly, nonnull) SDWebImageDownloaderConfig *config;
- @property (nonatomic, strong, nullable) id<SDWebImageDownloaderRequestModifier> requestModifier;
- @property (nonatomic, strong, nullable) id<SDWebImageDownloaderResponseModifier> responseModifier;
- @property (nonatomic, strong, nullable) id<SDWebImageDownloaderDecryptor> decryptor;
- @property (nonatomic, readonly, nonnull) NSURLSessionConfiguration *sessionConfiguration;
- @property (nonatomic, assign, getter=isSuspended) BOOL suspended;
- @property (nonatomic, assign, readonly) NSUInteger currentDownloadCount;
- @property (nonatomic, class, readonly, nonnull) SDWebImageDownloader *sharedDownloader;
- - (nonnull instancetype)initWithConfig:(nullable SDWebImageDownloaderConfig *)config NS_DESIGNATED_INITIALIZER;
- - (void)setValue:(nullable NSString *)value forHTTPHeaderField:(nullable NSString *)field;
- - (nullable NSString *)valueForHTTPHeaderField:(nullable NSString *)field;
- - (nullable SDWebImageDownloadToken *)downloadImageWithURL:(nullable NSURL *)url
- completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock;
- - (nullable SDWebImageDownloadToken *)downloadImageWithURL:(nullable NSURL *)url
- options:(SDWebImageDownloaderOptions)options
- progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock
- completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock;
- - (nullable SDWebImageDownloadToken *)downloadImageWithURL:(nullable NSURL *)url
- options:(SDWebImageDownloaderOptions)options
- context:(nullable SDWebImageContext *)context
- progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock
- completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock;
- - (void)cancelAllDownloads;
- - (void)invalidateSessionAndCancel:(BOOL)cancelPendingOperations;
- @end
- @interface SDWebImageDownloader (SDImageLoader) <SDImageLoader>
- @end
|