~ubuntu-branches/ubuntu/quantal/sunpinyin/quantal

« back to all changes in this revision

Viewing changes to wrapper/macos/Frameworks/Sparkle.framework/Versions/A/Headers/SUUpdater.h

  • Committer: Package Import Robot
  • Author(s): YunQiang Su
  • Date: 2012-04-11 03:06:40 UTC
  • mfrom: (1.1.4) (1.2.8 sid)
  • Revision ID: package-import@ubuntu.com-20120411030640-8mxepz5e6wffy87c
Tags: 2.0.3+git20120404-1
* Medium urgency for fixing RC bug.
* New upstream commit: fix FTBFS with gcc-4.7 (Closes: #667385).
* Add Multi-Arch: same to libsunpinyin3, -dev and -dbg.
* Add YunQiang Su to uploaders.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//
2
 
//  SUUpdater.h
3
 
//  Sparkle
4
 
//
5
 
//  Created by Andy Matuschak on 1/4/06.
6
 
//  Copyright 2006 Andy Matuschak. All rights reserved.
7
 
//
8
 
 
9
 
#ifndef SUUPDATER_H
10
 
#define SUUPDATER_H
11
 
 
12
 
#import <Sparkle/SUVersionComparisonProtocol.h>
13
 
 
14
 
@class SUUpdateDriver, SUAppcastItem, SUHost, SUAppcast;
15
 
@interface SUUpdater : NSObject
16
 
{
17
 
@private
18
 
        NSTimer *checkTimer;
19
 
        SUUpdateDriver *driver;
20
 
 
21
 
        NSString *customUserAgentString;
22
 
        SUHost *host;
23
 
        IBOutlet id delegate;
24
 
}
25
 
 
26
 
+ (SUUpdater *)sharedUpdater;
27
 
+ (SUUpdater *)updaterForBundle:(NSBundle *)bundle;
28
 
- initForBundle:(NSBundle *)bundle;
29
 
 
30
 
- (NSBundle *)hostBundle;
31
 
 
32
 
- (void)setDelegate:(id)delegate;
33
 
- delegate;
34
 
 
35
 
- (void)setAutomaticallyChecksForUpdates:(BOOL)automaticallyChecks;
36
 
- (BOOL)automaticallyChecksForUpdates;
37
 
 
38
 
- (void)setUpdateCheckInterval:(NSTimeInterval)interval;
39
 
- (NSTimeInterval)updateCheckInterval;
40
 
 
41
 
- (void)setFeedURL:(NSURL *)feedURL;
42
 
- (NSURL *)feedURL;
43
 
 
44
 
- (void)setUserAgentString:(NSString *)userAgent;
45
 
- (NSString *)userAgentString;
46
 
 
47
 
- (void)setSendsSystemProfile:(BOOL)sendsSystemProfile;
48
 
- (BOOL)sendsSystemProfile;
49
 
 
50
 
- (void)setAutomaticallyDownloadsUpdates:(BOOL)automaticallyDownloadsUpdates;
51
 
- (BOOL)automaticallyDownloadsUpdates;
52
 
 
53
 
// This IBAction is meant for a main menu item. Hook up any menu item to this action,
54
 
// and Sparkle will check for updates and report back its findings verbosely.
55
 
- (IBAction)checkForUpdates:sender;
56
 
 
57
 
// This kicks off an update meant to be programmatically initiated. That is, it will display no UI unless it actually finds an update,
58
 
// in which case it proceeds as usual. If the fully automated updating is turned on, however, this will invoke that behavior, and if an
59
 
// update is found, it will be downloaded and prepped for installation.
60
 
- (void)checkForUpdatesInBackground;
61
 
 
62
 
// Date of last update check. Returns null if no check has been performed.
63
 
- (NSDate*)lastUpdateCheckDate;
64
 
 
65
 
// This begins a "probing" check for updates which will not actually offer to update to that version. The delegate methods, though,
66
 
// (up to updater:didFindValidUpdate: and updaterDidNotFindUpdate:), are called, so you can use that information in your UI.
67
 
- (void)checkForUpdateInformation;
68
 
 
69
 
// 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.
70
 
- (void)resetUpdateCycle;
71
 
 
72
 
- (BOOL)updateInProgress;
73
 
@end
74
 
 
75
 
@interface NSObject (SUUpdaterDelegateInformalProtocol)
76
 
// 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.
77
 
- (NSArray *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile;
78
 
 
79
 
// Use this to override the default behavior for Sparkle prompting the user about automatic update checks.
80
 
- (BOOL)updaterShouldPromptForPermissionToCheckForUpdates:(SUUpdater *)bundle;
81
 
 
82
 
// Implement this if you want to do some special handling with the appcast once it finishes loading.
83
 
- (void)updater:(SUUpdater *)updater didFinishLoadingAppcast:(SUAppcast *)appcast;
84
 
 
85
 
// If you're using special logic or extensions in your appcast, implement this to use your own logic for finding
86
 
// a valid update, if any, in the given appcast.
87
 
- (SUAppcastItem *)bestValidUpdateInAppcast:(SUAppcast *)appcast forUpdater:(SUUpdater *)bundle;
88
 
 
89
 
// Sent when a valid update is found by the update driver.
90
 
- (void)updater:(SUUpdater *)updater didFindValidUpdate:(SUAppcastItem *)update;
91
 
 
92
 
// Sent when a valid update is not found.
93
 
- (void)updaterDidNotFindUpdate:(SUUpdater *)update;
94
 
 
95
 
// Sent immediately before installing the specified update.
96
 
- (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update;
97
 
 
98
 
// Return YES to delay the relaunch until you do some processing; invoke the given NSInvocation to continue.
99
 
- (BOOL)updater:(SUUpdater *)updater shouldPostponeRelaunchForUpdate:(SUAppcastItem *)update untilInvoking:(NSInvocation *)invocation;
100
 
 
101
 
// Called immediately before relaunching.
102
 
- (void)updaterWillRelaunchApplication:(SUUpdater *)updater;
103
 
 
104
 
// This method allows you to provide a custom version comparator.
105
 
// If you don't implement this method or return nil, the standard version comparator will be used.
106
 
- (id <SUVersionComparison>)versionComparatorForUpdater:(SUUpdater *)updater;
107
 
 
108
 
// Returns the path which is used to relaunch the client after the update is installed. By default, the path of the host bundle.
109
 
- (NSString *)pathToRelaunchForUpdater:(SUUpdater *)updater;
110
 
 
111
 
@end
112
 
 
113
 
// Define some minimum intervals to avoid DOS-like checking attacks. These are in seconds.
114
 
#ifdef DEBUG
115
 
#define SU_MIN_CHECK_INTERVAL 60
116
 
#else
117
 
#define SU_MIN_CHECK_INTERVAL 60*60
118
 
#endif
119
 
 
120
 
#ifdef DEBUG
121
 
#define SU_DEFAULT_CHECK_INTERVAL 60
122
 
#else
123
 
#define SU_DEFAULT_CHECK_INTERVAL 60*60*24
124
 
#endif
125
 
 
126
 
#endif