• Main Page
  • Related Pages
  • Classes
  • Files
  • File List
  • File Members

macosx/Sparkle.framework/Versions/A/Headers/SUUpdater.h

Go to the documentation of this file.
00001 //
00002 //  SUUpdater.h
00003 //  Sparkle
00004 //
00005 //  Created by Andy Matuschak on 1/4/06.
00006 //  Copyright 2006 Andy Matuschak. All rights reserved.
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 // This IBAction is meant for a main menu item. Hook up any menu item to this action,
00046 // and Sparkle will check for updates and report back its findings verbosely.
00047 - (IBAction)checkForUpdates:sender;
00048 
00049 // This kicks off an update meant to be programmatically initiated. That is, it will display no UI unless it actually finds an update,
00050 // in which case it proceeds as usual. If the fully automated updating is turned on, however, this will invoke that behavior, and if an
00051 // update is found, it will be downloaded and prepped for installation.
00052 - (void)checkForUpdatesInBackground;
00053 
00054 // Date of last update check. Returns null if no check has been performed.
00055 - (NSDate*)lastUpdateCheckDate;
00056 
00057 // This begins a "probing" check for updates which will not actually offer to update to that version. The delegate methods, though,
00058 // (up to updater:didFindValidUpdate: and updaterDidNotFindUpdate:), are called, so you can use that information in your UI.
00059 - (void)checkForUpdateInformation;
00060 
00061 // Call this to appropriately schedule or cancel the update checking timer according to the preferences for time interval and automatic checks. This call does not change the date of the next check, but only the internal NSTimer.
00062 - (void)resetUpdateCycle;
00063 
00064 - (BOOL)updateInProgress;
00065 @end
00066 
00067 @interface NSObject (SUUpdaterDelegateInformalProtocol)
00068 // This method allows you to add extra parameters to the appcast URL, potentially based on whether or not Sparkle will also be sending along the system profile. This method should return an array of dictionaries with keys: "key", "value", "displayKey", "displayValue", the latter two being specifically for display to the user.
00069 - (NSArray *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile;
00070 
00071 // Use this to override the default behavior for Sparkle prompting the user about automatic update checks.
00072 - (BOOL)updaterShouldPromptForPermissionToCheckForUpdates:(SUUpdater *)bundle;
00073 
00074 // Implement this if you want to do some special handling with the appcast once it finishes loading.
00075 - (void)updater:(SUUpdater *)updater didFinishLoadingAppcast:(SUAppcast *)appcast;
00076 
00077 // If you're using special logic or extensions in your appcast, implement this to use your own logic for finding
00078 // a valid update, if any, in the given appcast.
00079 - (SUAppcastItem *)bestValidUpdateInAppcast:(SUAppcast *)appcast forUpdater:(SUUpdater *)bundle;
00080 
00081 // Sent when a valid update is found by the update driver.
00082 - (void)updater:(SUUpdater *)updater didFindValidUpdate:(SUAppcastItem *)update;
00083 
00084 // Sent when a valid update is not found.
00085 - (void)updaterDidNotFindUpdate:(SUUpdater *)update;
00086 
00087 // Sent immediately before installing the specified update.
00088 - (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update;
00089 
00090 // Return YES to delay the relaunch until you do some processing; invoke the given NSInvocation to continue.
00091 - (BOOL)updater:(SUUpdater *)updater shouldPostponeRelaunchForUpdate:(SUAppcastItem *)update untilInvoking:(NSInvocation *)invocation;
00092 
00093 // Called immediately before relaunching.
00094 - (void)updaterWillRelaunchApplication:(SUUpdater *)updater;
00095 
00096 // This method allows you to provide a custom version comparator.
00097 // If you don't implement this method or return nil, the standard version comparator will be used.
00098 - (id <SUVersionComparison>)versionComparatorForUpdater:(SUUpdater *)updater;
00099 
00100 // Returns the path which is used to relaunch the client after the update is installed. By default, the path of the host bundle.
00101 - (NSString *)pathToRelaunchForUpdater:(SUUpdater *)updater;
00102 
00103 @end
00104 
00105 // Define some minimum intervals to avoid DOS-like checking attacks. These are in seconds.
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

Generated on Fri May 17 2013 05:31:48 for HandBrake by  doxygen 1.7.1