Skip to content

Commit

Permalink
US27/TA19: Add Sparkle framework.
Browse files Browse the repository at this point in the history
git-svn-id: https://time-tracker-mac.googlecode.com/svn/trunk@34 4511c099-ca26-0410-9445-25cf1b1ba2ba
  • Loading branch information
gruen0aermel committed Nov 15, 2007
1 parent 9b7bdff commit ebdb930
Show file tree
Hide file tree
Showing 208 changed files with 2,220 additions and 1 deletion.
1 change: 1 addition & 0 deletions Sparkle.framework/Headers
1 change: 1 addition & 0 deletions Sparkle.framework/Resources
1 change: 1 addition & 0 deletions Sparkle.framework/Sparkle
13 changes: 13 additions & 0 deletions Sparkle.framework/Versions/A/Headers/NSApplication+AppCopies.h
@@ -0,0 +1,13 @@
//
// NSApplication+AppCopies.h
// Sparkle
//
// Created by Andy Matuschak on 3/16/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//

#import <Cocoa/Cocoa.h>

@interface NSApplication (SUAppCopies)
- (int)copiesRunning;
@end
@@ -0,0 +1,11 @@
//
// NSFileManager+Authentication.m
// Sparkle
//
// Created by Andy Matuschak on 3/9/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//

@interface NSFileManager (SUAuthenticationAdditions)
- (BOOL)movePathWithAuthentication:(NSString *)src toPath:(NSString *)dst;
@end
15 changes: 15 additions & 0 deletions Sparkle.framework/Versions/A/Headers/NSFileManager+Verification.h
@@ -0,0 +1,15 @@
//
// NSFileManager+Verification.h
// Sparkle
//
// Created by Andy Matuschak on 3/16/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//

#import <Cocoa/Cocoa.h>

// For the paranoid folks!
@interface NSFileManager (SUVerification)
- (BOOL)validatePath:(NSString *)path withMD5Hash:(NSString *)hash;
- (BOOL)validatePath:(NSString *)path withEncodedDSASignature:(NSString *)encodedSignature;
@end
61 changes: 61 additions & 0 deletions Sparkle.framework/Versions/A/Headers/NSString+extras.h
@@ -0,0 +1,61 @@
/*
BSD License
Copyright (c) 2002, Brent Simmons
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ranchero.com or Brent Simmons nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/


/*
NSString+extras.h
NetNewsWire
Created by Brent Simmons on Fri Jun 14 2002.
Copyright (c) 2002 Brent Simmons. All rights reserved.
*/


#import <Foundation/Foundation.h>
#import <CoreFoundation/CoreFoundation.h>


@interface NSString (extras)

- (NSString *)stringWithSubstitute:(NSString *)subs forCharactersFromSet:(NSCharacterSet *)set;

- (NSString *) trimWhiteSpace;

- (NSString *) stripHTML;

- (NSString *) ellipsizeAfterNWords: (int) n;

+ (BOOL) stringIsEmpty: (NSString *) s;


@end
98 changes: 98 additions & 0 deletions Sparkle.framework/Versions/A/Headers/RSS.h
@@ -0,0 +1,98 @@
/*
BSD License
Copyright (c) 2002, Brent Simmons
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ranchero.com or Brent Simmons nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/*
RSS.h
A class for reading RSS feeds.
Created by Brent Simmons on Wed Apr 17 2002.
Copyright (c) 2002 Brent Simmons. All rights reserved.
*/


#import <Cocoa/Cocoa.h>
#import <CoreFoundation/CoreFoundation.h>
#import "NSString+extras.h"


@interface RSS : NSObject {

NSDictionary *headerItems;
NSMutableArray *newsItems;
NSString *version;

BOOL flRdf;
BOOL normalize;
}


/*Public*/

- (RSS *) initWithTitle: (NSString *) title andDescription: (NSString *) description;

- (RSS *) initWithData: (NSData *) rssData normalize: (BOOL) fl;

- (RSS *) initWithURL: (NSURL *) url normalize: (BOOL) fl;
- (RSS *) initWithURL: (NSURL *) url normalize: (BOOL) fl userAgent:(NSString *)userAgent;

- (NSDictionary *) headerItems;

- (NSMutableArray *) newsItems;

- (NSString *) version;

// AMM's extensions for Sparkle
- (NSDictionary *)newestItem;


/*Private*/

- (void) createheaderdictionary: (CFXMLTreeRef) tree;

- (void) createitemsarray: (CFXMLTreeRef) tree;

- (void) setversionstring: (CFXMLTreeRef) tree;

- (void) flattenimagechildren: (CFXMLTreeRef) tree into: (NSMutableDictionary *) dictionary;

- (void) flattensourceattributes: (CFXMLNodeRef) node into: (NSMutableDictionary *) dictionary;

- (CFXMLTreeRef) getchanneltree: (CFXMLTreeRef) tree;

- (CFXMLTreeRef) getnamedtree: (CFXMLTreeRef) currentTree name: (NSString *) name;

- (void) normalizeRSSItem: (NSMutableDictionary *) rssItem;

