You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

58 lines
1.9 KiB

//
// WXYZ_BBBBBBBManager.h
// WXReader
//
// Created by Andrew on 2020/7/10.
// Copyright © 2020 Andrew. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "WXYZ_DownloadHelper.h"
#import "TFNovelDownloadTaskListModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface WXYZ_BookDownloadManager : NSObject <WXYZ_DownloadManagerEnumProtocol>
@property (nonatomic, copy) void (^downloadDeleteFinishBlock)(NSArray *success_chapter_ids, NSArray *fail_chapter);
// 总体任务下载回调
@property (nonatomic, copy) void (^downloadMissionStateChangeBlock)(WXYZ_DownloadMissionState state, NSInteger production_id, TFDownloadTaskModel *downloadTaskModel, NSArray<NSNumber *> * _Nullable chapterIDArray);
interface_singleton
/*
**/
// 下载章节(不支持自动订阅 && 支持多章下载)
- (void)downloadChaptersWithProductionModel:(TFProductionModel *)productionModel downloadTaskModel:(TFDownloadTaskModel *)downloadTaskModel production_id:(NSInteger)production_id start_chapter_id:(NSInteger)start_chapter_id downloadNum:(NSInteger)downloadNum;
/*
**/
// 删除本地已下载作品
- (BOOL)removeDownloadProductionWithProduction_id:(NSInteger)production_id;
/*
**/
// 获取已下载文件路径
- (NSString *)getChapterFilePathWithChapterModel:(TFProductionChapterModel *)chapterModel;
// 获取章节内容
- (NSString *)getFileContentsWithChapterModel:(TFProductionChapterModel * __nullable)chapterModel;
// 存储章节内容
- (void)storingFilesWithChapterModel:(TFProductionChapterModel * __nullable)chapterModel storingCompletionHandler:(void (^)(BOOL finishStoring))completionHandler;
// 获取下载状态
- (WXYZ_ProductionDownloadState)getDownloadMissionStateWithProduction_id:(NSInteger)production_id downloadTaskModel:(TFDownloadTaskModel *)downloadTaskModel;
// 获取某一已下载作品model
- (TFNovelDownloadTaskListModel *)getDownloadProductionModelWithProduction_id:(NSInteger)production_id;
@end
NS_ASSUME_NONNULL_END