CNLiveWebImageManager.h
1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// CNLiveWebImageManager.h
// WSWebImageDemo
//
// Created by 王帅 on 16/7/27.
// Copyright © 2016年 王帅. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "CNLiveWebImageBlock.h"
#import "CNLiveWebImageOperation.h"
typedef NS_OPTIONS(NSUInteger, CNLiveWebImageOptions) {
CNLiveWebImageRetryFailed = 1 << 0,
CNLiveWebImageCacheMemoryOnly = 1 << 1,
CNLiveWebImageProgressiveDownload = 1 << 2,
CNLiveWebImageContinueInBackground = 1 << 3
};
@interface CNLiveWebImageManager : NSObject
+ (nonnull id)sharedManager;
- (nonnull id <CNLiveWebImageOperation>)downloadWebImageWithURL:(nonnull NSURL *)url options:(CNLiveWebImageOptions)options progress:(nonnull CNLiveDownloadProgressBlock)progress completed:(nonnull CNLiveDownloadCompletedBlock)completed;
- (void)storeImage:(nonnull UIImage *)image imageUrl:(nonnull NSURL *)url toDisk:(BOOL)toDisk;
- (nullable UIImage *)imageFromMemoryCacheWithImageUrl:(nonnull NSURL *)url;
- (nullable UIImage *)imageFromDiskCacheWithImageUrl:(nonnull NSURL *)url;
- (BOOL)queryDiskCacheWithImageUrl:(nonnull NSURL *)url done:(nonnull CNLiveWebImageQueryCompletedBlock)doneBlock;
- (void)removeCacheWithUrl:(nonnull NSURL *)url done:(nonnull CNLiveCompletedBlock)completed;
- (long long)diskCacheSize;
- (void)clearMemory;
- (void)clearDisk;
@end