2009-09-24 05:22:48 +08:00
/*
* 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 .
2010-06-02 07:37:39 +08:00
*/
2009-09-24 05:22:48 +08:00
2011-03-15 21:05:49 +08:00
# import "SDWebImageCompat.h"
2009-09-24 05:22:48 +08:00
# import "SDWebImageDownloaderDelegate.h"
2009-09-29 05:56:24 +08:00
# import "SDWebImageManagerDelegate.h"
2010-09-17 04:56:11 +08:00
# import "SDImageCacheDelegate.h"
2009-09-24 05:22:48 +08:00
2011-10-03 21:52:56 +08:00
typedef enum
{
2011-10-04 22:02:52 +08:00
SDWebImageRetryFailed = 1 < < 0 ,
SDWebImageLowPriority = 1 < < 1 ,
SDWebImageCacheMemoryOnly = 1 < < 2
2011-10-03 21:52:56 +08:00
} SDWebImageOptions ;
2010-09-17 04:56:11 +08:00
@ interface SDWebImageManager : NSObject < SDWebImageDownloaderDelegate , SDImageCacheDelegate >
2009-09-24 05:22:48 +08:00
{
2011-07-13 08:32:33 +08:00
NSMutableArray * downloadDelegates ;
2009-09-24 05:22:48 +08:00
NSMutableArray * downloaders ;
2011-07-13 08:32:33 +08:00
NSMutableArray * cacheDelegates ;
2009-09-24 05:22:48 +08:00
NSMutableDictionary * downloaderForURL ;
NSMutableArray * failedURLs ;
}
+ ( id ) sharedManager ;
- ( UIImage * ) imageWithURL : ( NSURL * ) url ;
- ( void ) downloadWithURL : ( NSURL * ) url delegate : ( id < SDWebImageManagerDelegate > ) delegate ;
2011-10-03 21:52:56 +08:00
- ( 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
2009-09-24 05:22:48 +08:00
- ( void ) cancelForDelegate : ( id < SDWebImageManagerDelegate > ) delegate ;
@ end