|
| 1 | +/* |
| 2 | + * This file is part of the SDWebImage package. |
| 3 | + * (c) Olivier Poitrey <rs@dailymotion.com> |
| 4 | + * |
| 5 | + * For the full copyright and license information, please view the LICENSE |
| 6 | + * file that was distributed with this source code. |
| 7 | + */ |
| 8 | + |
| 9 | +@import SDWebImage; |
| 10 | +@import LinkPresentation; |
| 11 | + |
| 12 | +/** |
| 13 | + * Integrates SDWebImage async downloading and caching of remote images with LPLinkView. |
| 14 | + */ |
| 15 | +@interface LPLinkView (WebCache) |
| 16 | + |
| 17 | +/** |
| 18 | + * Set the imageView `image` with an `url`. |
| 19 | + * |
| 20 | + * The download is asynchronous and cached. |
| 21 | + * |
| 22 | + * @param url The url for the image. |
| 23 | + */ |
| 24 | +- (void)sd_setImageWithURL:(nullable NSURL *)url NS_REFINED_FOR_SWIFT; |
| 25 | + |
| 26 | +/** |
| 27 | + * Set the imageView `image` with an `url` and a placeholder. |
| 28 | + * |
| 29 | + * The download is asynchronous and cached. |
| 30 | + * |
| 31 | + * @param url The url for the image. |
| 32 | + * @param placeholder The image to be set initially, until the image request finishes. |
| 33 | + * @see sd_setImageWithURL:placeholderImage:options: |
| 34 | + */ |
| 35 | +- (void)sd_setImageWithURL:(nullable NSURL *)url |
| 36 | + placeholderImage:(nullable UIImage *)placeholder NS_REFINED_FOR_SWIFT; |
| 37 | + |
| 38 | +/** |
| 39 | + * Set the imageView `image` with an `url`, placeholder and custom options. |
| 40 | + * |
| 41 | + * The download is asynchronous and cached. |
| 42 | + * |
| 43 | + * @param url The url for the image. |
| 44 | + * @param placeholder The image to be set initially, until the image request finishes. |
| 45 | + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. |
| 46 | + */ |
| 47 | +- (void)sd_setImageWithURL:(nullable NSURL *)url |
| 48 | + placeholderImage:(nullable UIImage *)placeholder |
| 49 | + options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT; |
| 50 | + |
| 51 | +/** |
| 52 | + * Set the imageView `image` with an `url`, placeholder, custom options and context. |
| 53 | + * |
| 54 | + * The download is asynchronous and cached. |
| 55 | + * |
| 56 | + * @param url The url for the image. |
| 57 | + * @param placeholder The image to be set initially, until the image request finishes. |
| 58 | + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. |
| 59 | + * @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold. |
| 60 | + */ |
| 61 | +- (void)sd_setImageWithURL:(nullable NSURL *)url |
| 62 | + placeholderImage:(nullable UIImage *)placeholder |
| 63 | + options:(SDWebImageOptions)options |
| 64 | + context:(nullable SDWebImageContext *)context; |
| 65 | + |
| 66 | +/** |
| 67 | + * Set the imageView `image` with an `url`. |
| 68 | + * |
| 69 | + * The download is asynchronous and cached. |
| 70 | + * |
| 71 | + * @param url The url for the image. |
| 72 | + * @param completedBlock A block called when operation has been completed. This block has no return value |
| 73 | + * and takes the requested UIImage as first parameter. In case of error the image parameter |
| 74 | + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean |
| 75 | + * indicating if the image was retrieved from the local cache or from the network. |
| 76 | + * The fourth parameter is the original image url. |
| 77 | + */ |
| 78 | +- (void)sd_setImageWithURL:(nullable NSURL *)url |
| 79 | + completed:(nullable SDExternalCompletionBlock)completedBlock; |
| 80 | + |
| 81 | +/** |
| 82 | + * Set the imageView `image` with an `url`, placeholder. |
| 83 | + * |
| 84 | + * The download is asynchronous and cached. |
| 85 | + * |
| 86 | + * @param url The url for the image. |
| 87 | + * @param placeholder The image to be set initially, until the image request finishes. |
| 88 | + * @param completedBlock A block called when operation has been completed. This block has no return value |
| 89 | + * and takes the requested UIImage as first parameter. In case of error the image parameter |
| 90 | + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean |
| 91 | + * indicating if the image was retrieved from the local cache or from the network. |
| 92 | + * The fourth parameter is the original image url. |
| 93 | + */ |
| 94 | +- (void)sd_setImageWithURL:(nullable NSURL *)url |
| 95 | + placeholderImage:(nullable UIImage *)placeholder |
| 96 | + completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT; |
| 97 | + |
| 98 | +/** |
| 99 | + * Set the imageView `image` with an `url`, placeholder and custom options. |
| 100 | + * |
| 101 | + * The download is asynchronous and cached. |
| 102 | + * |
| 103 | + * @param url The url for the image. |
| 104 | + * @param placeholder The image to be set initially, until the image request finishes. |
| 105 | + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. |
| 106 | + * @param completedBlock A block called when operation has been completed. This block has no return value |
| 107 | + * and takes the requested UIImage as first parameter. In case of error the image parameter |
| 108 | + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean |
| 109 | + * indicating if the image was retrieved from the local cache or from the network. |
| 110 | + * The fourth parameter is the original image url. |
| 111 | + */ |
| 112 | +- (void)sd_setImageWithURL:(nullable NSURL *)url |
| 113 | + placeholderImage:(nullable UIImage *)placeholder |
| 114 | + options:(SDWebImageOptions)options |
| 115 | + completed:(nullable SDExternalCompletionBlock)completedBlock; |
| 116 | + |
| 117 | +/** |
| 118 | + * Set the imageView `image` with an `url`, placeholder and custom options. |
| 119 | + * |
| 120 | + * The download is asynchronous and cached. |
| 121 | + * |
| 122 | + * @param url The url for the image. |
| 123 | + * @param placeholder The image to be set initially, until the image request finishes. |
| 124 | + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. |
| 125 | + * @param progressBlock A block called while image is downloading |
| 126 | + * @note the progress block is executed on a background queue |
| 127 | + * @param completedBlock A block called when operation has been completed. This block has no return value |
| 128 | + * and takes the requested UIImage as first parameter. In case of error the image parameter |
| 129 | + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean |
| 130 | + * indicating if the image was retrieved from the local cache or from the network. |
| 131 | + * The fourth parameter is the original image url. |
| 132 | + */ |
| 133 | +- (void)sd_setImageWithURL:(nullable NSURL *)url |
| 134 | + placeholderImage:(nullable UIImage *)placeholder |
| 135 | + options:(SDWebImageOptions)options |
| 136 | + progress:(nullable SDImageLoaderProgressBlock)progressBlock |
| 137 | + completed:(nullable SDExternalCompletionBlock)completedBlock; |
| 138 | + |
| 139 | +/** |
| 140 | + * Set the imageView `image` with an `url`, placeholder, custom options and context. |
| 141 | + * |
| 142 | + * The download is asynchronous and cached. |
| 143 | + * |
| 144 | + * @param url The url for the image. |
| 145 | + * @param placeholder The image to be set initially, until the image request finishes. |
| 146 | + * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. |
| 147 | + * @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold. |
| 148 | + * @param progressBlock A block called while image is downloading |
| 149 | + * @note the progress block is executed on a background queue |
| 150 | + * @param completedBlock A block called when operation has been completed. This block has no return value |
| 151 | + * and takes the requested UIImage as first parameter. In case of error the image parameter |
| 152 | + * is nil and the second parameter may contain an NSError. The third parameter is a Boolean |
| 153 | + * indicating if the image was retrieved from the local cache or from the network. |
| 154 | + * The fourth parameter is the original image url. |
| 155 | + */ |
| 156 | +- (void)sd_setImageWithURL:(nullable NSURL *)url |
| 157 | + placeholderImage:(nullable UIImage *)placeholder |
| 158 | + options:(SDWebImageOptions)options |
| 159 | + context:(nullable SDWebImageContext *)context |
| 160 | + progress:(nullable SDImageLoaderProgressBlock)progressBlock |
| 161 | + completed:(nullable SDExternalCompletionBlock)completedBlock; |
| 162 | + |
| 163 | +@end |
0 commit comments