Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adding Dropbox SDK v1.

  • Loading branch information...
commit deee7cb36eb02029d4d91ac6c658543af11d46c5 1 parent c9ddddd
@ctrompette ctrompette authored webframp committed
Showing with 1,796 additions and 0 deletions.
  1. BIN  DropboxSDK.framework/DropboxSDK
  2. +36 −0 DropboxSDK.framework/Headers/Base64Transcoder.h
  3. +29 −0 DropboxSDK.framework/Headers/DBAccountInfo.h
  4. +10 −0 DropboxSDK.framework/Headers/DBDefines.h
  5. +21 −0 DropboxSDK.framework/Headers/DBDeltaEntry.h
  6. +21 −0 DropboxSDK.framework/Headers/DBError.h
  7. +75 −0 DropboxSDK.framework/Headers/DBJSON.h
  8. +86 −0 DropboxSDK.framework/Headers/DBJsonBase.h
  9. +87 −0 DropboxSDK.framework/Headers/DBJsonParser.h
  10. +129 −0 DropboxSDK.framework/Headers/DBJsonWriter.h
  11. +38 −0 DropboxSDK.framework/Headers/DBLog.h
  12. +47 −0 DropboxSDK.framework/Headers/DBMetadata.h
  13. +23 −0 DropboxSDK.framework/Headers/DBQuota.h
  14. +77 −0 DropboxSDK.framework/Headers/DBRequest.h
  15. +220 −0 DropboxSDK.framework/Headers/DBRestClient.h
  16. +22 −0 DropboxSDK.framework/Headers/DBSession+iOS.h
  17. +59 −0 DropboxSDK.framework/Headers/DBSession.h
  18. +7 −0 DropboxSDK.framework/Headers/DropboxSDK-Prefix.pch
  19. +20 −0 DropboxSDK.framework/Headers/DropboxSDK.h
  20. +55 −0 DropboxSDK.framework/Headers/JSON.h
  21. +14 −0 DropboxSDK.framework/Headers/MPDebug.h
  22. +20 −0 DropboxSDK.framework/Headers/MPOAuth.h
  23. +86 −0 DropboxSDK.framework/Headers/MPOAuthAPI.h
  24. +50 −0 DropboxSDK.framework/Headers/MPOAuthAPIRequestLoader.h
  25. +30 −0 DropboxSDK.framework/Headers/MPOAuthAuthenticationMethod.h
  26. +44 −0 DropboxSDK.framework/Headers/MPOAuthAuthenticationMethodOAuth.h
  27. +29 −0 DropboxSDK.framework/Headers/MPOAuthConnection.h
  28. +18 −0 DropboxSDK.framework/Headers/MPOAuthCredentialConcreteStore+KeychainAdditions.h
  29. +40 −0 DropboxSDK.framework/Headers/MPOAuthCredentialConcreteStore.h
  30. +33 −0 DropboxSDK.framework/Headers/MPOAuthCredentialStore.h
  31. +28 −0 DropboxSDK.framework/Headers/MPOAuthParameterFactory.h
  32. +28 −0 DropboxSDK.framework/Headers/MPOAuthSignatureParameter.h
  33. +32 −0 DropboxSDK.framework/Headers/MPOAuthURLRequest.h
  34. +20 −0 DropboxSDK.framework/Headers/MPOAuthURLResponse.h
  35. +30 −0 DropboxSDK.framework/Headers/MPURLRequestParameter.h
  36. +15 −0 DropboxSDK.framework/Headers/NSDictionary+Dropbox.h
  37. +68 −0 DropboxSDK.framework/Headers/NSObject+DBJSON.h
  38. +58 −0 DropboxSDK.framework/Headers/NSString+DBJSON.h
  39. +18 −0 DropboxSDK.framework/Headers/NSString+Dropbox.h
  40. +21 −0 DropboxSDK.framework/Headers/NSString+URLEscapingAdditions.h
  41. +21 −0 DropboxSDK.framework/Headers/NSURL+MPURLParameterAdditions.h
  42. +14 −0 DropboxSDK.framework/Headers/NSURLResponse+Encoding.h
  43. +17 −0 DropboxSDK.framework/Headers/UIAlertView+Dropbox.h
  44. BIN  DropboxSDK.framework/Info.plist
