~sense/ubuntu/lucid/transmission/fix-497882

« back to all changes in this revision

Viewing changes to macosx/Sparkle.framework/Versions/A/Headers/SUUpdater.h

  • Committer: Bazaar Package Importer
  • Author(s): Chris Coulson
  • Date: 2008-11-28 15:33:48 UTC
  • mfrom: (1.1.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20081128153348-it70trfnxiroblmc
Tags: 1.40-0ubuntu1
* New upstream release (LP: #302672)
  - Tracker communication uses fewer resources
  - More accurate bandwidth limits
  - Reduce disk fragmentation by preallocating files (LP: #287726)
  - Stability, security and performance improvements to the RPC /
    Web UI server (closes LP: #290423)
  - Support compression when serving Web UI and RPC responses
  - Simplify the RPC whitelist
  - Fix bug that prevented handshakes with encrypted BitComet peers
  - Fix 1.3x bug that could re-download some data unnecessarily
    (LP: #295040)
  - Option to automatically update the blocklist weekly
  - Added off-hour bandwidth scheduling
  - Simplify file/priority selection in the details dialog
  - Fix a couple of crashes
  - New / updated translations
  - Don't inhibit hibernation by default (LP: #292929)
  - Use "close" animation when sending to notification area (LP: #130811)
  - Fix resize problems (LP: #269872)
  - Support "--version" option when launching from command line
    (LP: #292011)
  - Correctly parse announce URLs that have leading or trailing
    spaces (LP: #262411)
  - Display an error when "Open Torrent" fails (LP: #281463)
* Dropped 10_fix_crasher_from_upstream.dpatch: Fix is in this
  upstream release.
* debian/control: Don't just build-depend on libcurl-dev, which is
  a virtual package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
//  Copyright 2006 Andy Matuschak. All rights reserved.
7
7
//
8
8
 
9
 
#import <Cocoa/Cocoa.h>
10
 
 
11
 
// Before you use Sparkle in your app, you must set SUFeedURL in Info.plist to the
12
 
// address of the appcast on your webserver. If you don't already have an 
13
 
// appcast, please see the Sparkle documentation to learn about how to set one up.
14
 
 
15
 
// .zip, .dmg, .tar, .tbz, .tgz archives are supported at this time.
16
 
 
17
 
// By default, Sparkle offers to show the user the release notes of the build they'll be
18
 
// getting, which it assumes are in the description (or body) field of the relevant RSS item.
19
 
// Set SUShowReleaseNotes to <false/> in Info.plist to hide the button.
20
 
 
21
 
@class SUAppcastItem, SUUpdateAlert, SUStatusController;
 
9
#ifndef SUUPDATER_H
 
10
#define SUUPDATER_H
 
11
 
 
12
#import <Sparkle/SUVersionComparisonProtocol.h>
 
13
 
 
14
@class SUUpdateDriver, SUAppcastItem, SUHost, SUAppcast;
22
15
@interface SUUpdater : NSObject {
23
 
        SUAppcastItem *updateItem;
24
 
        
25
 
        SUStatusController *statusController;
26
 
        SUUpdateAlert *updateAlert;
27
 
        
28
 
        NSURLDownload *downloader;
29
 
        NSString *downloadPath;
30
 
                        
31
16
        NSTimer *checkTimer;
32
 
        NSTimeInterval checkInterval;   
 
17
        SUUpdateDriver *driver;
33
18
        
34
 
        BOOL verbose;
35
 
        BOOL updateInProgress;
 
19
        SUHost *host;
 
20
        IBOutlet id delegate;
36
21
}
37
22
 
 
23
+ (SUUpdater *)sharedUpdater;
 
24
+ (SUUpdater *)updaterForBundle:(NSBundle *)bundle;
 
25
- (NSBundle *)hostBundle;
 
26
 
 
27
- (void)setDelegate:(id)delegate;
 
28
- delegate;
 
29
 
 
30
- (void)setAutomaticallyChecksForUpdates:(BOOL)automaticallyChecks;
 
31
- (BOOL)automaticallyChecksForUpdates;
 
32
 
 
33
- (void)setUpdateCheckInterval:(NSTimeInterval)interval;
 
34
- (NSTimeInterval)updateCheckInterval;
 
35
 
 
36
- (void)setFeedURL:(NSURL *)feedURL;
 
37
- (NSURL *)feedURL;
 
38
 
 
39
- (void)setSendsSystemProfile:(BOOL)sendsSystemProfile;
 
40
- (BOOL)sendsSystemProfile;
 
41
 
 
42
- (void)setAutomaticallyDownloadsUpdates:(BOOL)automaticallyDownloadsUpdates;
 
43
- (BOOL)automaticallyDownloadsUpdates;
 
44
 
38
45
// This IBAction is meant for a main menu item. Hook up any menu item to this action,
39
46
// and Sparkle will check for updates and report back its findings verbosely.
40
47
- (IBAction)checkForUpdates:sender;
41
48
 
42
 
// This method is similar to the above, but it's intended for updates initiated by
43
 
// the computer instead of by the user. It does not alert the user when he is up to date,
44
 
// and it remains silent about network errors in fetching the feed. This is what you
45
 
// want to call to update programmatically; only use checkForUpdates: with buttons and menu items.
 
49
// This kicks off an update meant to be programmatically initiated. That is, it will display no UI unless it actually finds an update,
 
50
// in which case it proceeds as usual. If the fully automated updating is turned on, however, this will invoke that behavior, and if an
 
51
// update is found, it will be downloaded and prepped for installation.
46
52
- (void)checkForUpdatesInBackground;
47
53
 
48
 
// This method allows you to schedule a check to run every time interval. You can
49
 
// pass 0 to this method to cancel a previously scheduled timer. You probably don't want
50
 
// to call this directly: if you set a SUScheduledCheckInterval key in Info.plist or
51
 
// the user defaults, Sparkle will set this up for you automatically on startup. You might
52
 
// just want to call this every time the user changes the setting in the preferences.
53
 
- (void)scheduleCheckWithInterval:(NSTimeInterval)interval;
54
 
 
55
 
@end
 
 
b'\\ No newline at end of file'
 
54
// Date of last update check. Returns null if no check has been performed.
 
55
- (NSDate*)lastUpdateCheckDate;
 
56
 
 
57
// This begins a "probing" check for updates which will not actually offer to update to that version. The delegate methods, though,
 
58
// (up to updater:didFindValidUpdate: and updaterDidNotFindUpdate:), are called, so you can use that information in your UI.
 
59
- (void)checkForUpdateInformation;
 
60
 
 
61
// 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.
 
62
- (void)resetUpdateCycle;
 
63
 
 
64
- (BOOL)updateInProgress;
 
65
@end
 
66
 
 
67
@interface NSObject (SUUpdaterDelegateInformalProtocol)
 
68
// 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.
 
69
- (NSArray *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile;
 
70
 
 
71
// Use this to override the default behavior for Sparkle prompting the user about automatic update checks.
 
72
- (BOOL)updaterShouldPromptForPermissionToCheckForUpdates:(SUUpdater *)bundle;
 
73
 
 
74
// Implement this if you want to do some special handling with the appcast once it finishes loading.
 
75
- (void)updater:(SUUpdater *)updater didFinishLoadingAppcast:(SUAppcast *)appcast;
 
76
 
 
77
// If you're using special logic or extensions in your appcast, implement this to use your own logic for finding
 
78
// a valid update, if any, in the given appcast.
 
79
- (SUAppcastItem *)bestValidUpdateInAppcast:(SUAppcast *)appcast forUpdater:(SUUpdater *)bundle;
 
80
 
 
81
// Sent when a valid update is found by the update driver.
 
82
- (void)updater:(SUUpdater *)updater didFindValidUpdate:(SUAppcastItem *)update;
 
83
 
 
84
// Sent when a valid update is not found.
 
85
- (void)updaterDidNotFindUpdate:(SUUpdater *)update;
 
86
 
 
87
// Sent immediately before installing the specified update.
 
88
- (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update;
 
89
 
 
90
// Return YES to delay the relaunch until you do some processing; invoke the given NSInvocation to continue.
 
91
- (BOOL)updater:(SUUpdater *)updater shouldPostponeRelaunchForUpdate:(SUAppcastItem *)update untilInvoking:(NSInvocation *)invocation;
 
92
 
 
93
// Called immediately before relaunching.
 
94
- (void)updaterWillRelaunchApplication:(SUUpdater *)updater;
 
95
 
 
96
// This method allows you to provide a custom version comparator.
 
97
// If you don't implement this method or return nil, the standard version comparator will be used.
 
98
- (id <SUVersionComparison>)versionComparatorForUpdater:(SUUpdater *)updater;
 
99
 
 
100
// Returns the path which is used to relaunch the client after the update is installed. By default, the path of the host bundle.
 
101
- (NSString *)pathToRelaunchForUpdater:(SUUpdater *)updater;
 
102
 
 
103
@end
 
104
 
 
105
// Define some minimum intervals to avoid DOS-like checking attacks. These are in seconds.
 
106
#ifdef DEBUG
 
107
#define SU_MIN_CHECK_INTERVAL 60
 
108
#else
 
109
#define SU_MIN_CHECK_INTERVAL 60*60
 
110
#endif
 
111
 
 
112
#ifdef DEBUG
 
113
#define SU_DEFAULT_CHECK_INTERVAL 60
 
114
#else
 
115
#define SU_DEFAULT_CHECK_INTERVAL 60*60*24
 
116
#endif
 
117
 
 
118
#endif