mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-27 05:04:27 +00:00
37 lines
1.7 KiB
Objective-C
37 lines
1.7 KiB
Objective-C
//
|
|
// SPUUpdateDriver.h
|
|
// Sparkle
|
|
//
|
|
// Created by Mayur Pawashe on 3/15/16.
|
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
|
//
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
@protocol SPUResumableUpdate;
|
|
|
|
typedef void (^SPUUpdateDriverCompletion)(BOOL shouldShowUpdateImmediately, id<SPUResumableUpdate> _Nullable resumableUpdate);
|
|
|
|
// This protocol describes an update driver that drives updates
|
|
// An update driver may have multiple levels of other controller components (eg: basic update driver, core based update driver, ui based update driver, appcast driver, etc)
|
|
// The update driver and the components the driver has communicates via parameter passing and delegation..
|
|
// The old Sparkle architecture communicated via subclassing and method overriding, but this lead to bugs due to high coupling, and complexity of not being aware of methods being executed.
|
|
// The newer architecture is still complex but should be more reliable to maintain and extend.
|
|
@protocol SPUUpdateDriver <NSObject>
|
|
|
|
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary * _Nullable)httpHeaders preventingInstallerInteraction:(BOOL)preventsInstallerInteraction completion:(SPUUpdateDriverCompletion)completionBlock;
|
|
|
|
- (void)resumeInstallingUpdateWithCompletion:(SPUUpdateDriverCompletion)completionBlock;
|
|
|
|
- (void)resumeUpdate:(id<SPUResumableUpdate>)resumableUpdate completion:(SPUUpdateDriverCompletion)completionBlock;
|
|
|
|
// A likely implementation of -abortUpdate is invoking -abortUpdateWithError: by passing nil
|
|
- (void)abortUpdate;
|
|
|
|
// This should be invoked on the update driver to finish the update driver's work
|
|
- (void)abortUpdateWithError:(NSError * _Nullable)error;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|