123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287 |
- #import "SDWebImageCompat.h"
- #import "SDWebImageOperation.h"
- #import "SDImageCacheDefine.h"
- #import "SDImageLoader.h"
- #import "SDImageTransformer.h"
- #import "SDWebImageCacheKeyFilter.h"
- #import "SDWebImageCacheSerializer.h"
- #import "SDWebImageOptionsProcessor.h"
- typedef void(^SDExternalCompletionBlock)(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL);
- typedef void(^SDInternalCompletionBlock)(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL);
- @interface SDWebImageCombinedOperation : NSObject <SDWebImageOperation>
- - (void)cancel;
- @property (strong, nonatomic, nullable, readonly) id<SDWebImageOperation> cacheOperation;
- @property (strong, nonatomic, nullable, readonly) id<SDWebImageOperation> loaderOperation;
- @end
- @class SDWebImageManager;
- @protocol SDWebImageManagerDelegate <NSObject>
- @optional
- - (BOOL)imageManager:(nonnull SDWebImageManager *)imageManager shouldDownloadImageForURL:(nonnull NSURL *)imageURL;
- - (BOOL)imageManager:(nonnull SDWebImageManager *)imageManager shouldBlockFailedURL:(nonnull NSURL *)imageURL withError:(nonnull NSError *)error;
- @end
- @interface SDWebImageManager : NSObject
- @property (weak, nonatomic, nullable) id <SDWebImageManagerDelegate> delegate;
- @property (strong, nonatomic, readonly, nonnull) id<SDImageCache> imageCache;
- @property (strong, nonatomic, readonly, nonnull) id<SDImageLoader> imageLoader;
- @property (strong, nonatomic, nullable) id<SDImageTransformer> transformer;
- @property (nonatomic, strong, nullable) id<SDWebImageCacheKeyFilter> cacheKeyFilter;
- @property (nonatomic, strong, nullable) id<SDWebImageCacheSerializer> cacheSerializer;
- @property (nonatomic, strong, nullable) id<SDWebImageOptionsProcessor> optionsProcessor;
- @property (nonatomic, assign, readonly, getter=isRunning) BOOL running;
- @property (nonatomic, class, nullable) id<SDImageCache> defaultImageCache;
- @property (nonatomic, class, nullable) id<SDImageLoader> defaultImageLoader;
- @property (nonatomic, class, readonly, nonnull) SDWebImageManager *sharedManager;
- - (nonnull instancetype)initWithCache:(nonnull id<SDImageCache>)cache loader:(nonnull id<SDImageLoader>)loader NS_DESIGNATED_INITIALIZER;
- - (nullable SDWebImageCombinedOperation *)loadImageWithURL:(nullable NSURL *)url
- options:(SDWebImageOptions)options
- progress:(nullable SDImageLoaderProgressBlock)progressBlock
- completed:(nonnull SDInternalCompletionBlock)completedBlock;
- - (nullable SDWebImageCombinedOperation *)loadImageWithURL:(nullable NSURL *)url
- options:(SDWebImageOptions)options
- context:(nullable SDWebImageContext *)context
- progress:(nullable SDImageLoaderProgressBlock)progressBlock
- completed:(nonnull SDInternalCompletionBlock)completedBlock;
- - (void)cancelAll;
- - (void)removeFailedURL:(nonnull NSURL *)url;
- - (void)removeAllFailedURLs;
- - (nullable NSString *)cacheKeyForURL:(nullable NSURL *)url;
- - (nullable NSString *)cacheKeyForURL:(nullable NSURL *)url context:(nullable SDWebImageContext *)context;
- @end
|