//
//  IconDownloader.h
//  Allzic
//
//  Created by Alia Bourouis on 13/03/14.
//  Copyright (c) 2014 Alia Bourouis. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol IconDownloaderDelegate;

@interface IconDownloader : NSObject {
	
    UIImage         *appIcon;
    NSIndexPath     *indexPathInTableView;
    id              <IconDownloaderDelegate> delegate;
    NSMutableData   *activeDownload;
    NSURLConnection *imageConnection;
    CGFloat         maxPictureSize;
    NSString        *iconUrl;
}

@property (nonatomic, retain) UIImage *appIcon;
@property (nonatomic, retain) NSIndexPath *indexPathInTableView;
@property (nonatomic, retain) id <IconDownloaderDelegate> delegate;
@property (nonatomic, retain) NSMutableData *activeDownload;
@property (nonatomic, retain) NSURLConnection *imageConnection;
@property (nonatomic, retain) NSString *iconUrl;

- (void)startDownloadAtUrl:(NSString *)url withMaxSize:(CGFloat)maxSize;
- (void)cancelDownload;

@end

@protocol IconDownloaderDelegate

- (id)init;
- (void)appImageDidLoad:(IconDownloader *)downloader;

@end
