43 lines
1.8 KiB
Objective-C
43 lines
1.8 KiB
Objective-C
/*
|
|
* This file is part of the SDWebImage package.
|
|
* (c) Olivier Poitrey <rs@dailymotion.com>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
#import "SDWebImageCompat.h"
|
|
#import "SDWebImageDownloaderDelegate.h"
|
|
#import "SDWebImageManagerDelegate.h"
|
|
#import "SDImageCacheDelegate.h"
|
|
|
|
typedef enum
|
|
{
|
|
SDWebImageRetryFailed = 1 << 0,
|
|
SDWebImageLowPriority = 1 << 1,
|
|
SDWebImageCacheMemoryOnly = 1 << 2
|
|
} SDWebImageOptions;
|
|
|
|
@interface SDWebImageManager : NSObject <SDWebImageDownloaderDelegate, SDImageCacheDelegate>
|
|
{
|
|
NSMutableArray *downloadDelegates;
|
|
NSMutableArray *downloaders;
|
|
NSMutableArray *cacheDelegates;
|
|
NSMutableArray *cacheURLs;
|
|
NSMutableDictionary *downloaderForURL;
|
|
NSMutableArray *failedURLs;
|
|
}
|
|
|
|
+ (id)sharedManager;
|
|
- (UIImage *)imageWithURL:(NSURL *)url;
|
|
- (void)downloadWithURL:(NSURL *)url delegate:(id<SDWebImageManagerDelegate>)delegate;
|
|
- (void)downloadWithURL:(NSURL *)url delegate:(id<SDWebImageManagerDelegate>)delegate options:(SDWebImageOptions)options;
|
|
- (void)downloadWithURL:(NSURL *)url delegate:(id<SDWebImageManagerDelegate>)delegate retryFailed:(BOOL)retryFailed __attribute__ ((deprecated)); // use options:SDWebImageRetryFailed instead
|
|
- (void)downloadWithURL:(NSURL *)url delegate:(id<SDWebImageManagerDelegate>)delegate retryFailed:(BOOL)retryFailed lowPriority:(BOOL)lowPriority __attribute__ ((deprecated)); // use options:SDWebImageRetryFailed|SDWebImageLowPriority instead
|
|
#if NS_BLOCKS_AVAILABLE
|
|
- (void)downloadWithURL:(NSURL *)url delegate:(id)delegate options:(SDWebImageOptions)options success:(void (^)(UIImage *image))success failure:(void (^)(NSError *error))failure;
|
|
#endif
|
|
- (void)cancelForDelegate:(id<SDWebImageManagerDelegate>)delegate;
|
|
|
|
@end
|