PageRenderTime 21ms CodeModel.GetById 17ms app.highlight 3ms RepoModel.GetById 0ms app.codeStats 0ms

/iPhoneSample/Frameworks/FSKit.framework/Versions/A/Headers/FSKConnection.h

http://fskit.googlecode.com/
C Header | 140 lines | 44 code | 26 blank | 70 comment | 0 complexity | 162cf2f1c941f4a106fa69bd077a0d9f MD5 | raw file
Possible License(s): BSD-3-Clause
  1//
  2//  FamilySearchConnection.h
  3//  FamilySearchKit
  4//
  5//  Created by Logan Allred on 6/9/07.
  6//  Copyright 2008 Logan Allred. All rights reserved.
  7//
  8
  9#import <Foundation/Foundation.h>
 10
 11/*!
 12    @brief    FSKRequest brief
 13    @details  FSKRequest details
 14*/
 15
 16@class FSKRequest;
 17
 18/*!
 19    @brief   <#(description)#>
 20    @details <#(description)#>
 21*/
 22#define FSKitVersion @"0.1"
 23
 24/*!
 25    @brief   <#(description)#>
 26    @details <#(description)#>
 27*/
 28#define FSKitAgent @"FSKit"
 29
 30/*!
 31    @brief   <#(description)#>
 32    @details <#(description)#>
 33*/
 34extern NSString *kFSAPIProductionBaseURLString;  // Production
 35extern NSString *kFSAPIBetaBaseURLString;  // Beta
 36extern NSString *kFSAPIDevBaseURLString;  // Development
 37
 38/*!
 39    @class	FSKConnection
 40    @brief    Stores details needed to make connections to the FamilySearch web services, including authentication
 41	@details  (comprehensive description)
 42*/
 43@interface FSKConnection : NSObject {
 44
 45	NSString *baseURLString;
 46
 47	NSString *developerKey;
 48	NSString *_sessionId;
 49	BOOL needsAuthentication;
 50	BOOL _isAuthenticating;
 51	NSTimeInterval connectionTimeoutInterval;
 52	id _delegate;	
 53	NSMutableDictionary *responseDataCache;
 54	NSMutableArray *requestQueue;
 55}
 56
 57/*!
 58	@brief   (brief description)
 59	@details (comprehensive description)
 60*/
 61- (id)init;
 62
 63+ (id)sharedConnection;
 64
 65#pragma mark Accessors
 66
 67- (NSString *)baseURLString;
 68- (void)setBaseURLString:(NSString *)value;
 69
 70/**
 71 * Stores the developer key for this session, only used for login requests, but is required
 72 */
 73- (NSString *)developerKey;
 74- (void)setDeveloperKey:(NSString *)value;
 75
 76- (NSString *)sessionId;
 77- (void)setSessionId:(NSString *)value;
 78- (BOOL)hasSessionId;
 79
 80- (BOOL)needsAuthentication;
 81- (void)setNeedsAuthentication:(BOOL)value;
 82
 83- (NSString *)userAgentString;
 84- (void)setUserAgentString:(NSString *)newAgentString override:(BOOL)override;
 85
 86-(void)setConnectionTimeoutInterval:(double)aConnectionTimeoutInterval;
 87-(NSTimeInterval)connectionTimeoutInterval;
 88
 89- (id)delegate;
 90- (void)setDelegate:(id)value;
 91
 92
 93- (void)handleAuthenticationForRequest:(FSKRequest *)request;
 94@end
 95
 96#pragma mark -
 97#pragma mark Delegate Methods
 98/*!
 99    @category NSObject(FSKConnectionDelegate)
100
101    The FSKConnectionDelegate category on NSObject defines
102    FSKRequest delegate methods that can be implemented by
103    objects to receive informational callbacks about the asynchronous
104    load of a FamilySearch API request. For now it just allows a more
105	centralized location to handle authentication events than with
106	the FSKRequestDelegate. It may expand to serve as an alternate
107	to the other FSKRequestDelegate methods as well
108
109    <p>See FSKRequestDelegate for detailed documentation
110*/
111@interface NSObject (FSKConnectionDelegate)
112
113/*!
114    @brief Start authentication for a given challenge
115    @details Call useCredential:forAuthenticationChallenge:,
116    continueWithoutCredentialForAuthenticationChallenge: or cancelAuthenticationChallenge: on
117    the challenge sender when done.
118    @param request the request for which authentication is needed
119    @param challenge The NSURLAuthenticationChallenge to start authentication for
120*/
121- (void)request:(FSKRequest *)request didReceiveAuthenticationURL:(NSURL *)url;
122
123/*!
124    @brief   Provides the window to attach the authentication sheet to
125    @details If you implement this delegate method, you can choose which window will have
126	the authentication sheet attached to it during an authentication challenge. If you do not
127	implement this method, by default the sheet will attempt to attach to [NSApp mainWindow].
128	If you return nil, the authentication will be performed with an application modal dialog
129	instead of a sheet.
130*/
131//- (NSWindow *)windowForAuthenticationSheet:(FSKRequest *)request;
132
133/*!
134    @brief Cancel authentication for a given request
135    @param request the request for which authentication was cancelled
136    @param challenge The NSURLAuthenticationChallenge for which to cancel authentication
137*/
138- (void)request:(FSKRequest *)request didCancelAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge;
139
140@end