- (NSString *) getelementvalue: (CFXMLTreeRef) tree;

@end
27 changes: 27 additions & 0 deletions Sparkle.framework/Versions/A/Headers/SUAppcast.h
@@ -0,0 +1,27 @@
//
// SUAppcast.h
// Sparkle
//
// Created by Andy Matuschak on 3/12/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//

#import <Cocoa/Cocoa.h>

@class RSS, SUAppcastItem;
@interface SUAppcast : NSObject {
NSArray *items;
id delegate;
}

- (void)fetchAppcastFromURL:(NSURL *)url;
- (void)setDelegate:delegate;

- (SUAppcastItem *)newestItem;
- (NSArray *)items;

@end

@interface NSObject (SUAppcastDelegate)
- appcastDidFinishLoading:(SUAppcast *)appcast;
@end
57 changes: 57 additions & 0 deletions Sparkle.framework/Versions/A/Headers/SUAppcastItem.h
@@ -0,0 +1,57 @@
//
// SUAppcastItem.h
// Sparkle
//
// Created by Andy Matuschak on 3/12/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//

#import <Cocoa/Cocoa.h>


@interface SUAppcastItem : NSObject {
NSString *title;
NSDate *date;
NSString *description;

NSURL *releaseNotesURL;

NSString *DSASignature;
NSString *MD5Sum;

NSURL *fileURL;
NSString *fileVersion;
NSString *versionString;
}

// Initializes with data from a dictionary provided by the RSS class.
- initWithDictionary:(NSDictionary *)dict;

- (NSString *)title;
- (void)setTitle:(NSString *)aTitle;

- (NSDate *)date;
- (void)setDate:(NSDate *)aDate;

- (NSString *)description;
- (void)setDescription:(NSString *)aDescription;

- (NSURL *)releaseNotesURL;
- (void)setReleaseNotesURL:(NSURL *)aReleaseNotesURL;

- (NSString *)DSASignature;
- (void)setDSASignature:(NSString *)aDSASignature;

- (NSString *)MD5Sum;
- (void)setMD5Sum:(NSString *)aMd5Sum;

- (NSURL *)fileURL;
- (void)setFileURL:(NSURL *)aFileURL;

- (NSString *)fileVersion;
- (void)setFileVersion:(NSString *)aFileVersion;

- (NSString *)versionString;
- (void)setVersionString:(NSString *)versionString;

@end
21 changes: 21 additions & 0 deletions Sparkle.framework/Versions/A/Headers/SUAutomaticUpdateAlert.h
@@ -0,0 +1,21 @@
//
// SUAutomaticUpdateAlert.h
// Sparkle
//
// Created by Andy Matuschak on 3/18/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//

#import <Cocoa/Cocoa.h>

@class SUAppcastItem;
@interface SUAutomaticUpdateAlert : NSWindowController {
SUAppcastItem *updateItem;
}

- initWithAppcastItem:(SUAppcastItem *)item;

- (IBAction)relaunchNow:sender;
- (IBAction)relaunchLater:sender;

@end
20 changes: 20 additions & 0 deletions Sparkle.framework/Versions/A/Headers/SUConstants.h
@@ -0,0 +1,20 @@
//
// SUConstants.h
// Sparkle
//
// Created by Andy Matuschak on 3/16/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//

extern NSString *SUUpdaterWillRestartNotification;

extern NSString *SUCheckAtStartupKey;
extern NSString *SUFeedURLKey;
extern NSString *SUShowReleaseNotesKey;
extern NSString *SUSkippedVersionKey;
extern NSString *SUScheduledCheckIntervalKey;
extern NSString *SULastCheckTimeKey;
extern NSString *SUExpectsDSASignatureKey;
extern NSString *SUPublicDSAKeyKey;
extern NSString *SUAutomaticallyUpdateKey;
extern NSString *SUAllowsAutomaticUpdatesKey;
26 changes: 26 additions & 0 deletions Sparkle.framework/Versions/A/Headers/SUStatusChecker.h
@@ -0,0 +1,26 @@
//
// SUStatusChecker.h
// Sparkle
//
// Created by Evan Schoenberg on 7/6/06.
//

#import <Cocoa/Cocoa.h>
#import <Sparkle/SUUpdater.h>

@class SUStatusChecker;

@protocol SUStatusCheckerDelegate <NSObject>
//versionString will be nil and isNewVersion will be NO if version checking fails.
- (void)statusChecker:(SUStatusChecker *)statusChecker foundVersion:(NSString *)versionString isNewVersion:(BOOL)isNewVersion;
@end

@interface SUStatusChecker : SUUpdater {
id<SUStatusCheckerDelegate> scDelegate;
}

// Create a status checker which will notifiy delegate once the appcast version is determined.
// Notification occurs via the method defined in the SUStatusCheckerDelegate informal protocol.
+ (SUStatusChecker *)statusCheckerForDelegate:(id<SUStatusCheckerDelegate>)delegate;

@end

0 comments on commit ebdb930

Please sign in to comment.