Files
Sparkle/SUUpdater.h
T
andym bc3be9a1f2 Touched practically every line of code in a super-monster-awesome refactoring. Please read:
- Broke out SUUpdater functionality into update drivers. There's a basic one from which everything else inherits, then a user-initiated one, an automatic one, and a scheduled one. It's super-clean-and-shiny.
- Destroyed the abomination that was SUStatusChecker. In its place is SUProbingUpdateDriver, which is like 10 lines long.
- Made automatic installation less stupid. It used to install, THEN offer to relaunch. That's dumb, beacuse if the user says no, the app is running from the trash. Now it offers to install and relaunch or to install on quit.
- Renamed like every method and symbol. I hope you didn't branch anything.
- Reorganized the project hierarchy to be much clearer and easier to navigate.
- Reworked the error system to no use NSError instead of exceptions; extra technical information is now logged to the console so that we can find problems.
- A bunch of other small bugfixes in things I noticed along the way but no longer remember.
- Probably a ton of other stuff.
Read over the code and see what I've done. Then PLEASE test this with your app internally and let me know how it goes. This revision is hereby NOT YET DECLARED SAFE FOR PUBLIC RELEASE. But because I'm still using SVN, this is how things have to be.
2008-05-08 07:12:41 +00:00

69 lines
1.9 KiB
Objective-C

//
// SUUpdater.h
// Sparkle
//
// Created by Andy Matuschak on 1/4/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#ifndef SUUPDATER_H
#define SUUPDATER_H
@class SUUpdateDriver;
@interface SUUpdater : NSObject {
NSTimer *checkTimer;
NSTimeInterval checkInterval;
SUUpdateDriver *driver;
NSBundle *hostBundle;
id delegate;
}
- (void)setHostBundle:(NSBundle *)hostBundle;
- (void)setDelegate:(id)delegate;
// This IBAction is meant for a main menu item. Hook up any menu item to this action,
// and Sparkle will check for updates and report back its findings verbosely.
- (IBAction)checkForUpdates:sender;
// This forces an update to begin with a particular driver (see SU*UpdateDriver.h)
- (void)checkForUpdatesWithDriver:(SUUpdateDriver *)driver;
- (BOOL)updateInProgress;
@end
@interface NSObject (SUUpdaterDelegateInformalProtocol)
/*!
@method
@abstract Delegate method for host apps to define additional feed parameters
@discussion 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 the following keys:
key: The key to be used when reporting data to the server
visibleKey: Alternate version of key to be used in UI displays of profile information
value: Value to be used when reporting data to the server
visibleValue: Alternate version of value to be used in UI displays of profile information.
*/
- (NSArray *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile;
@end
// Define some minimum intervals to avoid DOS-like checking attacks. These are in seconds.
#ifdef DEBUG
#define SU_MIN_CHECK_INTERVAL 60
#else
#define SU_MIN_CHECK_INTERVAL 60*60
#endif
#ifdef DEBUG
#define SU_DEFAULT_CHECK_INTERVAL 60
#else
#define SU_DEFAULT_CHECK_INTERVAL 60*60*24
#endif
#endif