Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef SUUPDATER_H
00010 #define SUUPDATER_H
00011
00012 #import <Sparkle/SUVersionComparisonProtocol.h>
00013
00014 @class SUUpdateDriver, SUAppcastItem, SUHost, SUAppcast;
00015 @interface SUUpdater : NSObject {
00016 NSTimer *checkTimer;
00017 SUUpdateDriver *driver;
00018
00019 SUHost *host;
00020 IBOutlet id delegate;
00021 }
00022
00023 + (SUUpdater *)sharedUpdater;
00024 + (SUUpdater *)updaterForBundle:(NSBundle *)bundle;
00025 - (NSBundle *)hostBundle;
00026
00027 - (void)setDelegate:(id)delegate;
00028 - delegate;
00029
00030 - (void)setAutomaticallyChecksForUpdates:(BOOL)automaticallyChecks;
00031 - (BOOL)automaticallyChecksForUpdates;
00032
00033 - (void)setUpdateCheckInterval:(NSTimeInterval)interval;
00034 - (NSTimeInterval)updateCheckInterval;
00035
00036 - (void)setFeedURL:(NSURL *)feedURL;
00037 - (NSURL *)feedURL;
00038
00039 - (void)setSendsSystemProfile:(BOOL)sendsSystemProfile;
00040 - (BOOL)sendsSystemProfile;
00041
00042 - (void)setAutomaticallyDownloadsUpdates:(BOOL)automaticallyDownloadsUpdates;
00043 - (BOOL)automaticallyDownloadsUpdates;
00044
00045
00046
00047 - (IBAction)checkForUpdates:sender;
00048
00049
00050
00051
00052 - (void)checkForUpdatesInBackground;
00053
00054
00055 - (NSDate*)lastUpdateCheckDate;
00056
00057
00058
00059 - (void)checkForUpdateInformation;
00060
00061
00062 - (void)resetUpdateCycle;
00063
00064 - (BOOL)updateInProgress;
00065 @end
00066
00067 @interface NSObject (SUUpdaterDelegateInformalProtocol)
00068
00069 - (NSArray *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile;
00070
00071
00072 - (BOOL)updaterShouldPromptForPermissionToCheckForUpdates:(SUUpdater *)bundle;
00073
00074
00075 - (void)updater:(SUUpdater *)updater didFinishLoadingAppcast:(SUAppcast *)appcast;
00076
00077
00078
00079 - (SUAppcastItem *)bestValidUpdateInAppcast:(SUAppcast *)appcast forUpdater:(SUUpdater *)bundle;
00080
00081
00082 - (void)updater:(SUUpdater *)updater didFindValidUpdate:(SUAppcastItem *)update;
00083
00084
00085 - (void)updaterDidNotFindUpdate:(SUUpdater *)update;
00086
00087
00088 - (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update;
00089
00090
00091 - (BOOL)updater:(SUUpdater *)updater shouldPostponeRelaunchForUpdate:(SUAppcastItem *)update untilInvoking:(NSInvocation *)invocation;
00092
00093
00094 - (void)updaterWillRelaunchApplication:(SUUpdater *)updater;
00095
00096
00097
00098 - (id <SUVersionComparison>)versionComparatorForUpdater:(SUUpdater *)updater;
00099
00100
00101 - (NSString *)pathToRelaunchForUpdater:(SUUpdater *)updater;
00102
00103 @end
00104
00105
00106 #ifdef DEBUG
00107 #define SU_MIN_CHECK_INTERVAL 60
00108 #else
00109 #define SU_MIN_CHECK_INTERVAL 60*60
00110 #endif
00111
00112 #ifdef DEBUG
00113 #define SU_DEFAULT_CHECK_INTERVAL 60
00114 #else
00115 #define SU_DEFAULT_CHECK_INTERVAL 60*60*24
00116 #endif
00117
00118 #endif