40 lines
1.6 KiB
Objective-C
40 lines
1.6 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 <Foundation/Foundation.h>
|
|
#import "SDWebImageDownloader.h"
|
|
#import "SDWebImageOperation.h"
|
|
|
|
@interface SDWebImageDownloaderOperation : NSOperation <SDWebImageOperation>
|
|
|
|
@property (strong, nonatomic, readonly) NSURLRequest *request;
|
|
@property (assign, nonatomic, readonly) SDWebImageDownloaderOptions options;
|
|
|
|
/**
|
|
* Initializes a `SDWebImageDownloaderOperation` object
|
|
*
|
|
* @see SDWebImageDownloaderOperation
|
|
*
|
|
* @param request the URL request
|
|
* @param options downloader options
|
|
* @param progressBlock the block executed when a new chunk of data arrives.
|
|
* @note the progress block is executed on a background queue
|
|
* @param completedBlock the block executed when the download is done.
|
|
* @note the completed block is executed on the main queue for success. If errors are found, there is a chance the block will be executed on a background queue
|
|
* @param cancelBlock the block executed if the download (operation) is cancelled
|
|
*
|
|
* @return the initialized instance
|
|
*/
|
|
- (id)initWithRequest:(NSURLRequest *)request
|
|
options:(SDWebImageDownloaderOptions)options
|
|
progress:(SDWebImageDownloaderProgressBlock)progressBlock
|
|
completed:(SDWebImageDownloaderCompletedBlock)completedBlock
|
|
cancelled:(void (^)())cancelBlock;
|
|
|
|
@end
|