2022-01-20 18:27:56 +00:00
|
|
|
// This file Copyright © 2008-2022 Transmission authors and contributors.
|
|
|
|
// It may be used under the MIT (SPDX: MIT) license.
|
|
|
|
// License text can be found in the licenses/ folder.
|
2008-03-29 23:38:38 +00:00
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
|
2008-08-31 19:47:11 +00:00
|
|
|
@class BlocklistDownloaderViewController;
|
2008-03-29 23:38:38 +00:00
|
|
|
|
2021-08-15 09:41:48 +00:00
|
|
|
typedef NS_ENUM(unsigned int, blocklistDownloadState) { //
|
2008-08-31 21:10:45 +00:00
|
|
|
BLOCKLIST_DL_START,
|
|
|
|
BLOCKLIST_DL_DOWNLOADING,
|
|
|
|
BLOCKLIST_DL_PROCESSING
|
2021-08-07 07:27:56 +00:00
|
|
|
};
|
2008-08-31 21:10:45 +00:00
|
|
|
|
2021-11-10 18:55:15 +00:00
|
|
|
@interface BlocklistDownloader : NSObject<NSURLSessionDownloadDelegate>
|
2008-08-31 19:47:11 +00:00
|
|
|
{
|
2021-11-10 18:55:15 +00:00
|
|
|
NSURLSession* fSession;
|
2017-01-24 17:53:16 +00:00
|
|
|
|
2021-08-15 09:41:48 +00:00
|
|
|
BlocklistDownloaderViewController* fViewController;
|
2017-01-24 17:53:16 +00:00
|
|
|
|
2008-03-29 23:38:38 +00:00
|
|
|
NSUInteger fCurrentSize;
|
|
|
|
long long fExpectedSize;
|
2017-01-24 17:53:16 +00:00
|
|
|
|
2008-08-31 21:10:45 +00:00
|
|
|
blocklistDownloadState fState;
|
2008-03-29 23:38:38 +00:00
|
|
|
}
|
|
|
|
|
2021-08-15 09:41:48 +00:00
|
|
|
+ (BlocklistDownloader*)downloader; //starts download if not already occuring
|
|
|
|
@property(nonatomic, class, readonly) BOOL isRunning;
|
2008-08-31 20:26:41 +00:00
|
|
|
|
2021-08-15 09:41:48 +00:00
|
|
|
- (void)setViewController:(BlocklistDownloaderViewController*)viewController;
|
2008-03-29 23:38:38 +00:00
|
|
|
|
2021-08-15 09:41:48 +00:00
|
|
|
- (void)cancelDownload;
|
2008-03-29 23:38:38 +00:00
|
|
|
|
|
|
|
@end
|