//
//  BPDownloadManager.h
//  BreakPointDownload
//
//  Created by 黄亚州 on 2017/5/30.
//  Copyright © 2017年 黄亚州. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "BPNetWorkConfig.h"

@class BPDownloadContent;

@interface BPDownloadManager : NSObject

@property (nonatomic, assign) NSInteger maxDownLoad; // 同时存在的最大下载数
@property (nonatomic, assign) EDownloadType type;

/**
 * @description 添加下载任务
 * @param aContent 下载所需数据
 * @param aProgress 下载进度block
 * @param aComplete 下载完成或者失败block
 */
- (void)downloadContent:(BPDownloadContent *)aContent
             onProgress:(void(^)(int64_t completeBytes, int64_t totalBytes))aProgress
             onComplete:(void(^)(BPDownloadContent *aContent, NSError *aError))aComplete;

/**
 * @description 取消下载任务
 * @param urlString 下载地址
 */
- (void)cancelUrlString:(NSString *)urlString;

/**
 * @description 取消block进度回调，线程切换
 */
- (void)cancelBlock;

//进入后台临时暂停下载器
- (void)appDidEnterBackgroundPauseDownload;
//进入前台开启下载器
- (void)appDidEnterBackgroundContinueDownload;

@end