View
BIN  DropboxSDK.framework/DropboxSDK
Binary file not shown
View
36 DropboxSDK.framework/Headers/Base64Transcoder.h
@@ -0,0 +1,36 @@
+/*
+ * Base64Transcoder.h
+ * Base64Test
+ *
+ * Created by Jonathan Wight on Tue Mar 18 2003.
+ * Copyright (c) 2003 Toxic Software. All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ */
+
+#include <stdlib.h>
+#include <stdbool.h>
+
+extern size_t EstimateBas64EncodedDataSize(size_t inDataSize);
+extern size_t EstimateBas64DecodedDataSize(size_t inDataSize);
+
+extern bool Base64EncodeData(const void *inInputData, size_t inInputDataSize, char *outOutputData, size_t *ioOutputDataSize);
+extern bool Base64DecodeData(const void *inInputData, size_t inInputDataSize, void *ioOutputData, size_t *ioOutputDataSize);
+
View
29 DropboxSDK.framework/Headers/DBAccountInfo.h
@@ -0,0 +1,29 @@
+//
+// DBAccountInfo.h
+// DropboxSDK
+//
+// Created by Brian Smith on 5/3/10.
+// Copyright 2010 Dropbox, Inc. All rights reserved.
+//
+
+
+#import "DBQuota.h"
+
+@interface DBAccountInfo : NSObject <NSCoding> {
+ NSString* country;
+ NSString* displayName;
+ DBQuota* quota;
+ NSString* userId;
+ NSString* referralLink;
+ NSDictionary* original;
+}
+
+- (id)initWithDictionary:(NSDictionary*)dict;
+
+@property (nonatomic, readonly) NSString* country;
+@property (nonatomic, readonly) NSString* displayName;
+@property (nonatomic, readonly) DBQuota* quota;
+@property (nonatomic, readonly) NSString* userId;
+@property (nonatomic, readonly) NSString* referralLink;
+
+@end
View
10 DropboxSDK.framework/Headers/DBDefines.h
@@ -0,0 +1,10 @@
+//
+// DBDefines.h
+// DropboxSDK
+//
+// Created by Brian Smith on 8/8/11.
+// Copyright 2011 Dropbox, Inc. All rights reserved.
+//
+
+// Taken from three20 (http://three20.info/)
+#define DB_FIX_CATEGORY_BUG(name) @interface DB_FIX_CATEGORY_BUG##name @end @implementation DB_FIX_CATEGORY_BUG##name @end
View
21 DropboxSDK.framework/Headers/DBDeltaEntry.h
@@ -0,0 +1,21 @@
+//
+// DBDeltaEntry.h
+// DropboxSDK
+//
+// Created by Brian Smith on 3/25/12.
+// Copyright (c) 2012 Dropbox. All rights reserved.
+//
+
+#import "DBMetadata.h"
+
+@interface DBDeltaEntry : NSObject <NSCoding> {
+ NSString *lowercasePath;
+ DBMetadata *metadata;
+}
+
+- (id)initWithArray:(NSArray *)array;
+
+@property (nonatomic, readonly) NSString *lowercasePath;
+@property (nonatomic, readonly) DBMetadata *metadata; // nil if file has been deleted
+
+@end
View
21 DropboxSDK.framework/Headers/DBError.h
@@ -0,0 +1,21 @@
+//
+// DBError.h
+// DropboxSDK
+//
+// Created by Brian Smith on 7/21/10.
+// Copyright 2010 Dropbox, Inc. All rights reserved.
+//
+
+/* This file contains error codes and the dropbox error domain */
+
+extern NSString* DBErrorDomain;
+
+// Error codes in the dropbox.com domain represent the HTTP status code if less than 1000
+typedef enum {
+ DBErrorNone = 0,
+ DBErrorGenericError = 1000,
+ DBErrorFileNotFound,
+ DBErrorInsufficientDiskSpace,
+ DBErrorIllegalFileType, // Error sent if you try to upload a directory
+ DBErrorInvalidResponse, // Sent when the client does not get valid JSON when it's expecting it
+} DBErrorCode;
View
75 DropboxSDK.framework/Headers/DBJSON.h
@@ -0,0 +1,75 @@
+/*
+ Copyright (C) 2007-2009 Stig Brautaset. 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 the author 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.
+ */
+
+#import <Foundation/Foundation.h>
+#import "DBJsonParser.h"
+#import "DBJsonWriter.h"
+
+/**
+ @brief Facade for DBJsonWriter/DBJsonParser.
+
+ Requests are forwarded to instances of DBJsonWriter and DBJsonParser.
+ */
+@interface DBJSON : DBJsonBase <DBJsonParser, DBJsonWriter> {
+
+@private
+ DBJsonParser *jsonParser;
+ DBJsonWriter *jsonWriter;
+}
+
+
+/// Return the fragment represented by the given string
+- (id)fragmentWithString:(NSString*)jsonrep
+ error:(NSError**)error;
+
+/// Return the object represented by the given string
+- (id)objectWithString:(NSString*)jsonrep
+ error:(NSError**)error;
+
+/// Parse the string and return the represented object (or scalar)
+- (id)objectWithString:(id)value
+ allowScalar:(BOOL)x
+ error:(NSError**)error;
+
+
+/// Return JSON representation of an array or dictionary
+- (NSString*)stringWithObject:(id)value
+ error:(NSError**)error;
+
+/// Return JSON representation of any legal JSON value
+- (NSString*)stringWithFragment:(id)value
+ error:(NSError**)error;
+
+/// Return JSON representation (or fragment) for the given object
+- (NSString*)stringWithObject:(id)value
+ allowScalar:(BOOL)x
+ error:(NSError**)error;
+
+
+@end
View
86 DropboxSDK.framework/Headers/DBJsonBase.h
@@ -0,0 +1,86 @@
+/*
+ Copyright (C) 2009 Stig Brautaset. 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 the author 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.
+ */
+
+#import <Foundation/Foundation.h>
+
+extern NSString * DBJSONErrorDomain;
+
+
+enum {
+ EUNSUPPORTED = 1,
+ EPARSENUM,
+ EPARSE,
+ EFRAGMENT,
+ ECTRL,
+ EUNICODE,
+ EDEPTH,
+ EESCAPE,
+ ETRAILCOMMA,
+ ETRAILGARBAGE,
+ EEOF,
+ EINPUT
+};
+
+/**
+ @brief Common base class for parsing & writing.
+
+ This class contains the common error-handling code and option between the parser/writer.
+ */
+@interface DBJsonBase : NSObject {
+ NSMutableArray *errorTrace;
+
+@protected
+ NSUInteger depth, maxDepth;
+}
+
+/**
+ @brief The maximum recursing depth.
+
+ Defaults to 512. If the input is nested deeper than this the input will be deemed to be
+ malicious and the parser returns nil, signalling an error. ("Nested too deep".) You can
+ turn off this security feature by setting the maxDepth value to 0.
+ */
+@property NSUInteger maxDepth;
+
+/**
+ @brief Return an error trace, or nil if there was no errors.
+
+ Note that this method returns the trace of the last method that failed.
+ You need to check the return value of the call you're making to figure out
+ if the call actually failed, before you know call this method.
+ */
+ @property(copy,readonly) NSArray* errorTrace;
+
+/// @internal for use in subclasses to add errors to the stack trace
+- (void)addErrorWithCode:(NSUInteger)code description:(NSString*)str;
+
+/// @internal for use in subclasess to clear the error before a new parsing attempt
+- (void)clearErrorTrace;
+
+@end
View
87 DropboxSDK.framework/Headers/DBJsonParser.h
@@ -0,0 +1,87 @@
+/*
+ Copyright (C) 2009 Stig Brautaset. 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 the author 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.
+ */
+
+#import <Foundation/Foundation.h>
+#import "DBJsonBase.h"
+
+/**
+ @brief Options for the parser class.
+
+ This exists so the DBJSON facade can implement the options in the parser without having to re-declare them.
+ */
+@protocol DBJsonParser
+
+/**
+ @brief Return the object represented by the given string.
+
+ Returns the object represented by the passed-in string or nil on error. The returned object can be
+ a string, number, boolean, null, array or dictionary.
+
+ @param repr the json string to parse
+ */
+- (id)objectWithString:(NSString *)repr;
+
+@end
+
+
+/**
+ @brief The JSON parser class.
+
+ JSON is mapped to Objective-C types in the following way:
+
+ @li Null -> NSNull
+ @li String -> NSMutableString
+ @li Array -> NSMutableArray
+ @li Object -> NSMutableDictionary
+ @li Boolean -> NSNumber (initialised with -initWithBool:)
+ @li Number -> NSDecimalNumber
+
+ Since Objective-C doesn't have a dedicated class for boolean values, these turns into NSNumber
+ instances. These are initialised with the -initWithBool: method, and
+ round-trip back to JSON properly. (They won't silently suddenly become 0 or 1; they'll be
+ represented as 'true' and 'false' again.)
+
+ JSON numbers turn into NSDecimalNumber instances,
+ as we can thus avoid any loss of precision. (JSON allows ridiculously large numbers.)
+
+ */
+@interface DBJsonParser : DBJsonBase <DBJsonParser> {
+
+@private
+ const char *c;
+}
+
+@end
+
+// don't use - exists for backwards compatibility with 2.1.x only. Will be removed in 2.3.
+@interface DBJsonParser (Private)
+- (id)fragmentWithString:(id)repr;
+@end
+
+
View
129 DropboxSDK.framework/Headers/DBJsonWriter.h
@@ -0,0 +1,129 @@
+/*
+ Copyright (C) 2009 Stig Brautaset. 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 the author 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.
+ */
+
+#import <Foundation/Foundation.h>
+#import "DBJsonBase.h"
+
+/**
+ @brief Options for the writer class.
+
+ This exists so the DBJSON facade can implement the options in the writer without having to re-declare them.
+ */
+@protocol DBJsonWriter
+
+/**
+ @brief Whether we are generating human-readable (multiline) JSON.
+
+ Set whether or not to generate human-readable JSON. The default is NO, which produces
+ JSON without any whitespace. (Except inside strings.) If set to YES, generates human-readable
+ JSON with linebreaks after each array value and dictionary key/value pair, indented two
+ spaces per nesting level.
+ */
+@property BOOL humanReadable;
+
+/**
+ @brief Whether or not to sort the dictionary keys in the output.
+
+ If this is set to YES, the dictionary keys in the JSON output will be in sorted order.
+ (This is useful if you need to compare two structures, for example.) The default is NO.
+ */
+@property BOOL sortKeys;
+
+/**
+ @brief Return JSON representation (or fragment) for the given object.
+
+ Returns a string containing JSON representation of the passed in value, or nil on error.
+ If nil is returned and @p error is not NULL, @p *error can be interrogated to find the cause of the error.
+
+ @param value any instance that can be represented as a JSON fragment
+
+ */
+- (NSString*)stringWithObject:(id)value;
+
+@end
+
+
+/**
+ @brief The JSON writer class.
+
+ Objective-C types are mapped to JSON types in the following way:
+
+ @li NSNull -> Null
+ @li NSString -> String
+ @li NSArray -> Array
+ @li NSDictionary -> Object
+ @li NSNumber (-initWithBool:) -> Boolean
+ @li NSNumber -> Number
+
+ In JSON the keys of an object must be strings. NSDictionary keys need
+ not be, but attempting to convert an NSDictionary with non-string keys
+ into JSON will throw an exception.
+
+ NSNumber instances created with the +initWithBool: method are
+ converted into the JSON boolean "true" and "false" values, and vice
+ versa. Any other NSNumber instances are converted to a JSON number the
+ way you would expect.
+
+ */
+@interface DBJsonWriter : DBJsonBase <DBJsonWriter> {
+
+@private
+ BOOL sortKeys, humanReadable;
+}
+
+@end
+
+// don't use - exists for backwards compatibility. Will be removed in 2.3.
+@interface DBJsonWriter (Private)
+- (NSString*)stringWithFragment:(id)value;
+@end
+
+/**
+ @brief Allows generation of JSON for otherwise unsupported classes.
+
+ If you have a custom class that you want to create a JSON representation for you can implement
+ this method in your class. It should return a representation of your object defined
+ in terms of objects that can be translated into JSON. For example, a Person
+ object might implement it like this:
+
+ @code
+ - (id)jsonProxyObject {
+ return [NSDictionary dictionaryWithObjectsAndKeys:
+ name, @"name",
+ phone, @"phone",
+ email, @"email",
+ nil];
+ }
+ @endcode
+
+ */
+@interface NSObject (SBProxyForJson)
+- (id)proxyForJson;
+@end
+
View
38 DropboxSDK.framework/Headers/DBLog.h
@@ -0,0 +1,38 @@
+//
+// DBLog.h
+// Dropbox
+//
+// Created by Will Stockwell on 11/4/10.
+// Copyright 2010 Dropbox, Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+#if !defined(NS_FORMAT_FUNCTION)
+#define NS_FORMAT_FUNCTION(F, A)
+#endif
+
+typedef enum {
+ DBLogLevelInfo = 0,
+ DBLogLevelAnalytics,
+ DBLogLevelWarning,
+ DBLogLevelError,
+ DBLogLevelFatal
+} DBLogLevel;
+
+typedef void DBLogCallback(DBLogLevel logLevel, NSString *format, va_list args);
+
+NSString * DBLogFilePath(void);
+void DBSetupLogToFile(void);
+
+NSString* DBStringFromLogLevel(DBLogLevel logLevel);
+
+
+void DBLogSetLevel(DBLogLevel logLevel);
+void DBLogSetCallback(DBLogCallback *callback);
+
+void DBLog(DBLogLevel logLevel, NSString *format, ...) NS_FORMAT_FUNCTION(2,3);
+void DBLogInfo(NSString *format, ...) NS_FORMAT_FUNCTION(1,2);
+void DBLogWarning(NSString *format, ...) NS_FORMAT_FUNCTION(1,2);
+void DBLogError(NSString *format, ...) NS_FORMAT_FUNCTION(1,2);
+void DBLogFatal(NSString *format, ...) NS_FORMAT_FUNCTION(1,2);
View
47 DropboxSDK.framework/Headers/DBMetadata.h
@@ -0,0 +1,47 @@
+//
+// DBMetadata.h
+// DropboxSDK
+//
+// Created by Brian Smith on 5/3/10.
+// Copyright 2010 Dropbox, Inc. All rights reserved.
+//
+
+
+@interface DBMetadata : NSObject <NSCoding> {
+ BOOL thumbnailExists;
+ long long totalBytes;
+ NSDate* lastModifiedDate;
+ NSDate *clientMtime; // file's mtime for display purposes only
+ NSString* path;
+ BOOL isDirectory;
+ NSArray* contents;
+ NSString* hash;
+ NSString* humanReadableSize;
+ NSString* root;
+ NSString* icon;
+ NSString* rev;
+ long long revision; // Deprecated; will be removed in version 2. Use rev whenever possible
+ BOOL isDeleted;
+
+ NSString *filename;
+}
+
+- (id)initWithDictionary:(NSDictionary*)dict;
+
+@property (nonatomic, readonly) BOOL thumbnailExists;
+@property (nonatomic, readonly) long long totalBytes;
+@property (nonatomic, readonly) NSDate* lastModifiedDate;
+@property (nonatomic, readonly) NSDate* clientMtime;
+@property (nonatomic, readonly) NSString* path;
+@property (nonatomic, readonly) BOOL isDirectory;
+@property (nonatomic, readonly) NSArray* contents;
+@property (nonatomic, readonly) NSString* hash;
+@property (nonatomic, readonly) NSString* humanReadableSize;
+@property (nonatomic, readonly) NSString* root;
+@property (nonatomic, readonly) NSString* icon;
+@property (nonatomic, readonly) long long revision; // Deprecated, use rev instead
+@property (nonatomic, readonly) NSString* rev;
+@property (nonatomic, readonly) BOOL isDeleted;
+@property (nonatomic, readonly) NSString* filename;
+
+@end
View
23 DropboxSDK.framework/Headers/DBQuota.h
@@ -0,0 +1,23 @@
+//
+// DBQuota.h
+// DropboxSDK
+//
+// Created by Brian Smith on 5/3/10.
+// Copyright 2010 Dropbox, Inc. All rights reserved.
+//
+
+
+@interface DBQuota : NSObject <NSCoding> {
+ long long normalConsumedBytes;
+ long long sharedConsumedBytes;
+ long long totalBytes;
+}
+
+- (id)initWithDictionary:(NSDictionary*)dict;
+
+@property (nonatomic, readonly) long long normalConsumedBytes;
+@property (nonatomic, readonly) long long sharedConsumedBytes;
+@property (nonatomic, readonly) long long totalConsumedBytes;
+@property (nonatomic, readonly) long long totalBytes;
+
+@end
View
77 DropboxSDK.framework/Headers/DBRequest.h
@@ -0,0 +1,77 @@
+//
+// DBRestRequest.h
+// DropboxSDK
+//
+// Created by Brian Smith on 4/9/10.
+// Copyright 2010 Dropbox, Inc. All rights reserved.
+//
+
+
+@protocol DBNetworkRequestDelegate;
+
+/* DBRestRequest will download a URL either into a file that you provied the name to or it will
+ create an NSData object with the result. When it has completed downloading the URL, it will
+ notify the target with a selector that takes the DBRestRequest as the only parameter. */
+@interface DBRequest : NSObject {
+ NSURLRequest* request;
+ id target;
+ SEL selector;
+ NSURLConnection* urlConnection;
+ NSFileHandle* fileHandle;
+
+ SEL failureSelector;
+ SEL downloadProgressSelector;
+ SEL uploadProgressSelector;
+ NSString* resultFilename;
+ NSString* tempFilename;
+ NSDictionary* userInfo;
+
+ NSHTTPURLResponse* response;
+ NSDictionary* xDropboxMetadataJSON;
+ NSInteger bytesDownloaded;
+ CGFloat downloadProgress;
+ CGFloat uploadProgress;
+ NSMutableData* resultData;
+ NSError* error;
+}
+
+/* Set this to get called when _any_ request starts or stops. This should hook into whatever
+ network activity indicator system you have. */
++ (void)setNetworkRequestDelegate:(id<DBNetworkRequestDelegate>)delegate;
+
+/* This constructor downloads the URL into the resultData object */
+- (id)initWithURLRequest:(NSURLRequest*)request andInformTarget:(id)target selector:(SEL)selector;
+
+/* Cancels the request and prevents it from sending additional messages to the delegate. */
+- (void)cancel;
+
+/* If there is no error, it will parse the response as JSON and make sure the JSON object is the
+ correct type. If not, it will set the error object with an error code of DBErrorInvalidResponse */
+- (id)parseResponseAsType:(Class)cls;
+
+@property (nonatomic, assign) SEL failureSelector; // To send failure events to a different selector set this
+@property (nonatomic, assign) SEL downloadProgressSelector; // To receive download progress events set this
+@property (nonatomic, assign) SEL uploadProgressSelector; // To receive upload progress events set this
+@property (nonatomic, retain) NSString* resultFilename; // The file to put the HTTP body in, otherwise body is stored in resultData
+@property (nonatomic, retain) NSDictionary* userInfo;
+
+@property (nonatomic, readonly) NSURLRequest* request;
+@property (nonatomic, readonly) NSHTTPURLResponse* response;
+@property (nonatomic, readonly) NSDictionary* xDropboxMetadataJSON;
+@property (nonatomic, readonly) NSInteger statusCode;
+@property (nonatomic, readonly) CGFloat downloadProgress;
+@property (nonatomic, readonly) CGFloat uploadProgress;
+@property (nonatomic, readonly) NSData* resultData;
+@property (nonatomic, readonly) NSString* resultString;
+@property (nonatomic, readonly) NSObject* resultJSON;
+@property (nonatomic, readonly) NSError* error;
+
+@end
+
+
+@protocol DBNetworkRequestDelegate
+
+- (void)networkRequestStarted;
+- (void)networkRequestStopped;
+
+@end
View
220 DropboxSDK.framework/Headers/DBRestClient.h
@@ -0,0 +1,220 @@
+//
+// DBRestClient.h
+// DropboxSDK
+//
+// Created by Brian Smith on 4/9/10.
+// Copyright 2010 Dropbox, Inc. All rights reserved.
+//
+
+
+#import "DBSession.h"
+
+@protocol DBRestClientDelegate;
+@class DBAccountInfo;
+@class DBMetadata;
+
+@interface DBRestClient : NSObject {
+ DBSession* session;
+ NSString* userId;
+ NSString* root;
+ NSMutableSet* requests;
+ /* Map from path to the load request. Needs to be expanded to a general framework for cancelling
+ requests. */
+ NSMutableDictionary* loadRequests;
+ NSMutableDictionary* imageLoadRequests;
+ NSMutableDictionary* uploadRequests;
+ id<DBRestClientDelegate> delegate;
+}
+
+- (id)initWithSession:(DBSession*)session;
+- (id)initWithSession:(DBSession *)session userId:(NSString *)userId;
+
+/* Cancels all outstanding requests. No callback for those requests will be sent */
+- (void)cancelAllRequests;
+
+
+/* Loads metadata for the object at the given root/path and returns the result to the delegate as a
+ dictionary */
+- (void)loadMetadata:(NSString*)path withHash:(NSString*)hash;
+
+- (void)loadMetadata:(NSString*)path;
+
+/* This will load the metadata of a file at a given rev */
+- (void)loadMetadata:(NSString *)path atRev:(NSString *)rev;
+
+/* Loads a list of files (represented as DBDeltaEntry objects) that have changed since the cursor was generated */
+- (void)loadDelta:(NSString *)cursor;
+
+
+/* Loads the file contents at the given root/path and stores the result into destinationPath */
+- (void)loadFile:(NSString *)path intoPath:(NSString *)destinationPath;
+
+/* This will load a file as it existed at a given rev */
+- (void)loadFile:(NSString *)path atRev:(NSString *)rev intoPath:(NSString *)destPath;
+
+- (void)cancelFileLoad:(NSString*)path;
+
+
+- (void)loadThumbnail:(NSString *)path ofSize:(NSString *)size intoPath:(NSString *)destinationPath;
+- (void)cancelThumbnailLoad:(NSString*)path size:(NSString*)size;
+
+/* Uploads a file that will be named filename to the given path on the server. sourcePath is the
+ full path of the file you want to upload. If you are modifying a file, parentRev represents the
+ rev of the file before you modified it as returned from the server. If you are uploading a new
+ file set parentRev to nil. */
+- (void)uploadFile:(NSString *)filename toPath:(NSString *)path withParentRev:(NSString *)parentRev
+ fromPath:(NSString *)sourcePath;
+
+- (void)cancelFileUpload:(NSString *)path;
+
+/* Avoid using this because it is very easy to overwrite conflicting changes. Provided for backwards
+ compatibility reasons only */
+- (void)uploadFile:(NSString*)filename toPath:(NSString*)path fromPath:(NSString *)sourcePath __attribute__((deprecated));
+
+/* These calls allow you to upload files in chunks, which is better for file larger than a few megabytes.
+ You can append bytes to the file using -[DBRestClient uploadFileChunk:offset:uploadId:] and then call
+ -[DBRestClient uploadFile:toPath:withParentRev:fromUploadId:] to turn the bytes appended at that uploadId
+ into an actual file in the user's Dropbox.
+ Use a nil uploadId to start uploading a new file. */
+- (void)uploadFileChunk:(NSString *)uploadId offset:(unsigned long long)offset fromPath:(NSString *)localPath;
+- (void)uploadFile:(NSString *)filename toPath:(NSString *)parentFolder withParentRev:(NSString *)parentRev
+ fromUploadId:(NSString *)uploadId;
+
+
+/* Loads a list of up to 10 DBMetadata objects representing past revisions of the file at path */
+- (void)loadRevisionsForFile:(NSString *)path;
+
+/* Same as above but with a configurable limit to number of DBMetadata objects returned, up to 1000 */
+- (void)loadRevisionsForFile:(NSString *)path limit:(NSInteger)limit;
+
+/* Restores a file at path as it existed at the given rev and returns the metadata of the restored
+ file after restoration */
+- (void)restoreFile:(NSString *)path toRev:(NSString *)rev;
+
+/* Creates a folder at the given root/path */
+- (void)createFolder:(NSString*)path;
+
+- (void)deletePath:(NSString*)path;
+
+- (void)copyFrom:(NSString*)fromPath toPath:(NSString *)toPath;
+
+- (void)createCopyRef:(NSString *)path; // Used to copy between Dropboxes
+- (void)copyFromRef:(NSString*)copyRef toPath:(NSString *)toPath; // Takes copy ref created by above call
+
+- (void)moveFrom:(NSString*)fromPath toPath:(NSString *)toPath;
+
+- (void)loadAccountInfo;
+
+- (void)searchPath:(NSString*)path forKeyword:(NSString*)keyword;
+
+- (void)loadSharableLinkForFile:(NSString *)path;
+- (void)loadSharableLinkForFile:(NSString *)path shortUrl:(BOOL)createShortUrl;
+
+- (void)loadStreamableURLForFile:(NSString *)path;
+
+- (NSUInteger)requestCount;
+
+@property (nonatomic, assign) id<DBRestClientDelegate> delegate;
+
+@end
+
+
+
+
+/* The delegate provides allows the user to get the result of the calls made on the DBRestClient.
+ Right now, the error parameter of failed calls may be nil and [error localizedDescription] does
+ not contain an error message appropriate to show to the user. */
+@protocol DBRestClientDelegate <NSObject>
+
+@optional
+
+- (void)restClient:(DBRestClient*)client loadedMetadata:(DBMetadata*)metadata;
+- (void)restClient:(DBRestClient*)client metadataUnchangedAtPath:(NSString*)path;
+- (void)restClient:(DBRestClient*)client loadMetadataFailedWithError:(NSError*)error;
+// [error userInfo] contains the root and path of the call that failed
+
+- (void)restClient:(DBRestClient*)client loadedDeltaEntries:(NSArray *)entries reset:(BOOL)shouldReset cursor:(NSString *)cursor hasMore:(BOOL)hasMore;
+- (void)restClient:(DBRestClient*)client loadDeltaFailedWithError:(NSError *)error;
+
+- (void)restClient:(DBRestClient*)client loadedAccountInfo:(DBAccountInfo*)info;
+- (void)restClient:(DBRestClient*)client loadAccountInfoFailedWithError:(NSError*)error;
+
+- (void)restClient:(DBRestClient*)client loadedFile:(NSString*)destPath;
+// Implement the following callback instead of the previous if you care about the value of the
+// Content-Type HTTP header and the file metadata. Only one will be called per successful response.
+- (void)restClient:(DBRestClient*)client loadedFile:(NSString*)destPath contentType:(NSString*)contentType metadata:(DBMetadata*)metadata;
+- (void)restClient:(DBRestClient*)client loadProgress:(CGFloat)progress forFile:(NSString*)destPath;
+- (void)restClient:(DBRestClient*)client loadFileFailedWithError:(NSError*)error;
+// [error userInfo] contains the destinationPath
+
+
+- (void)restClient:(DBRestClient*)client loadedThumbnail:(NSString*)destPath metadata:(DBMetadata*)metadata;
+- (void)restClient:(DBRestClient*)client loadThumbnailFailedWithError:(NSError*)error;
+
+- (void)restClient:(DBRestClient*)client uploadedFile:(NSString*)destPath from:(NSString*)srcPath
+ metadata:(DBMetadata*)metadata;
+- (void)restClient:(DBRestClient*)client uploadProgress:(CGFloat)progress
+ forFile:(NSString*)destPath from:(NSString*)srcPath;
+- (void)restClient:(DBRestClient*)client uploadFileFailedWithError:(NSError*)error;
+// [error userInfo] contains the sourcePath
+
+- (void)restClient:(DBRestClient *)client uploadedFileChunk:(NSString *)uploadId newOffset:(unsigned long long)offset
+ fromFile:(NSString *)localPath expires:(NSDate *)expiresDate;
+- (void)restClient:(DBRestClient *)client uploadFileChunkFailedWithError:(NSError *)error;
+
+- (void)restClient:(DBRestClient *)client uploadedFile:(NSString *)destPath fromUploadId:(NSString *)uploadId
+ metadata:(DBMetadata *)metadata;
+- (void)restClient:(DBRestClient *)client uploadFromUploadIdFailedWithError:(NSError *)error;
+
+// Deprecated upload callback
+- (void)restClient:(DBRestClient*)client uploadedFile:(NSString*)destPath from:(NSString*)srcPath;
+
+// Deprecated download callbacks
+- (void)restClient:(DBRestClient*)client loadedFile:(NSString*)destPath contentType:(NSString*)contentType;
+- (void)restClient:(DBRestClient*)client loadedThumbnail:(NSString*)destPath;
+
+- (void)restClient:(DBRestClient*)client loadedRevisions:(NSArray *)revisions forFile:(NSString *)path;
+- (void)restClient:(DBRestClient*)client loadRevisionsFailedWithError:(NSError *)error;
+
+- (void)restClient:(DBRestClient*)client restoredFile:(DBMetadata *)fileMetadata;
+- (void)restClient:(DBRestClient*)client restoreFileFailedWithError:(NSError *)error;
+
+- (void)restClient:(DBRestClient*)client createdFolder:(DBMetadata*)folder;
+// Folder is the metadata for the newly created folder
+- (void)restClient:(DBRestClient*)client createFolderFailedWithError:(NSError*)error;
+// [error userInfo] contains the root and path
+
+- (void)restClient:(DBRestClient*)client deletedPath:(NSString *)path;
+- (void)restClient:(DBRestClient*)client deletePathFailedWithError:(NSError*)error;
+// [error userInfo] contains the root and path
+
+- (void)restClient:(DBRestClient*)client copiedPath:(NSString *)fromPath to:(DBMetadata *)to;
+- (void)restClient:(DBRestClient*)client copyPathFailedWithError:(NSError*)error;
+// [error userInfo] contains the root and path
+
+- (void)restClient:(DBRestClient*)client createdCopyRef:(NSString *)copyRef;
+- (void)restClient:(DBRestClient*)client createCopyRefFailedWithError:(NSError *)error;
+
+- (void)restClient:(DBRestClient*)client copiedRef:(NSString *)copyRef to:(DBMetadata *)to;
+- (void)restClient:(DBRestClient*)client copyFromRefFailedWithError:(NSError*)error;
+
+- (void)restClient:(DBRestClient*)client movedPath:(NSString *)from_path to:(DBMetadata *)result;
+- (void)restClient:(DBRestClient*)client movePathFailedWithError:(NSError*)error;
+// [error userInfo] contains the root and path
+
+- (void)restClient:(DBRestClient*)restClient loadedSearchResults:(NSArray*)results
+forPath:(NSString*)path keyword:(NSString*)keyword;
+// results is a list of DBMetadata * objects
+- (void)restClient:(DBRestClient*)restClient searchFailedWithError:(NSError*)error;
+
+- (void)restClient:(DBRestClient*)restClient loadedSharableLink:(NSString*)link
+forFile:(NSString*)path;
+- (void)restClient:(DBRestClient*)restClient loadSharableLinkFailedWithError:(NSError*)error;
+
+- (void)restClient:(DBRestClient*)restClient loadedStreamableURL:(NSURL*)url forFile:(NSString*)path;
+- (void)restClient:(DBRestClient*)restClient loadStreamableURLFailedWithError:(NSError*)error;
+
+
+@end
+
+
View
22 DropboxSDK.framework/Headers/DBSession+iOS.h
@@ -0,0 +1,22 @@
+//
+// DBSession+iOS.h
+// DropboxSDK
+//
+// Created by Brian Smith on 3/7/12.
+// Copyright (c) 2012 Dropbox. All rights reserved.
+//
+
+#import "DBSession.h"
+
+@interface DBSession (iOS)
+
++ (NSDictionary*)parseURLParams:(NSString *)query;
+
+- (NSString *)appScheme;
+
+- (void)linkFromController:(UIViewController *)rootController;
+- (void)linkUserId:(NSString *)userId fromController:(UIViewController *)rootController;
+
+- (BOOL)handleOpenURL:(NSURL *)url;
+
+@end
View
59 DropboxSDK.framework/Headers/DBSession.h
@@ -0,0 +1,59 @@
+//
+// DBSession.h
+// DropboxSDK
+//
+// Created by Brian Smith on 4/8/10.
+// Copyright 2010 Dropbox, Inc. All rights reserved.
+//
+
+#import "MPOAuthCredentialConcreteStore.h"
+
+extern NSString *kDBSDKVersion;
+
+extern NSString *kDBDropboxAPIHost;
+extern NSString *kDBDropboxAPIContentHost;
+extern NSString *kDBDropboxWebHost;
+extern NSString *kDBDropboxAPIVersion;
+
+extern NSString *kDBRootDropbox;
+extern NSString *kDBRootAppFolder;
+
+extern NSString *kDBProtocolHTTPS;
+
+@protocol DBSessionDelegate;
+
+
+/* Creating and setting the shared DBSession should be done before any other Dropbox objects are
+ used, perferrably in the UIApplication delegate. */
+@interface DBSession : NSObject {
+ NSDictionary *baseCredentials;
+ NSMutableDictionary *credentialStores;
+ MPOAuthCredentialConcreteStore *anonymousStore;
+ NSString *root;
+ id<DBSessionDelegate> delegate;
+}
+
++ (DBSession*)sharedSession;
++ (void)setSharedSession:(DBSession *)session;
+
+- (id)initWithAppKey:(NSString *)key appSecret:(NSString *)secret root:(NSString *)root;
+- (BOOL)isLinked; // Session must be linked before creating any DBRestClient objects
+
+- (void)unlinkAll;
+- (void)unlinkUserId:(NSString *)userId;
+
+- (MPOAuthCredentialConcreteStore *)credentialStoreForUserId:(NSString *)userId;
+- (void)updateAccessToken:(NSString *)token accessTokenSecret:(NSString *)secret forUserId:(NSString *)userId;
+
+@property (nonatomic, readonly) NSString *root;
+@property (nonatomic, readonly) NSArray *userIds;
+@property (nonatomic, assign) id<DBSessionDelegate> delegate;
+
+@end
+
+
+@protocol DBSessionDelegate
+
+- (void)sessionDidReceiveAuthorizationFailure:(DBSession *)session userId:(NSString *)userId;
+
+@end
View
7 DropboxSDK.framework/Headers/DropboxSDK-Prefix.pch
@@ -0,0 +1,7 @@
+//
+// Prefix header for all source files of the 'DropboxSDK' target in the 'DropboxSDK' project
+//
+
+#ifdef __OBJC__
+ #import <UIKit/UIKit.h>
+#endif
View
20 DropboxSDK.framework/Headers/DropboxSDK.h
@@ -0,0 +1,20 @@
+/*
+ * DropboxSDK.h
+ * DropboxSDK
+ *
+ * Created by Brian Smith on 7/13/10.
+ * Copyright 2010 Dropbox, Inc. All rights reserved.
+ *
+ */
+
+/* Import this file to get the most important header files imported */
+#import "DBAccountInfo.h"
+#import "DBSession.h"
+#import "DBRestClient.h"
+#import "DBRequest.h"
+#import "DBMetadata.h"
+#import "DBQuota.h"
+#import "DBError.h"
+#import "NSString+Dropbox.h"
+
+#import "DBSession+iOS.h"
View
55 DropboxSDK.framework/Headers/JSON.h
@@ -0,0 +1,55 @@
+/*
+ Copyright (C) 2009 Stig Brautaset. 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 the author 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.
+ */
+
+/**
+ @mainpage A strict JSON parser and generator for Objective-C
+
+ JSON (JavaScript Object Notation) is a lightweight data-interchange
+ format. This framework provides two apis for parsing and generating
+ JSON. One standard object-based and a higher level api consisting of
+ categories added to existing Objective-C classes.
+
+ Learn more on the http://code.google.com/p/json-framework project site.
+
+ This framework does its best to be as strict as possible, both in what it
+ accepts and what it generates. For example, it does not support trailing commas
+ in arrays or objects. Nor does it support embedded comments, or
+ anything else not in the JSON specification. This is considered a feature.
+
+
+ SBJson has been renamed to DBJson in the DropboxSDK because static libraries
+ are unable to hide symbols and other libraries that developers use include
+ SBJson
+
+*/
+
+#import "DBJSON.h"
+#import "NSObject+DBJSON.h"
+#import "NSString+DBJSON.h"
+
View
14 DropboxSDK.framework/Headers/MPDebug.h
@@ -0,0 +1,14 @@
+//
+// MPDebug.h
+// MPOAuthConnection
+//
+// Created by Karl Adam on 09.02.06.
+// Copyright 2009 matrixPointer. All rights reserved.
+//
+
+// Removing oauth logging for now, set to '#ifdef DEBUG' to re-enable
+#if 0
+ #define MPLog(...) NSLog(__VA_ARGS__)
+#else
+ #define MPLog(...) do { } while (0)
+#endif
View
20 DropboxSDK.framework/Headers/MPOAuth.h
@@ -0,0 +1,20 @@
+//
+// MPOAuth.h
+// MPOAuthConnection
+//
+// Created by Karl Adam on 08.12.13.
+// Copyright 2008 matrixPointer. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+#import <MPOAuth/MPOAuthAPI.h>
+#import <MPOAuth/MPOAuthAPIRequestLoader.h>
+#import <MPOAuth/MPOAuthAuthenticationMethod.h>
+#import <MPOAuth/MPOAuthAuthenticationMethodOAuth.h>
+#import <MPOAuth/MPOAuthCredentialStore.h>
+#import <MPOAuth/MPOAuthParameterFactory.h>
+#import <MPOAuth/MPOAuthConnection.h>
+#import <MPOAuth/MPOAuthURLRequest.h>
+#import <MPOAuth/MPOAuthURLResponse.h>
View
86 DropboxSDK.framework/Headers/MPOAuthAPI.h
@@ -0,0 +1,86 @@
+//
+// MPOAuthAPI.h
+// MPOAuthConnection
+//
+// Created by Karl Adam on 08.12.05.
+// Copyright 2008 matrixPointer. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "MPOAuthCredentialStore.h"
+#import "MPOAuthParameterFactory.h"
+
+extern NSString * const MPOAuthNotificationAccessTokenReceived;
+extern NSString * const MPOAuthNotificationAccessTokenRejected;
+extern NSString * const MPOAuthNotificationAccessTokenRefreshed;
+extern NSString * const MPOAuthNotificationOAuthCredentialsReady;
+extern NSString * const MPOAuthNotificationErrorHasOccurred;
+
+extern NSString * const MPOAuthCredentialRequestTokenKey;
+extern NSString * const MPOAuthCredentialRequestTokenSecretKey;
+extern NSString * const MPOAuthCredentialAccessTokenKey;
+extern NSString * const MPOAuthCredentialAccessTokenSecretKey;
+extern NSString * const MPOAuthCredentialSessionHandleKey;
+
+extern NSString * const MPOAuthTokenRefreshDateDefaultsKey;
+
+typedef enum {
+ MPOAuthSignatureSchemePlainText,
+ MPOAuthSignatureSchemeHMACSHA1,
+ MPOAuthSignatureSchemeRSASHA1
+} MPOAuthSignatureScheme;
+
+typedef enum {
+ MPOAuthAuthenticationStateUnauthenticated = 0,
+ MPOAuthAuthenticationStateAuthenticating = 1,
+ MPOAuthAuthenticationStateAuthenticated = 2
+} MPOAuthAuthenticationState;
+
+@protocol MPOAuthAPIInternalClient
+@end
+
+@class MPOAuthAuthenticationMethod;
+
+@interface MPOAuthAPI : NSObject <MPOAuthAPIInternalClient> {
+@private
+ id <MPOAuthCredentialStore, MPOAuthParameterFactory> credentials_;
+ NSURL *baseURL_;
+ NSURL *authenticationURL_;
+ MPOAuthAuthenticationMethod *authenticationMethod_;
+ MPOAuthSignatureScheme signatureScheme_;
+ NSMutableArray *activeLoaders_;
+ MPOAuthAuthenticationState oauthAuthenticationState_;
+}
+
+@property (nonatomic, readonly, retain) id <MPOAuthCredentialStore, MPOAuthParameterFactory> credentials;
+@property (nonatomic, readonly, retain) NSURL *baseURL;
+@property (nonatomic, readonly, retain) NSURL *authenticationURL;
+@property (nonatomic, readwrite, retain) MPOAuthAuthenticationMethod *authenticationMethod;
+@property (nonatomic, readwrite, assign) MPOAuthSignatureScheme signatureScheme;
+
+@property (nonatomic, readonly, assign) MPOAuthAuthenticationState authenticationState;
+
+
+- (id)initWithCredentials:(NSDictionary *)inCredentials andBaseURL:(NSURL *)inURL;
+- (id)initWithCredentials:(NSDictionary *)inCredentials authenticationURL:(NSURL *)inAuthURL andBaseURL:(NSURL *)inBaseURL;
+- (id)initWithCredentials:(NSDictionary *)inCredentials authenticationURL:(NSURL *)inAuthURL andBaseURL:(NSURL *)inBaseURL autoStart:(BOOL)aFlag;
+
+- (void)authenticate;
+- (BOOL)isAuthenticated;
+
+- (void)performMethod:(NSString *)inMethod withTarget:(id)inTarget andAction:(SEL)inAction;
+- (void)performMethod:(NSString *)inMethod atURL:(NSURL *)inURL withParameters:(NSArray *)inParameters withTarget:(id)inTarget andAction:(SEL)inAction;
+- (void)performPOSTMethod:(NSString *)inMethod atURL:(NSURL *)inURL withParameters:(NSArray *)inParameters withTarget:(id)inTarget andAction:(SEL)inAction;
+- (void)performURLRequest:(NSURLRequest *)inRequest withTarget:(id)inTarget andAction:(SEL)inAction;
+
+- (NSData *)dataForMethod:(NSString *)inMethod;
+- (NSData *)dataForMethod:(NSString *)inMethod withParameters:(NSArray *)inParameters;
+- (NSData *)dataForURL:(NSURL *)inURL andMethod:(NSString *)inMethod withParameters:(NSArray *)inParameters;
+
+- (id)credentialNamed:(NSString *)inCredentialName;
+- (void)setCredential:(id)inCredential withName:(NSString *)inName;
+- (void)removeCredentialNamed:(NSString *)inName;
+
+- (void)discardCredentials;
+
+@end
View
50 DropboxSDK.framework/Headers/MPOAuthAPIRequestLoader.h
@@ -0,0 +1,50 @@
+//
+// MPOAuthAPIRequestLoader.h
+// MPOAuthConnection
+//
+// Created by Karl Adam on 08.12.05.
+// Copyright 2008 matrixPointer. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+extern NSString * const MPOAuthNotificationRequestTokenReceived;
+extern NSString * const MPOAuthNotificationRequestTokenRejected;
+extern NSString * const MPOAuthNotificationAccessTokenReceived;
+extern NSString * const MPOAuthNotificationAccessTokenRejected;
+extern NSString * const MPOAuthNotificationAccessTokenRefreshed;
+extern NSString * const MPOAuthNotificationErrorHasOccurred;
+
+@protocol MPOAuthCredentialStore;
+@protocol MPOAuthParameterFactory;
+
+@class MPOAuthURLRequest;
+@class MPOAuthURLResponse;
+@class MPOAuthCredentialConcreteStore;
+
+@interface MPOAuthAPIRequestLoader : NSObject {
+ MPOAuthCredentialConcreteStore *_credentials;
+ MPOAuthURLRequest *_oauthRequest;
+ MPOAuthURLResponse *_oauthResponse;
+ NSMutableData *_dataBuffer;
+ NSString *_dataAsString;
+ NSError *_error;
+ id _target;
+ SEL _action;
+}
+
+@property (nonatomic, readwrite, retain) id <MPOAuthCredentialStore, MPOAuthParameterFactory> credentials;
+@property (nonatomic, readwrite, retain) MPOAuthURLRequest *oauthRequest;
+@property (nonatomic, readwrite, retain) MPOAuthURLResponse *oauthResponse;
+@property (nonatomic, readonly, retain) NSData *data;
+@property (nonatomic, readonly, retain) NSString *responseString;
+@property (nonatomic, readwrite, assign) id target;
+@property (nonatomic, readwrite, assign) SEL action;
+
+- (id)initWithURL:(NSURL *)inURL;
+- (id)initWithRequest:(MPOAuthURLRequest *)inRequest;
+
+- (void)loadSynchronously:(BOOL)inSynchronous;
+
+@end
+
View
30 DropboxSDK.framework/Headers/MPOAuthAuthenticationMethod.h
@@ -0,0 +1,30 @@
+//
+// MPOAuthAuthenticationMethod.h
+// MPOAuthConnection
+//
+// Created by Karl Adam on 09.12.19.
+// Copyright 2009 matrixPointer. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+extern NSString * const MPOAuthAccessTokenURLKey;
+
+@class MPOAuthAPI;
+
+@interface MPOAuthAuthenticationMethod : NSObject {
+ MPOAuthAPI *oauthAPI_;
+ NSURL *oauthGetAccessTokenURL_;
+ NSTimer *refreshTimer_;
+}
+
+@property (nonatomic, readwrite, assign) MPOAuthAPI *oauthAPI;
+@property (nonatomic, readwrite, retain) NSURL *oauthGetAccessTokenURL;
+
+- (id)initWithAPI:(MPOAuthAPI *)inAPI forURL:(NSURL *)inURL;
+- (id)initWithAPI:(MPOAuthAPI *)inAPI forURL:(NSURL *)inURL withConfiguration:(NSDictionary *)inConfig;
+- (void)authenticate;
+
+- (void)setTokenRefreshInterval:(NSTimeInterval)inTimeInterval;
+- (void)refreshAccessToken;
+@end
View
44 DropboxSDK.framework/Headers/MPOAuthAuthenticationMethodOAuth.h
@@ -0,0 +1,44 @@
+//
+// MPOAuthAuthenticationMethodOAuth.h
+// MPOAuthConnection
+//
+// Created by Karl Adam on 09.12.19.
+// Copyright 2009 matrixPointer. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "MPOAuthAuthenticationMethod.h"
+#import "MPOAuthAPI.h"
+#import "MPOAuthAPIRequestLoader.h"
+
+extern NSString * const MPOAuthNotificationRequestTokenReceived;
+extern NSString * const MPOAuthNotificationRequestTokenRejected;
+
+@protocol MPOAuthAuthenticationMethodOAuthDelegate;
+
+@interface MPOAuthAuthenticationMethodOAuth : MPOAuthAuthenticationMethod <MPOAuthAPIInternalClient> {
+ NSURL *oauthRequestTokenURL_;
+ NSURL *oauthAuthorizeTokenURL_;
+ BOOL oauth10aModeActive_;
+
+ id <MPOAuthAuthenticationMethodOAuthDelegate> delegate_;
+}
+
+@property (nonatomic, readwrite, assign) id <MPOAuthAuthenticationMethodOAuthDelegate> delegate;
+
+@property (nonatomic, readwrite, retain) NSURL *oauthRequestTokenURL;
+@property (nonatomic, readwrite, retain) NSURL *oauthAuthorizeTokenURL;
+
+- (void)authenticate;
+
+@end
+
+@protocol MPOAuthAuthenticationMethodOAuthDelegate <NSObject>
+- (NSURL *)callbackURLForCompletedUserAuthorization;
+- (BOOL)automaticallyRequestAuthenticationFromURL:(NSURL *)inAuthURL withCallbackURL:(NSURL *)inCallbackURL;
+
+@optional
+- (NSString *)oauthVerifierForCompletedUserAuthorization;
+- (void)authenticationDidFailWithError:(NSError *)error;
+@end
+
View
29 DropboxSDK.framework/Headers/MPOAuthConnection.h
@@ -0,0 +1,29 @@
+//
+// MPOAuthConnection.h
+// MPOAuthConnection
+//
+// Created by Karl Adam on 08.12.05.
+// Copyright 2008 matrixPointer. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@protocol MPOAuthCredentialStore;
+@protocol MPOAuthParameterFactory;
+
+@class MPOAuthURLRequest;
+@class MPOAuthURLResponse;
+@class MPOAuthCredentialConcreteStore;
+
+@interface MPOAuthConnection : NSURLConnection {
+@private
+ MPOAuthCredentialConcreteStore *_credentials;
+}
+
+@property (nonatomic, readonly) id <MPOAuthCredentialStore, MPOAuthParameterFactory> credentials;
+
++ (MPOAuthConnection *)connectionWithRequest:(MPOAuthURLRequest *)inRequest delegate:(id)inDelegate credentials:(NSObject <MPOAuthCredentialStore, MPOAuthParameterFactory> *)inCredentials;
++ (NSData *)sendSynchronousRequest:(MPOAuthURLRequest *)inRequest usingCredentials:(NSObject <MPOAuthCredentialStore, MPOAuthParameterFactory> *)inCredentials returningResponse:(MPOAuthURLResponse **)outResponse error:(NSError **)inError;
+- (id)initWithRequest:(MPOAuthURLRequest *)inRequest delegate:(id)inDelegate credentials:(NSObject <MPOAuthCredentialStore, MPOAuthParameterFactory> *)inCredentials;
+
+@end
View
18 DropboxSDK.framework/Headers/MPOAuthCredentialConcreteStore+KeychainAdditions.h
@@ -0,0 +1,18 @@
+//
+// MPOAuthCredentialConcreteStore+TokenAdditionsMac.h
+// MPOAuthConnection
+//
+// Created by Karl Adam on 08.12.13.
+// Copyright 2008 matrixPointer. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "MPOAuthCredentialConcreteStore.h"
+
+@interface MPOAuthCredentialConcreteStore (KeychainAdditions)
+
+- (void)addToKeychainUsingName:(NSString *)inName andValue:(NSString *)inValue;
+- (NSString *)findValueFromKeychainUsingName:(NSString *)inName;
+- (void)removeValueFromKeychainUsingName:(NSString *)inName;
+
+@end
View
40 DropboxSDK.framework/Headers/MPOAuthCredentialConcreteStore.h
@@ -0,0 +1,40 @@
+//
+// MPOAuthCredentialConcreteStore.h
+// MPOAuthConnection
+//
+// Created by Karl Adam on 08.12.11.
+// Copyright 2008 matrixPointer. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "MPOAuthCredentialStore.h"
+#import "MPOAuthParameterFactory.h"
+
+@interface MPOAuthCredentialConcreteStore : NSObject <MPOAuthCredentialStore, MPOAuthParameterFactory> {
+ NSMutableDictionary *store_;
+ NSURL *baseURL_;
+ NSURL *authenticationURL_;
+}
+
+@property (nonatomic, readonly, retain) NSURL *baseURL;
+@property (nonatomic, readonly, retain) NSURL *authenticationURL;
+
+@property (nonatomic, readonly) NSString *tokenSecret;
+@property (nonatomic, readonly) NSString *signingKey;
+
+@property (nonatomic, readwrite, retain) NSString *requestToken;
+@property (nonatomic, readwrite, retain) NSString *requestTokenSecret;
+@property (nonatomic, readwrite, retain) NSString *accessToken;
+@property (nonatomic, readwrite, retain) NSString *accessTokenSecret;
+
+@property (nonatomic, readwrite, retain) NSString *sessionHandle;
+
+- (id)initWithCredentials:(NSDictionary *)inCredential;
+- (id)initWithCredentials:(NSDictionary *)inCredentials forBaseURL:(NSURL *)inBaseURL;
+- (id)initWithCredentials:(NSDictionary *)inCredentials forBaseURL:(NSURL *)inBaseURL withAuthenticationURL:(NSURL *)inAuthenticationURL;
+
+- (void)setCredential:(id)inCredential withName:(NSString *)inName;
+- (void)removeCredentialNamed:(NSString *)inName;
+
+
+@end
View
33 DropboxSDK.framework/Headers/MPOAuthCredentialStore.h
@@ -0,0 +1,33 @@
+//
+// MPOAuthCredentialStore.h
+// MPOAuthConnection
+//
+// Created by Karl Adam on 08.12.06.
+// Copyright 2008 matrixPointer. All rights reserved.
+//
+
+extern NSString *kMPOAuthCredentialConsumerKey;
+extern NSString *kMPOAuthCredentialConsumerSecret;
+extern NSString *kMPOAuthCredentialUsername;
+extern NSString *kMPOAuthCredentialPassword;
+extern NSString *kMPOAuthCredentialRequestToken;
+extern NSString *kMPOAuthCredentialRequestTokenSecret;
+extern NSString *kMPOAuthCredentialAccessToken;
+extern NSString *kMPOAuthCredentialAccessTokenSecret;
+extern NSString *kMPOAuthCredentialSessionHandle;
+extern NSString *kMPOAuthCredentialRealm;
+
+@protocol MPOAuthCredentialStore <NSObject>
+
+@property (nonatomic, readonly) NSString *consumerKey;
+@property (nonatomic, readonly) NSString *consumerSecret;
+@property (nonatomic, readonly) NSString *username;
+@property (nonatomic, readonly) NSString *password;
+@property (nonatomic, readonly, retain) NSString *requestToken;
+@property (nonatomic, readonly, retain) NSString *requestTokenSecret;
+@property (nonatomic, readonly, retain) NSString *accessToken;
+@property (nonatomic, readonly, retain) NSString *accessTokenSecret;
+
+- (NSString *)credentialNamed:(NSString *)inCredentialName;
+- (void)discardOAuthCredentials;
+@end
View
28 DropboxSDK.framework/Headers/MPOAuthParameterFactory.h
@@ -0,0 +1,28 @@
+//
+// MPOAuthParameterFactory.h
+// MPOAuthConnection
+//
+// Created by Karl Adam on 08.12.06.
+// Copyright 2008 matrixPointer. All rights reserved.
+//
+
+extern NSString *kMPOAuthSignatureMethod;
+
+@class MPURLRequestParameter;
+
+@protocol MPOAuthParameterFactory <NSObject>
+
+@property (nonatomic, readwrite, retain) NSString *signatureMethod;
+@property (nonatomic, readonly) NSString *signingKey;
+@property (nonatomic, readonly) NSString *timestamp;
+
+- (NSArray *)oauthParameters;
+
+- (MPURLRequestParameter *)oauthConsumerKeyParameter;
+- (MPURLRequestParameter *)oauthTokenParameter;
+- (MPURLRequestParameter *)oauthSignatureMethodParameter;
+- (MPURLRequestParameter *)oauthTimestampParameter;
+- (MPURLRequestParameter *)oauthNonceParameter;
+- (MPURLRequestParameter *)oauthVersionParameter;
+
+@end
View
28 DropboxSDK.framework/Headers/MPOAuthSignatureParameter.h
@@ -0,0 +1,28 @@
+//
+// MPOAuthSignatureParameter.h
+// MPOAuthConnection
+//
+// Created by Karl Adam on 08.12.07.
+// Copyright 2008 matrixPointer. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "MPURLRequestParameter.h"
+
+#define kMPOAuthSignatureMethodPlaintext @"PLAINTEXT"
+#define kMPOAuthSignatureMethodHMACSHA1 @"HMAC-SHA1"
+#define kMPOAuthSignatureMethodRSASHA1 @"RSA-SHA1"
+
+@class MPOAuthURLRequest;
+
+@interface MPOAuthSignatureParameter : MPURLRequestParameter {
+
+}
+
++ (NSString *)signatureBaseStringUsingParameterString:(NSString *)inParameterString forRequest:(MPOAuthURLRequest *)inRequest;
++ (NSString *)HMAC_SHA1SignatureForText:(NSString *)inText usingSecret:(NSString *)inSecret;
+
+- (id)initWithText:(NSString *)inText andSecret:(NSString *)inSecret forRequest:(MPOAuthURLRequest *)inRequest usingMethod:(NSString *)inMethod;
+
+
+@end
View
32 DropboxSDK.framework/Headers/MPOAuthURLRequest.h
@@ -0,0 +1,32 @@
+//
+// MPOAuthURLRequest.h
+// MPOAuthConnection
+//
+// Created by Karl Adam on 08.12.05.
+// Copyright 2008 matrixPointer. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface MPOAuthURLRequest : NSObject {
+@private
+ NSURL *_url;
+ NSString *_httpMethod;
+ NSURLRequest *_urlRequest;
+ NSMutableArray *_parameters;
+}
+
+@property (nonatomic, readwrite, retain) NSURL *url;
+@property (nonatomic, readwrite, retain) NSString *HTTPMethod;
+@property (nonatomic, readonly, retain) NSURLRequest *urlRequest;
+@property (nonatomic, readwrite, retain) NSMutableArray *parameters;
+
+- (id)initWithURL:(NSURL *)inURL andParameters:(NSArray *)parameters;
+- (id)initWithURLRequest:(NSURLRequest *)inRequest;
+
+- (void)addParameters:(NSArray *)inParameters;
+
+- (NSMutableURLRequest*)urlRequestSignedWithSecret:(NSString *)inSecret usingMethod:(NSString *)inScheme;
+
+@end
View
20 DropboxSDK.framework/Headers/MPOAuthURLResponse.h
@@ -0,0 +1,20 @@
+//
+// MPOAuthURLResponse.h
+// MPOAuthConnection
+//
+// Created by Karl Adam on 08.12.05.
+// Copyright 2008 matrixPointer. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface MPOAuthURLResponse : NSObject {
+ NSURLResponse *_urlResponse;
+ NSDictionary *_oauthParameters;
+}
+
+@property (nonatomic, readonly, retain) NSURLResponse *urlResponse;
+@property (nonatomic, readonly, retain) NSDictionary *oauthParameters;
+
+@end
View
30 DropboxSDK.framework/Headers/MPURLRequestParameter.h
@@ -0,0 +1,30 @@
+//
+// MPURLParameter.h
+// MPOAuthConnection
+//
+// Created by Karl Adam on 08.12.05.
+// Copyright 2008 matrixPointer. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface MPURLRequestParameter : NSObject {
+ NSString *_name;
+ NSString *_value;
+}
+
+@property (nonatomic, readwrite, copy) NSString *name;
+@property (nonatomic, readwrite, copy) NSString *value;
+
++ (NSArray *)parametersFromString:(NSString *)inString;
++ (NSArray *)parametersFromDictionary:(NSDictionary *)inDictionary;
++ (NSDictionary *)parameterDictionaryFromString:(NSString *)inString;
++ (NSString *)parameterStringForParameters:(NSArray *)inParameters;
++ (NSString *)parameterStringForDictionary:(NSDictionary *)inParameterDictionary;
+
+- (id)initWithName:(NSString *)inName andValue:(NSString *)inValue;
+
+- (NSString *)URLEncodedParameterString;
+
+@end
View
15 DropboxSDK.framework/Headers/NSDictionary+Dropbox.h
@@ -0,0 +1,15 @@
+//
+// NSDictionary+Dropbox.h
+// Dropbox
+//
+// Created by Brian Smith on 6/5/11.
+// Copyright 2011 Dropbox, Inc. All rights reserved.
+//
+
+
+@interface NSDictionary (Dropbox)
+
++ (NSDictionary *)dictionaryWithQueryString:(NSString *)query;
+- (NSString *)urlRepresentation;
+
+@end
View
68 DropboxSDK.framework/Headers/NSObject+DBJSON.h
@@ -0,0 +1,68 @@
+/*
+ Copyright (C) 2009 Stig Brautaset. 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 the author 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.
+ */
+
+#import <Foundation/Foundation.h>
+
+
+/**
+ @brief Adds JSON generation to Foundation classes
+
+ This is a category on NSObject that adds methods for returning JSON representations
+ of standard objects to the objects themselves. This means you can call the
+ -JSONRepresentation method on an NSArray object and it'll do what you want.
+ */
+@interface NSObject (NSObject_DBJSON)
+
+/**
+ @brief Returns a string containing the receiver encoded as a JSON fragment.
+
+ This method is added as a category on NSObject but is only actually
+ supported for the following objects:
+ @li NSDictionary
+ @li NSArray
+ @li NSString
+ @li NSNumber (also used for booleans)
+ @li NSNull
+
+ @deprecated Given we bill ourselves as a "strict" JSON library, this method should be removed.
+ */
+- (NSString *)JSONFragment;
+
+/**
+ @brief Returns a string containing the receiver encoded in JSON.
+
+ This method is added as a category on NSObject but is only actually
+ supported for the following objects:
+ @li NSDictionary
+ @li NSArray
+ */
+- (NSString *)JSONRepresentation;
+
+@end
+
View
58 DropboxSDK.framework/Headers/NSString+DBJSON.h
@@ -0,0 +1,58 @@
+/*
+ Copyright (C) 2009 Stig Brautaset. 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 the author 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.
+ */
+
+#import <Foundation/Foundation.h>
+
+/**
+ @brief Adds JSON parsing methods to NSString
+
+This is a category on NSString that adds methods for parsing the target string.
+*/
+@interface NSString (NSString_DBJSON)
+
+
+/**
+ @brief Returns the object represented in the receiver, or nil on error.
+
+ Returns a a scalar object represented by the string's JSON fragment representation.
+
+ @deprecated Given we bill ourselves as a "strict" JSON library, this method should be removed.
+ */
+- (id)JSONFragmentValue;
+
+/**
+ @brief Returns the NSDictionary or NSArray represented by the current string's JSON representation.
+
+ Returns the dictionary or array represented in the receiver, or nil on error.
+
+ Returns the NSDictionary or NSArray represented by the current string's JSON representation.
+ */
+- (id)JSONValue;
+
+@end
View
18 DropboxSDK.framework/Headers/NSString+Dropbox.h
@@ -0,0 +1,18 @@
+//
+// NSString+Dropbox.h
+// DropboxSDK
+//
+// Created by Brian Smith on 7/19/10.
+// Copyright 2010 Dropbox, Inc. All rights reserved.
+//
+
+
+@interface NSString (Dropbox)
+
+// This will take a path for a resource and normalize so you can compare paths
+- (NSString*)normalizedDropboxPath;
+
+// Normalizes both paths and compares them
+- (BOOL)isEqualToDropboxPath:(NSString*)otherPath;
+
+@end
View
21 DropboxSDK.framework/Headers/NSString+URLEscapingAdditions.h
@@ -0,0 +1,21 @@
+//
+// NSString+URLEscapingAdditions.h
+// MPOAuthConnection
+//
+// Created by Karl Adam on 08.12.07.
+// Copyright 2008 matrixPointer. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface NSString (MPURLEscapingAdditions)
+
+- (BOOL)isIPAddress;
+- (NSString *)stringByAddingURIPercentEscapesUsingEncoding:(NSStringEncoding)inEncoding;
+
+@end
+
+@interface NSURL (MPURLEscapingAdditions)
+- (NSString *)stringByAddingURIPercentEscapesUsingEncoding:(NSStringEncoding)inEncoding;
+@end
View
21 DropboxSDK.framework/Headers/NSURL+MPURLParameterAdditions.h
@@ -0,0 +1,21 @@
+//
+// NSURL+MPURLParameterAdditions.h
+// MPOAuthConnection
+//
+// Created by Karl Adam on 08.12.08.
+// Copyright 2008 matrixPointer. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface NSURL (MPURLParameterAdditions)
+
+- (NSURL *)urlByAddingParameters:(NSArray *)inParameters;
+- (NSURL *)urlByAddingParameterDictionary:(NSDictionary *)inParameters;
+- (NSURL *)urlByRemovingQuery;
+- (NSString *)absoluteNormalizedString;
+
+- (BOOL)domainMatches:(NSString *)inString;
+
+@end
View
14 DropboxSDK.framework/Headers/NSURLResponse+Encoding.h
@@ -0,0 +1,14 @@
+//
+// NSURL+MPEncodingAdditions.h
+// MPOAuthConnection
+//
+// Created by Karl Adam on 08.12.05.
+// Copyright 2008 matrixPointer. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+@interface NSURLResponse (EncodingAdditions)
+- (NSStringEncoding)encoding;
+@end
View
17 DropboxSDK.framework/Headers/UIAlertView+Dropbox.h
@@ -0,0 +1,17 @@
+//
+// UIAlertView+Dropbox.h
+// Dropbox
+//
+// Created by Brian Smith on 4/21/11.
+// Copyright 2011 Dropbox, Inc. All rights reserved.
+//
+
+
+@interface UIAlertView (Dropbox)
+
+// Thanks to Marton Fodor for this method
++ (void)showAlertWithTitle:(NSString *)title message:(NSString *)message
+delegate:(id<UIAlertViewDelegate>)delegate cancelButtonTitle:(NSString *)cancelButtonTitle
+otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION;
+
+@end
View
BIN  DropboxSDK.framework/Info.plist
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.