Files
Sparkle/Sparkle/SUUserDriverCoreComponent.h
T
Zorg 46256b297b Do not pass the user driver in delegate methods
This is bad for a number of reasons.

1. Our SUUserDriver protocol wasn't quite the right protocol to pass in.
2. This made the UI/Core components to hold a depedency to the user driver, when it
really was not used for anything other than passing to the delegate. We can now
remove this bidirectional depedency between the components and the user driver.
3. This encourages that the client can handle multiple user drivers within the same class,
which encourages complexity. If they were able to set the delegate, they should have a reference
to the user driver.

Indeed, SUUpdater, SUUpdaterDelegate, and the update drivers all have the same problem.
An unfortunate design decision..
2016-03-12 15:53:00 -05:00

52 lines
1.6 KiB
Objective-C

//
// SUUserDriverCoreComponent.h
// Sparkle
//
// Created by Mayur Pawashe on 3/4/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "SUStatusCompletionResults.h"
@protocol SUStandardUserDriverDelegate;
@interface SUUserDriverCoreComponent : NSObject
- (instancetype)initWithDelegate:(id<SUStandardUserDriverDelegate>)delegate;
@property (nonatomic, readonly, weak) id<SUStandardUserDriverDelegate> delegate;
- (void)idleOnUpdateChecks:(BOOL)shouldIdleOnUpdateChecks;
@property (nonatomic, readonly) BOOL idlesOnUpdateChecks;
- (void)showUpdateInProgress:(BOOL)isUpdateInProgress;
@property (nonatomic, readonly, getter=isUpdateInProgress) BOOL updateInProgress;
@property (nonatomic, readonly) BOOL willInitiateNextUpdateCheck;
- (void)startUpdateCheckTimerWithNextTimeInterval:(NSTimeInterval)timeInterval reply:(void (^)(SUUpdateCheckTimerStatus))reply;
- (void)invalidateUpdateCheckTimer;
- (void)registerInstallUpdateHandler:(void (^)(SUInstallUpdateStatus))installUpdateHandler;
- (void)installAndRestart;
- (void)registerUpdateCheckStatusHandler:(void (^)(SUUserInitiatedCheckStatus))updateCheckStatusCompletion;
- (void)cancelUpdateCheckStatus;
- (void)completeUpdateCheckStatus;
- (void)registerDownloadStatusHandler:(void (^)(SUDownloadUpdateStatus))downloadUpdateStatusCompletion;
- (void)cancelDownloadStatus;
- (void)completeDownloadStatus;
- (void)registerAcknowledgement:(void (^)(void))acknowledgement;
- (void)acceptAcknowledgement;
- (void)dismissUpdateInstallation;
- (void)invalidate;
@end