├── .gitignore ├── Classes ├── Example │ ├── ExampleShareFile.h │ ├── ExampleShareFile.m │ ├── ExampleShareImage.h │ ├── ExampleShareImage.m │ ├── ExampleShareLink.h │ ├── ExampleShareLink.m │ ├── ExampleShareText.h │ ├── ExampleShareText.m │ ├── RootViewController.h │ ├── RootViewController.m │ ├── ShareKitAppDelegate.h │ ├── ShareKitAppDelegate.m │ ├── example.pdf │ └── sanFran.jpg └── ShareKit │ ├── Core │ ├── Base Sharer Classes │ │ ├── SHKOAuthSharer.h │ │ ├── SHKOAuthSharer.m │ │ ├── SHKSharer.h │ │ └── SHKSharer.m │ ├── Categories │ │ ├── NSData+md5.h │ │ ├── NSData+md5.m │ │ ├── UIWebView+SHK.h │ │ └── UIWebView+SHK.m │ ├── Helpers │ │ ├── Keychain │ │ │ ├── SFHFKeychainUtils.h │ │ │ └── SFHFKeychainUtils.m │ │ ├── OAuth │ │ │ ├── Categories │ │ │ │ ├── NSMutableURLRequest+Parameters.h │ │ │ │ ├── NSMutableURLRequest+Parameters.m │ │ │ │ ├── NSString+URLEncoding.h │ │ │ │ ├── NSString+URLEncoding.m │ │ │ │ ├── NSURL+Base.h │ │ │ │ └── NSURL+Base.m │ │ │ ├── Crytpo │ │ │ │ ├── Base64Transcoder.c │ │ │ │ ├── Base64Transcoder.h │ │ │ │ ├── hmac.c │ │ │ │ ├── hmac.h │ │ │ │ ├── sha1.c │ │ │ │ └── sha1.h │ │ │ ├── OAAsynchronousDataFetcher.h │ │ │ ├── OAAsynchronousDataFetcher.m │ │ │ ├── OAConsumer.h │ │ │ ├── OAConsumer.m │ │ │ ├── OADataFetcher.h │ │ │ ├── OADataFetcher.m │ │ │ ├── OAHMAC_SHA1SignatureProvider.h │ │ │ ├── OAHMAC_SHA1SignatureProvider.m │ │ │ ├── OAMutableURLRequest.h │ │ │ ├── OAMutableURLRequest.m │ │ │ ├── OAPlaintextSignatureProvider.h │ │ │ ├── OAPlaintextSignatureProvider.m │ │ │ ├── OARequestParameter.h │ │ │ ├── OARequestParameter.m │ │ │ ├── OAServiceTicket.h │ │ │ ├── OAServiceTicket.m │ │ │ ├── OASignatureProviding.h │ │ │ ├── OAToken.h │ │ │ ├── OAToken.m │ │ │ └── OAuthConsumer.h │ │ ├── SHKRequest.h │ │ └── SHKRequest.m │ ├── SHK.h │ ├── SHK.m │ ├── SHKItem.h │ ├── SHKItem.m │ ├── SHKOfflineSharer.h │ ├── SHKOfflineSharer.m │ └── SHKSharers.plist │ ├── Customize UI │ ├── SHKCustomFormController.h │ ├── SHKCustomFormController.m │ ├── SHKCustomFormFieldCell.h │ ├── SHKCustomFormFieldCell.m │ ├── SHKCustomShareMenu.h │ ├── SHKCustomShareMenu.m │ ├── SHKCustomShareMenuCell.h │ └── SHKCustomShareMenuCell.m │ ├── Localization │ ├── de.lproj │ │ └── Localizable.strings │ ├── en.lproj │ │ └── Localizable.strings │ ├── eu.lproj │ │ └── Localizable.strings │ ├── fr.lproj │ │ └── Localizable.strings │ ├── ja.lproj │ │ └── Localizable.strings │ ├── ko.lproj │ │ └── Localizable.strings │ ├── nl.lproj │ │ └── Localizable.strings │ ├── vi.lproj │ │ └── Localizable.strings │ └── zh_CN.lproj │ │ └── Localizable.strings │ ├── Reachability │ ├── Reachability.h │ └── Reachability.m │ ├── SHKConfig.h │ ├── Sharers │ ├── Actions │ │ ├── Copy │ │ │ ├── SHKCopy.h │ │ │ └── SHKCopy.m │ │ ├── Email │ │ │ ├── SHKMail.h │ │ │ └── SHKMail.m │ │ ├── Open in Safari │ │ │ ├── SHKSafari.h │ │ │ └── SHKSafari.m │ │ ├── Save to Album │ │ │ ├── SHKPhotoAlbum.h │ │ │ └── SHKPhotoAlbum.m │ │ └── Text Message │ │ │ ├── SHKTextMessage.h │ │ │ └── SHKTextMessage.m │ └── Services │ │ ├── Delicious │ │ ├── SHKDelicious.h │ │ └── SHKDelicious.m │ │ ├── Evernote │ │ ├── Helpers │ │ │ ├── edam │ │ │ │ ├── EDAMLimits.h │ │ │ │ ├── EDAMLimits.m │ │ │ │ ├── Errors.h │ │ │ │ ├── Errors.m │ │ │ │ ├── NoteStore.h │ │ │ │ ├── NoteStore.m │ │ │ │ ├── Types.h │ │ │ │ ├── Types.m │ │ │ │ ├── UserStore.h │ │ │ │ └── UserStore.m │ │ │ └── thrift │ │ │ │ ├── TApplicationException.h │ │ │ │ ├── TApplicationException.m │ │ │ │ ├── TException.h │ │ │ │ ├── TException.m │ │ │ │ ├── TProcessor.h │ │ │ │ ├── TProcessorFactory.h │ │ │ │ ├── TSharedProcessorFactory.h │ │ │ │ ├── TSharedProcessorFactory.m │ │ │ │ ├── protocol │ │ │ │ ├── TBinaryProtocol.h │ │ │ │ ├── TBinaryProtocol.m │ │ │ │ ├── TProtocol.h │ │ │ │ ├── TProtocolException.h │ │ │ │ ├── TProtocolException.m │ │ │ │ ├── TProtocolFactory.h │ │ │ │ ├── TProtocolUtil.h │ │ │ │ └── TProtocolUtil.m │ │ │ │ └── transport │ │ │ │ ├── THTTPClient.h │ │ │ │ ├── THTTPClient.m │ │ │ │ ├── TMemoryBuffer.h │ │ │ │ ├── TMemoryBuffer.m │ │ │ │ ├── TTransport.h │ │ │ │ ├── TTransportException.h │ │ │ │ └── TTransportException.m │ │ ├── SHKEvernote.h │ │ ├── SHKEvernote.m │ │ └── SHKEvernote.md │ │ ├── Facebook │ │ ├── FBConnect │ │ │ ├── FBConnect.bundle │ │ │ │ └── images │ │ │ │ │ ├── close.png │ │ │ │ │ ├── fbicon.png │ │ │ │ │ ├── login.png │ │ │ │ │ ├── login2.png │ │ │ │ │ ├── login2_down.png │ │ │ │ │ ├── login_down.png │ │ │ │ │ ├── logout.png │ │ │ │ │ └── logout_down.png │ │ │ ├── FBConnect.h │ │ │ ├── FBConnectGlobal.h │ │ │ ├── FBConnectGlobal.m │ │ │ ├── FBDialog.h │ │ │ ├── FBDialog.m │ │ │ ├── FBFeedDialog.h │ │ │ ├── FBFeedDialog.m │ │ │ ├── FBLoginButton.h │ │ │ ├── FBLoginButton.m │ │ │ ├── FBLoginDialog.h │ │ │ ├── FBLoginDialog.m │ │ │ ├── FBPermissionDialog.h │ │ │ ├── FBPermissionDialog.m │ │ │ ├── FBRequest.h │ │ │ ├── FBRequest.m │ │ │ ├── FBSession.h │ │ │ ├── FBSession.m │ │ │ ├── FBStreamDialog.h │ │ │ ├── FBStreamDialog.m │ │ │ ├── FBXMLHandler.h │ │ │ └── FBXMLHandler.m │ │ ├── SHKFBStreamDialog.h │ │ ├── SHKFBStreamDialog.m │ │ ├── SHKFacebook.h │ │ └── SHKFacebook.m │ │ ├── Google Reader │ │ ├── SHKGoogleReader.h │ │ └── SHKGoogleReader.m │ │ ├── Instapaper │ │ ├── SHKInstapaper.h │ │ └── SHKInstapaper.m │ │ ├── Pinboard │ │ ├── SHKPinboard.h │ │ └── SHKPinboard.m │ │ ├── Read It Later │ │ ├── SHKReadItLater.h │ │ └── SHKReadItLater.m │ │ ├── Tumblr │ │ ├── SHKTumblr.h │ │ └── SHKTumblr.m │ │ └── Twitter │ │ ├── SHKTwitter.h │ │ ├── SHKTwitter.m │ │ ├── SHKTwitterForm.h │ │ └── SHKTwitterForm.m │ └── UI │ ├── SHKActionSheet.h │ ├── SHKActionSheet.m │ ├── SHKActivityIndicator.h │ ├── SHKActivityIndicator.m │ ├── SHKFormController.h │ ├── SHKFormController.m │ ├── SHKFormFieldCell.h │ ├── SHKFormFieldCell.m │ ├── SHKFormFieldSettings.h │ ├── SHKFormFieldSettings.m │ ├── SHKOAuthView.h │ ├── SHKOAuthView.m │ ├── SHKShareMenu.h │ ├── SHKShareMenu.m │ ├── SHKViewControllerWrapper.h │ └── SHKViewControllerWrapper.m ├── MainWindow.xib ├── README ├── Resources-iPad └── MainWindow-iPad.xib ├── RootViewController.xib ├── ShareKit-Info.plist ├── ShareKit.xcodeproj └── project.pbxproj ├── ShareKit_Prefix.pch └── main.m /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *~ 3 | *.pbxuser 4 | *.perspective 5 | *.perspectivev3 6 | *.mode1v3 7 | build 8 | .DS_Store 9 | Classes/ShareKit/SHKConfig.h 10 | -------------------------------------------------------------------------------- /Classes/Example/ExampleShareFile.h: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleShareFile.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/29/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | 30 | 31 | @interface ExampleShareFile : UIViewController 32 | { 33 | UIWebView *webView; 34 | } 35 | 36 | @property (nonatomic, retain) UIWebView *webView; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Classes/Example/ExampleShareFile.m: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleShareFile.m 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/29/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import "ExampleShareFile.h" 29 | #import "SHK.h" 30 | #import "SHKActionSheet.h" 31 | 32 | @implementation ExampleShareFile 33 | 34 | @synthesize webView; 35 | 36 | - (void)dealloc 37 | { 38 | [webView release]; 39 | [super dealloc]; 40 | } 41 | 42 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 43 | { 44 | if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) 45 | { 46 | self.toolbarItems = [NSArray arrayWithObjects: 47 | [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease], 48 | [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(share)] autorelease], 49 | [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease], 50 | nil 51 | ]; 52 | } 53 | 54 | return self; 55 | } 56 | 57 | - (void)loadView 58 | { 59 | self.webView = [[UIWebView alloc] initWithFrame:CGRectZero]; 60 | webView.delegate = self; 61 | webView.scalesPageToFit = YES; 62 | [webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"example.pdf"]]]]; 63 | 64 | self.view = webView; 65 | [webView release]; 66 | } 67 | 68 | - (void)share 69 | { 70 | NSString *filePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"example.pdf"]; 71 | NSData *file = [NSData dataWithContentsOfFile:filePath]; 72 | 73 | SHKItem *item = [SHKItem file:file filename:@"Awesome.pdf" mimeType:@"application/pdf" title:@"My Awesome PDF"]; 74 | SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item]; 75 | [actionSheet showFromToolbar:self.navigationController.toolbar]; 76 | } 77 | 78 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 79 | { 80 | return YES; 81 | } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /Classes/Example/ExampleShareImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleShareImage.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/18/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | 30 | 31 | @interface ExampleShareImage : UIViewController 32 | { 33 | UIImageView *imageView; 34 | } 35 | 36 | @property (nonatomic, retain) UIImageView *imageView; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Classes/Example/ExampleShareImage.m: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleShareImage.m 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/18/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import "ExampleShareImage.h" 29 | #import "SHKItem.h" 30 | #import "SHKActionSheet.h" 31 | 32 | @implementation ExampleShareImage 33 | 34 | @synthesize imageView; 35 | 36 | - (void)dealloc 37 | { 38 | [imageView release]; 39 | [super dealloc]; 40 | } 41 | 42 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 43 | { 44 | if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) 45 | { 46 | self.toolbarItems = [NSArray arrayWithObjects: 47 | [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease], 48 | [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(share)] autorelease], 49 | [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease], 50 | nil 51 | ]; 52 | } 53 | 54 | return self; 55 | } 56 | 57 | - (void)loadView 58 | { 59 | [super loadView]; 60 | 61 | self.imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"sanFran.jpg"]]; 62 | 63 | imageView.frame = CGRectMake(0,0,self.view.bounds.size.width,self.view.bounds.size.height); 64 | 65 | [self.view addSubview:imageView]; 66 | 67 | [imageView release]; 68 | } 69 | 70 | - (void)share 71 | { 72 | SHKItem *item = [SHKItem image:imageView.image title:@"San Francisco"]; 73 | SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item]; 74 | 75 | [actionSheet showFromToolbar:self.navigationController.toolbar]; 76 | } 77 | 78 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 79 | { 80 | return YES; 81 | } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /Classes/Example/ExampleShareLink.h: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleShareLink.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/17/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | 30 | 31 | @interface ExampleShareLink : UIViewController 32 | { 33 | UIWebView *webView; 34 | } 35 | 36 | @property (nonatomic, retain) UIWebView *webView; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Classes/Example/ExampleShareLink.m: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleShareLink.m 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/17/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import "ExampleShareLink.h" 29 | #import "SHK.h" 30 | 31 | @implementation ExampleShareLink 32 | 33 | @synthesize webView; 34 | 35 | - (void)dealloc 36 | { 37 | [webView release]; 38 | [super dealloc]; 39 | } 40 | 41 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 42 | { 43 | if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) 44 | { 45 | self.toolbarItems = [NSArray arrayWithObjects: 46 | [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease], 47 | [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(share)] autorelease], 48 | [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease], 49 | nil 50 | ]; 51 | } 52 | 53 | return self; 54 | } 55 | 56 | - (void)share 57 | { 58 | SHKItem *item = [SHKItem URL:webView.request.URL title:[webView pageTitle]]; 59 | SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item]; 60 | [actionSheet showFromToolbar:self.navigationController.toolbar]; 61 | } 62 | 63 | - (void)loadView 64 | { 65 | self.webView = [[UIWebView alloc] initWithFrame:CGRectZero]; 66 | webView.delegate = self; 67 | webView.scalesPageToFit = YES; 68 | [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://apple.com"]]]; 69 | 70 | self.view = webView; 71 | [webView release]; 72 | } 73 | 74 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 75 | { 76 | return YES; 77 | } 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /Classes/Example/ExampleShareText.h: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleShareText.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/18/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | 30 | 31 | @interface ExampleShareText : UIViewController 32 | { 33 | UITextView *textView; 34 | } 35 | 36 | @property (nonatomic, retain) UITextView *textView; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Classes/Example/ExampleShareText.m: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleShareText.m 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/18/10. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | 26 | #import "ExampleShareText.h" 27 | #import "SHKItem.h" 28 | #import "SHKActionSheet.h" 29 | 30 | @implementation ExampleShareText 31 | 32 | @synthesize textView; 33 | 34 | - (void)dealloc 35 | { 36 | [textView release]; 37 | [super dealloc]; 38 | } 39 | 40 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 41 | { 42 | if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) 43 | { 44 | self.toolbarItems = [NSArray arrayWithObjects: 45 | [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease], 46 | [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(share)] autorelease], 47 | [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease], 48 | nil 49 | ]; 50 | } 51 | 52 | return self; 53 | } 54 | 55 | - (void)loadView 56 | { 57 | [super loadView]; 58 | 59 | self.textView = [[UITextView alloc] initWithFrame:CGRectMake(0,0,self.view.bounds.size.width,self.view.bounds.size.height)]; 60 | [self.view addSubview:textView]; 61 | 62 | textView.text = @"This is a chunk of text. If you highlight it, you'll be able to share the selection. If you tap the share button below, it will share all of it."; 63 | textView.editable = NO; 64 | 65 | [textView release]; 66 | } 67 | 68 | - (void)share 69 | { 70 | NSString *text; 71 | 72 | if (textView.selectedRange.length > 0) 73 | text = [textView.text substringWithRange:textView.selectedRange]; 74 | 75 | else 76 | text = textView.text; 77 | 78 | 79 | SHKItem *item = [SHKItem text:text]; 80 | SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item]; 81 | 82 | [actionSheet showFromToolbar:self.navigationController.toolbar]; 83 | } 84 | 85 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 86 | { 87 | return YES; 88 | } 89 | 90 | 91 | @end 92 | -------------------------------------------------------------------------------- /Classes/Example/RootViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // RootViewController.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/4/10. 6 | // Copyright Idea Shower, LLC 2010. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface RootViewController : UITableViewController { 12 | } 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Classes/Example/ShareKitAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // ShareKitAppDelegate.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/4/10. 6 | // Copyright Idea Shower, LLC 2010. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ShareKitAppDelegate : NSObject { 12 | 13 | UIWindow *window; 14 | UINavigationController *navigationController; 15 | } 16 | 17 | @property (nonatomic, retain) IBOutlet UIWindow *window; 18 | @property (nonatomic, retain) IBOutlet UINavigationController *navigationController; 19 | 20 | @end 21 | 22 | -------------------------------------------------------------------------------- /Classes/Example/ShareKitAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // ShareKitAppDelegate.m 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/4/10. 6 | // Copyright Idea Shower, LLC 2010. All rights reserved. 7 | // 8 | 9 | #import "ShareKitAppDelegate.h" 10 | #import "RootViewController.h" 11 | 12 | #import "SHKReadItLater.h" 13 | #import "SHKFacebook.h" 14 | 15 | @implementation ShareKitAppDelegate 16 | 17 | @synthesize window; 18 | @synthesize navigationController; 19 | 20 | 21 | #pragma mark - 22 | #pragma mark Application lifecycle 23 | 24 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 25 | // Override point for customization after app launch 26 | 27 | [window addSubview:[navigationController view]]; 28 | [window makeKeyAndVisible]; 29 | 30 | navigationController.topViewController.title = SHKLocalizedString(@"Examples"); 31 | [navigationController setToolbarHidden:NO]; 32 | 33 | [self performSelector:@selector(testOffline) withObject:nil afterDelay:0.5]; 34 | 35 | return YES; 36 | } 37 | 38 | - (void)testOffline 39 | { 40 | [SHK flushOfflineQueue]; 41 | } 42 | 43 | - (void)applicationWillTerminate:(UIApplication *)application 44 | { 45 | // Save data if appropriate 46 | } 47 | 48 | 49 | #pragma mark - 50 | #pragma mark Memory management 51 | 52 | - (void)dealloc { 53 | [navigationController release]; 54 | [window release]; 55 | [super dealloc]; 56 | } 57 | 58 | 59 | @end 60 | 61 | -------------------------------------------------------------------------------- /Classes/Example/example.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ideashower/ShareKit/9139332ef1ab10128697487185c106d81215df6a/Classes/Example/example.pdf -------------------------------------------------------------------------------- /Classes/Example/sanFran.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ideashower/ShareKit/9139332ef1ab10128697487185c106d81215df6a/Classes/Example/sanFran.jpg -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Base Sharer Classes/SHKOAuthSharer.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKOAuthSharer.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/21/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | #import "SHKSharer.h" 30 | #import "SHKOAuthView.h" 31 | #import "OAuthConsumer.h" 32 | 33 | @interface SHKOAuthSharer : SHKSharer 34 | { 35 | NSString *consumerKey; 36 | NSString *secretKey; 37 | NSURL *authorizeCallbackURL; 38 | 39 | NSURL *authorizeURL; 40 | NSURL *accessURL; 41 | NSURL *requestURL; 42 | 43 | OAConsumer *consumer; 44 | OAToken *requestToken; 45 | OAToken *accessToken; 46 | 47 | id signatureProvider; 48 | 49 | NSDictionary *authorizeResponseQueryVars; 50 | } 51 | 52 | @property (nonatomic, retain) NSString *consumerKey; 53 | @property (nonatomic, retain) NSString *secretKey; 54 | @property (nonatomic, retain) NSURL *authorizeCallbackURL; 55 | 56 | @property (nonatomic, retain) NSURL *authorizeURL; 57 | @property (nonatomic, retain) NSURL *accessURL; 58 | @property (nonatomic, retain) NSURL *requestURL; 59 | 60 | @property (retain) OAConsumer *consumer; 61 | @property (retain) OAToken *requestToken; 62 | @property (retain) OAToken *accessToken; 63 | 64 | @property (retain) id signatureProvider; 65 | 66 | @property (nonatomic, retain) NSDictionary *authorizeResponseQueryVars; 67 | 68 | 69 | 70 | #pragma mark - 71 | #pragma mark OAuth Authorization 72 | 73 | - (void)tokenRequest; 74 | - (void)tokenRequestModifyRequest:(OAMutableURLRequest *)oRequest; 75 | - (void)tokenRequestTicket:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data; 76 | - (void)tokenRequestTicket:(OAServiceTicket *)ticket didFailWithError:(NSError*)error; 77 | 78 | - (void)tokenAuthorize; 79 | 80 | - (void)tokenAccess; 81 | - (void)tokenAccess:(BOOL)refresh; 82 | - (void)tokenAccessModifyRequest:(OAMutableURLRequest *)oRequest; 83 | - (void)tokenAccessTicket:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data; 84 | - (void)tokenAccessTicket:(OAServiceTicket *)ticket didFailWithError:(NSError*)error; 85 | 86 | - (void)storeAccessToken; 87 | - (BOOL)restoreAccessToken; 88 | - (void)refreshToken; 89 | 90 | 91 | @end 92 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Categories/NSData+md5.h: -------------------------------------------------------------------------------- 1 | @interface NSData (md5) 2 | - (NSString *) md5; 3 | @end -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Categories/NSData+md5.m: -------------------------------------------------------------------------------- 1 | #import "NSData+md5.h" 2 | #import 3 | 4 | @implementation NSData (md5) 5 | 6 | -(NSString*)md5{ 7 | const char *cStr = [self bytes]; 8 | unsigned char digest[CC_MD5_DIGEST_LENGTH]; 9 | CC_MD5( cStr, [self length], digest ); 10 | NSString* s = [NSString stringWithFormat: @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", 11 | digest[0], digest[1], 12 | digest[2], digest[3], 13 | digest[4], digest[5], 14 | digest[6], digest[7], 15 | digest[8], digest[9], 16 | digest[10], digest[11], 17 | digest[12], digest[13], 18 | digest[14], digest[15]]; 19 | return s; 20 | } 21 | 22 | @end -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Categories/UIWebView+SHK.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIWebView+SHK.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/16/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | 30 | 31 | @interface UIWebView (SHK) 32 | 33 | // Retrieves the title from the page loaded in a UIWebView 34 | // Useful for providing a title when sharing URLs 35 | 36 | - (NSString *)pageTitle; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Categories/UIWebView+SHK.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIWebView+SHK.m 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/16/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import "UIWebView+SHK.h" 29 | 30 | @implementation UIWebView (SHK) 31 | 32 | - (NSString *)pageTitle 33 | { 34 | return [self stringByEvaluatingJavaScriptFromString:@"document.title"]; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/Keychain/SFHFKeychainUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // SFHFKeychainUtils.h 3 | // 4 | // Created by Buzz Andersen on 10/20/08. 5 | // Based partly on code by Jonathan Wight, Jon Crosby, and Mike Malone. 6 | // Copyright 2008 Sci-Fi Hi-Fi. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person 9 | // obtaining a copy of this software and associated documentation 10 | // files (the "Software"), to deal in the Software without 11 | // restriction, including without limitation the rights to use, 12 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the 14 | // Software is furnished to do so, subject to the following 15 | // conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be 18 | // included in all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 | // OTHER DEALINGS IN THE SOFTWARE. 28 | // 29 | 30 | #import 31 | 32 | 33 | @interface SFHFKeychainUtils : NSObject { 34 | 35 | } 36 | 37 | + (NSString *) getPasswordForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error; 38 | + (BOOL) storeUsername: (NSString *) username andPassword: (NSString *) password forServiceName: (NSString *) serviceName updateExisting: (BOOL) updateExisting error: (NSError **) error; 39 | + (BOOL) deleteItemForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error; 40 | 41 | @end -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/Categories/NSMutableURLRequest+Parameters.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableURLRequest+Parameters.h 3 | // 4 | // Created by Jon Crosby on 10/19/07. 5 | // Copyright 2007 Kaboomerang LLC. All rights reserved. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import 26 | #import "OARequestParameter.h" 27 | #import "NSURL+Base.h" 28 | 29 | 30 | @interface NSMutableURLRequest (OAParameterAdditions) 31 | 32 | - (NSArray *)parameters; 33 | - (void)setParameters:(NSArray *)parameters; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/Categories/NSString+URLEncoding.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+URLEncoding.h 3 | // 4 | // Created by Jon Crosby on 10/19/07. 5 | // Copyright 2007 Kaboomerang LLC. All rights reserved. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | #import 27 | 28 | 29 | @interface NSString (OAURLEncodingAdditions) 30 | 31 | - (NSString *)URLEncodedString; 32 | - (NSString *)URLDecodedString; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/Categories/NSString+URLEncoding.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+URLEncoding.m 3 | // 4 | // Created by Jon Crosby on 10/19/07. 5 | // Copyright 2007 Kaboomerang LLC. All rights reserved. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | #import "NSString+URLEncoding.h" 27 | 28 | 29 | @implementation NSString (OAURLEncodingAdditions) 30 | 31 | - (NSString *)URLEncodedString 32 | { 33 | NSString *result = (NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, 34 | (CFStringRef)self, 35 | NULL, 36 | CFSTR("!*'();:@&=+$,/?%#[]"), 37 | kCFStringEncodingUTF8); 38 | [result autorelease]; 39 | return result; 40 | } 41 | 42 | - (NSString*)URLDecodedString 43 | { 44 | NSString *result = (NSString *)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(kCFAllocatorDefault, 45 | (CFStringRef)self, 46 | CFSTR(""), 47 | kCFStringEncodingUTF8); 48 | [result autorelease]; 49 | return result; 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/Categories/NSURL+Base.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSURL+Base.h 3 | // OAuthConsumer 4 | // 5 | // Created by Jon Crosby on 10/19/07. 6 | // Copyright 2007 Kaboomerang LLC. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import 28 | 29 | 30 | @interface NSURL (OABaseAdditions) 31 | 32 | - (NSString *)URLStringWithoutQuery; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/Categories/NSURL+Base.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSURL+Base.m 3 | // OAuthConsumer 4 | // 5 | // Created by Jon Crosby on 10/19/07. 6 | // Copyright 2007 Kaboomerang LLC. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import "NSURL+Base.h" 28 | 29 | 30 | @implementation NSURL (OABaseAdditions) 31 | 32 | - (NSString *)URLStringWithoutQuery 33 | { 34 | NSArray *parts = [[self absoluteString] componentsSeparatedByString:@"?"]; 35 | return [parts objectAtIndex:0]; 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/Crytpo/Base64Transcoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Base64Transcoder.h 3 | * Base64Test 4 | * 5 | * Created by Jonathan Wight on Tue Mar 18 2003. 6 | * Copyright (c) 2003 Toxic Software. All rights reserved. 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy 9 | * of this software and associated documentation files (the "Software"), to deal 10 | * in the Software without restriction, including without limitation the rights 11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | * copies of the Software, and to permit persons to whom the Software is 13 | * furnished to do so, subject to the following conditions: 14 | * 15 | * The above copyright notice and this permission notice shall be included in 16 | * all copies or substantial portions of the Software. 17 | * 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | * THE SOFTWARE. 25 | * 26 | */ 27 | 28 | #include 29 | #include 30 | 31 | extern size_t EstimateBas64EncodedDataSize(size_t inDataSize); 32 | extern size_t EstimateBas64DecodedDataSize(size_t inDataSize); 33 | 34 | extern bool Base64EncodeData(const void *inInputData, size_t inInputDataSize, char *outOutputData, size_t *ioOutputDataSize); 35 | extern bool Base64DecodeData(const void *inInputData, size_t inInputDataSize, void *ioOutputData, size_t *ioOutputDataSize); 36 | 37 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/Crytpo/hmac.c: -------------------------------------------------------------------------------- 1 | // 2 | // hmac.c 3 | // OAuthConsumer 4 | // 5 | // Created by Jonathan Wight on 4/8/8. 6 | // Copyright 2008 Jonathan Wight. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | /* 27 | * Implementation of HMAC-SHA1. Adapted from example at http://tools.ietf.org/html/rfc2104 28 | 29 | */ 30 | 31 | #include "sha1.h" 32 | 33 | #include 34 | #include 35 | 36 | void hmac_sha1(const unsigned char *inText, size_t inTextLength, unsigned char* inKey, size_t inKeyLength, unsigned char *outDigest) 37 | { 38 | const size_t B = 64; 39 | const size_t L = 20; 40 | 41 | SHA1_CTX theSHA1Context; 42 | unsigned char k_ipad[B + 1]; /* inner padding - key XORd with ipad */ 43 | unsigned char k_opad[B + 1]; /* outer padding - key XORd with opad */ 44 | 45 | /* if key is longer than 64 bytes reset it to key=SHA1 (key) */ 46 | if (inKeyLength > B) 47 | { 48 | SHA1Init(&theSHA1Context); 49 | SHA1Update(&theSHA1Context, inKey, inKeyLength); 50 | SHA1Final(inKey, &theSHA1Context); 51 | inKeyLength = L; 52 | } 53 | 54 | /* start out by storing key in pads */ 55 | memset(k_ipad, 0, sizeof k_ipad); 56 | memset(k_opad, 0, sizeof k_opad); 57 | memcpy(k_ipad, inKey, inKeyLength); 58 | memcpy(k_opad, inKey, inKeyLength); 59 | 60 | /* XOR key with ipad and opad values */ 61 | int i; 62 | for (i = 0; i < B; i++) 63 | { 64 | k_ipad[i] ^= 0x36; 65 | k_opad[i] ^= 0x5c; 66 | } 67 | 68 | /* 69 | * perform inner SHA1 70 | */ 71 | SHA1Init(&theSHA1Context); /* init context for 1st pass */ 72 | SHA1Update(&theSHA1Context, k_ipad, B); /* start with inner pad */ 73 | SHA1Update(&theSHA1Context, (unsigned char *)inText, inTextLength); /* then text of datagram */ 74 | SHA1Final((unsigned char *)outDigest, &theSHA1Context); /* finish up 1st pass */ 75 | 76 | /* 77 | * perform outer SHA1 78 | */ 79 | SHA1Init(&theSHA1Context); /* init context for 2nd 80 | * pass */ 81 | SHA1Update(&theSHA1Context, k_opad, B); /* start with outer pad */ 82 | SHA1Update(&theSHA1Context, outDigest, L); /* then results of 1st 83 | * hash */ 84 | SHA1Final(outDigest, &theSHA1Context); /* finish up 2nd pass */ 85 | 86 | } -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/Crytpo/hmac.h: -------------------------------------------------------------------------------- 1 | // 2 | // hmac.h 3 | // OAuthConsumer 4 | // 5 | // Created by Jonathan Wight on 4/8/8. 6 | // Copyright 2008 Jonathan Wight. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #ifndef HMAC_H 27 | #define HMAC_H 1 28 | 29 | extern void hmac_sha1(const unsigned char *inText, int inTextLength, unsigned char* inKey, const unsigned int inKeyLength, unsigned char *outDigest); 30 | 31 | #endif /* HMAC_H */ -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/Crytpo/sha1.h: -------------------------------------------------------------------------------- 1 | 2 | // From http://www.mirrors.wiretapped.net/security/cryptography/hashes/sha1/sha1.c 3 | 4 | typedef struct { 5 | unsigned long state[5]; 6 | unsigned long count[2]; 7 | unsigned char buffer[64]; 8 | } SHA1_CTX; 9 | 10 | extern void SHA1Init(SHA1_CTX* context); 11 | extern void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int len); 12 | extern void SHA1Final(unsigned char digest[20], SHA1_CTX* context); 13 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/OAAsynchronousDataFetcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OAAsynchronousDataFetcher.h 3 | // OAuthConsumer 4 | // 5 | // Created by Zsombor Szabó on 12/3/08. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | #import 26 | 27 | #import "OAMutableURLRequest.h" 28 | 29 | @interface OAAsynchronousDataFetcher : NSObject { 30 | OAMutableURLRequest *request; 31 | NSHTTPURLResponse *response; 32 | NSURLConnection *connection; 33 | NSMutableData *responseData; 34 | id delegate; 35 | SEL didFinishSelector; 36 | SEL didFailSelector; 37 | } 38 | 39 | + (id)asynchronousFetcherWithRequest:(OAMutableURLRequest *)aRequest delegate:(id)aDelegate didFinishSelector:(SEL)finishSelector didFailSelector:(SEL)failSelector; 40 | - (id)initWithRequest:(OAMutableURLRequest *)aRequest delegate:(id)aDelegate didFinishSelector:(SEL)finishSelector didFailSelector:(SEL)failSelector; 41 | 42 | - (void)start; 43 | - (void)cancel; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/OAConsumer.h: -------------------------------------------------------------------------------- 1 | // 2 | // OAConsumer.h 3 | // OAuthConsumer 4 | // 5 | // Created by Jon Crosby on 10/19/07. 6 | // Copyright 2007 Kaboomerang LLC. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import 28 | 29 | 30 | @interface OAConsumer : NSObject { 31 | @protected 32 | NSString *key; 33 | NSString *secret; 34 | } 35 | @property(retain) NSString *key; 36 | @property(retain) NSString *secret; 37 | 38 | - (id)initWithKey:(NSString *)aKey secret:(NSString *)aSecret; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/OAConsumer.m: -------------------------------------------------------------------------------- 1 | // 2 | // OAConsumer.m 3 | // OAuthConsumer 4 | // 5 | // Created by Jon Crosby on 10/19/07. 6 | // Copyright 2007 Kaboomerang LLC. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import "OAConsumer.h" 27 | 28 | 29 | @implementation OAConsumer 30 | @synthesize key, secret; 31 | 32 | #pragma mark init 33 | 34 | - (id)initWithKey:(NSString *)aKey secret:(NSString *)aSecret 35 | { 36 | if (self = [super init]) 37 | { 38 | self.key = aKey; 39 | self.secret = aSecret; 40 | } 41 | return self; 42 | } 43 | 44 | - (void)dealloc 45 | { 46 | [key release]; 47 | [secret release]; 48 | [super dealloc]; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/OADataFetcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OADataFetcher.h 3 | // OAuthConsumer 4 | // 5 | // Created by Jon Crosby on 11/5/07. 6 | // Copyright 2007 Kaboomerang LLC. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | #import "OAMutableURLRequest.h" 28 | #import "OAServiceTicket.h" 29 | 30 | 31 | @interface OADataFetcher : NSObject { 32 | @private 33 | OAMutableURLRequest *request; 34 | NSHTTPURLResponse *response; 35 | NSError *error; 36 | NSData *responseData; 37 | id delegate; 38 | SEL didFinishSelector; 39 | SEL didFailSelector; 40 | } 41 | 42 | - (void)fetchDataWithRequest:(OAMutableURLRequest *)aRequest delegate:(id)aDelegate didFinishSelector:(SEL)finishSelector didFailSelector:(SEL)failSelector; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/OADataFetcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // OADataFetcher.m 3 | // OAuthConsumer 4 | // 5 | // Created by Jon Crosby on 11/5/07. 6 | // Copyright 2007 Kaboomerang LLC. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import "OADataFetcher.h" 28 | 29 | 30 | @implementation OADataFetcher 31 | 32 | - (void)fetchDataWithRequest:(OAMutableURLRequest *)aRequest 33 | delegate:(id)aDelegate 34 | didFinishSelector:(SEL)finishSelector 35 | didFailSelector:(SEL)failSelector 36 | { 37 | request = aRequest; 38 | delegate = aDelegate; 39 | didFinishSelector = finishSelector; 40 | didFailSelector = failSelector; 41 | 42 | [request prepare]; 43 | 44 | responseData = [NSURLConnection sendSynchronousRequest:request 45 | returningResponse:&response 46 | error:&error]; 47 | 48 | if (response == nil || responseData == nil || error != nil) { 49 | OAServiceTicket *ticket= [[OAServiceTicket alloc] initWithRequest:request 50 | response:response 51 | didSucceed:NO]; 52 | [delegate performSelector:didFailSelector 53 | withObject:ticket 54 | withObject:error]; 55 | [ticket release]; 56 | } else { 57 | OAServiceTicket *ticket = [[OAServiceTicket alloc] initWithRequest:request 58 | response:response 59 | didSucceed:[(NSHTTPURLResponse *)response statusCode] < 400]; 60 | [delegate performSelector:didFinishSelector 61 | withObject:ticket 62 | withObject:responseData]; 63 | [ticket release]; 64 | } 65 | } 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/OAHMAC_SHA1SignatureProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // OAHMAC_SHA1SignatureProvider.h 3 | // OAuthConsumer 4 | // 5 | // Created by Jon Crosby on 10/19/07. 6 | // Copyright 2007 Kaboomerang LLC. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import 28 | #import "OASignatureProviding.h" 29 | 30 | 31 | @interface OAHMAC_SHA1SignatureProvider : NSObject 32 | @end 33 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/OAHMAC_SHA1SignatureProvider.m: -------------------------------------------------------------------------------- 1 | // 2 | // OAHMAC_SHA1SignatureProvider.m 3 | // OAuthConsumer 4 | // 5 | // Created by Jon Crosby on 10/19/07. 6 | // Copyright 2007 Kaboomerang LLC. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import "OAHMAC_SHA1SignatureProvider.h" 28 | #import 29 | 30 | #include "Base64Transcoder.h" 31 | 32 | @implementation OAHMAC_SHA1SignatureProvider 33 | 34 | - (NSString *)name 35 | { 36 | return @"HMAC-SHA1"; 37 | } 38 | 39 | - (NSString *)signClearText:(NSString *)text withSecret:(NSString *)secret 40 | { 41 | NSData *secretData = [secret dataUsingEncoding:NSUTF8StringEncoding]; 42 | NSData *clearTextData = [text dataUsingEncoding:NSUTF8StringEncoding]; 43 | unsigned char result[20]; 44 | CCHmac(kCCHmacAlgSHA1, [secretData bytes], [secretData length], [clearTextData bytes], [clearTextData length], result); 45 | 46 | //Base64 Encoding 47 | 48 | char base64Result[32]; 49 | size_t theResultLength = 32; 50 | Base64EncodeData(result, 20, base64Result, &theResultLength); 51 | NSData *theData = [NSData dataWithBytes:base64Result length:theResultLength]; 52 | 53 | NSString *base64EncodedResult = [[NSString alloc] initWithData:theData encoding:NSUTF8StringEncoding]; 54 | 55 | return [base64EncodedResult autorelease]; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/OAMutableURLRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // OAMutableURLRequest.h 3 | // OAuthConsumer 4 | // 5 | // Created by Jon Crosby on 10/19/07. 6 | // Copyright 2007 Kaboomerang LLC. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import 28 | #import "OAConsumer.h" 29 | #import "OAToken.h" 30 | #import "OAHMAC_SHA1SignatureProvider.h" 31 | #import "OASignatureProviding.h" 32 | #import "NSMutableURLRequest+Parameters.h" 33 | #import "NSURL+Base.h" 34 | 35 | 36 | @interface OAMutableURLRequest : NSMutableURLRequest { 37 | @protected 38 | OAConsumer *consumer; 39 | OAToken *token; 40 | NSString *realm; 41 | NSString *signature; 42 | id signatureProvider; 43 | NSString *nonce; 44 | NSString *timestamp; 45 | NSMutableDictionary *extraOAuthParameters; 46 | BOOL didPrepare; 47 | } 48 | @property(readonly) NSString *signature; 49 | @property(readonly) NSString *nonce; 50 | 51 | - (id)initWithURL:(NSURL *)aUrl 52 | consumer:(OAConsumer *)aConsumer 53 | token:(OAToken *)aToken 54 | realm:(NSString *)aRealm 55 | signatureProvider:(id)aProvider; 56 | 57 | - (id)initWithURL:(NSURL *)aUrl 58 | consumer:(OAConsumer *)aConsumer 59 | token:(OAToken *)aToken 60 | realm:(NSString *)aRealm 61 | signatureProvider:(id)aProvider 62 | nonce:(NSString *)aNonce 63 | timestamp:(NSString *)aTimestamp; 64 | 65 | - (void)prepare; 66 | 67 | - (void)setOAuthParameterName:(NSString*)parameterName withValue:(NSString*)parameterValue; 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/OAPlaintextSignatureProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // OAPlaintextSignatureProvider.h 3 | // OAuthConsumer 4 | // 5 | // Created by Jon Crosby on 10/19/07. 6 | // Copyright 2007 Kaboomerang LLC. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import 28 | #import "OASignatureProviding.h" 29 | 30 | @interface OAPlaintextSignatureProvider : NSObject 31 | @end 32 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/OAPlaintextSignatureProvider.m: -------------------------------------------------------------------------------- 1 | // 2 | // OAPlaintextSignatureProvider.m 3 | // OAuthConsumer 4 | // 5 | // Created by Jon Crosby on 10/19/07. 6 | // Copyright 2007 Kaboomerang LLC. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import "OAPlaintextSignatureProvider.h" 28 | #import "NSString+URLEncoding.h" 29 | 30 | 31 | @implementation OAPlaintextSignatureProvider 32 | 33 | - (NSString *)name 34 | { 35 | return @"PLAINTEXT"; 36 | } 37 | 38 | - (NSString *)signClearText:(NSString *)text withSecret:(NSString *)secret 39 | { 40 | return secret; 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/OARequestParameter.h: -------------------------------------------------------------------------------- 1 | // 2 | // OARequestParameter.h 3 | // OAuthConsumer 4 | // 5 | // Created by Jon Crosby on 10/19/07. 6 | // Copyright 2007 Kaboomerang LLC. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import 28 | #import "NSString+URLEncoding.h" 29 | 30 | 31 | @interface OARequestParameter : NSObject { 32 | @protected 33 | NSString *name; 34 | NSString *value; 35 | } 36 | @property(retain) NSString *name; 37 | @property(retain) NSString *value; 38 | 39 | + (id)requestParameterWithName:(NSString *)aName value:(NSString *)aValue; 40 | - (id)initWithName:(NSString *)aName value:(NSString *)aValue; 41 | - (NSString *)URLEncodedName; 42 | - (NSString *)URLEncodedValue; 43 | - (NSString *)URLEncodedNameValuePair; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/OARequestParameter.m: -------------------------------------------------------------------------------- 1 | // 2 | // OARequestParameter.m 3 | // OAuthConsumer 4 | // 5 | // Created by Jon Crosby on 10/19/07. 6 | // Copyright 2007 Kaboomerang LLC. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import "OARequestParameter.h" 28 | 29 | 30 | @implementation OARequestParameter 31 | @synthesize name, value; 32 | 33 | + (id)requestParameterWithName:(NSString *)aName value:(NSString *)aValue 34 | { 35 | return [[[OARequestParameter alloc] initWithName:aName value:aValue] autorelease]; 36 | } 37 | 38 | - (id)initWithName:(NSString *)aName value:(NSString *)aValue 39 | { 40 | if (self = [super init]) 41 | { 42 | self.name = aName; 43 | self.value = aValue; 44 | } 45 | return self; 46 | } 47 | 48 | - (void)dealloc 49 | { 50 | [name release]; 51 | [value release]; 52 | [super dealloc]; 53 | } 54 | 55 | - (NSString *)URLEncodedName 56 | { 57 | return [self.name URLEncodedString]; 58 | } 59 | 60 | - (NSString *)URLEncodedValue 61 | { 62 | return [self.value URLEncodedString]; 63 | } 64 | 65 | - (NSString *)URLEncodedNameValuePair 66 | { 67 | return [NSString stringWithFormat:@"%@=%@", [self URLEncodedName], [self URLEncodedValue]]; 68 | } 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/OAServiceTicket.h: -------------------------------------------------------------------------------- 1 | // 2 | // OAServiceTicket.h 3 | // OAuthConsumer 4 | // 5 | // Created by Jon Crosby on 11/5/07. 6 | // Copyright 2007 Kaboomerang LLC. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import 28 | #import "OAMutableURLRequest.h" 29 | 30 | 31 | @interface OAServiceTicket : NSObject { 32 | @private 33 | OAMutableURLRequest *request; 34 | NSHTTPURLResponse *response; 35 | NSData *data; 36 | BOOL didSucceed; 37 | } 38 | @property(readonly) OAMutableURLRequest *request; 39 | @property(readonly) NSHTTPURLResponse *response; 40 | @property(readonly) NSData *data; 41 | @property(readonly) BOOL didSucceed; 42 | @property(readonly) NSString *body; 43 | 44 | - (id)initWithRequest:(OAMutableURLRequest *)aRequest response:(NSHTTPURLResponse *)aResponse didSucceed:(BOOL)success; 45 | - (id)initWithRequest:(OAMutableURLRequest *)aRequest response:(NSHTTPURLResponse *)aResponse data:(NSData *)aData didSucceed:(BOOL)success; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/OAServiceTicket.m: -------------------------------------------------------------------------------- 1 | // 2 | // OAServiceTicket.m 3 | // OAuthConsumer 4 | // 5 | // Created by Jon Crosby on 11/5/07. 6 | // Copyright 2007 Kaboomerang LLC. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | 27 | #import "OAServiceTicket.h" 28 | 29 | 30 | @implementation OAServiceTicket 31 | @synthesize request, response, data, didSucceed; 32 | 33 | - (id)initWithRequest:(OAMutableURLRequest *)aRequest response:(NSHTTPURLResponse *)aResponse didSucceed:(BOOL)success 34 | { 35 | return [self initWithRequest:aRequest response:aResponse data:nil didSucceed:success]; 36 | } 37 | 38 | - (id)initWithRequest:(OAMutableURLRequest *)aRequest response:(NSHTTPURLResponse *)aResponse data:(NSData *)aData didSucceed:(BOOL)success { 39 | [super init]; 40 | request = aRequest; 41 | response = aResponse; 42 | data = aData; 43 | didSucceed = success; 44 | return self; 45 | } 46 | 47 | - (NSString *)body 48 | { 49 | if (!data) { 50 | return nil; 51 | } 52 | 53 | return [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]; 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/OASignatureProviding.h: -------------------------------------------------------------------------------- 1 | // 2 | // OASignatureProviding.h 3 | // 4 | // Created by Jon Crosby on 10/19/07. 5 | // Copyright 2007 Kaboomerang LLC. All rights reserved. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | 26 | #import 27 | 28 | 29 | @protocol OASignatureProviding 30 | 31 | - (NSString *)name; 32 | - (NSString *)signClearText:(NSString *)text withSecret:(NSString *)secret; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/OAToken.h: -------------------------------------------------------------------------------- 1 | // 2 | // OAToken.h 3 | // OAuthConsumer 4 | // 5 | // Created by Jon Crosby on 10/19/07. 6 | // Copyright 2007 Kaboomerang LLC. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | 28 | @interface OAToken : NSObject { 29 | @protected 30 | NSString *key; 31 | NSString *secret; 32 | NSString *sessionHandle; 33 | } 34 | @property(retain) NSString *key; 35 | @property(retain) NSString *secret; 36 | @property(retain) NSString *sessionHandle; 37 | 38 | - (id)initWithKey:(NSString *)aKey secret:(NSString *)aSecret; 39 | - (id)initWithUserDefaultsUsingServiceProviderName:(NSString *)provider prefix:(NSString *)prefix; 40 | - (id)initWithHTTPResponseBody:(NSString *)body; 41 | - (int)storeInUserDefaultsWithServiceProviderName:(NSString *)provider prefix:(NSString *)prefix; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/OAuth/OAuthConsumer.h: -------------------------------------------------------------------------------- 1 | // 2 | // OAuthConsumer.h 3 | // OAuthConsumer 4 | // 5 | // Created by Jon Crosby on 10/19/07. 6 | // Copyright 2007 Kaboomerang LLC. All rights reserved. 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | 26 | #import 27 | #import "OAToken.h" 28 | #import "OAConsumer.h" 29 | #import "OAMutableURLRequest.h" 30 | #import "NSString+URLEncoding.h" 31 | #import "NSMutableURLRequest+Parameters.h" 32 | #import "NSURL+Base.h" 33 | #import "OASignatureProviding.h" 34 | #import "OAHMAC_SHA1SignatureProvider.h" 35 | #import "OAPlaintextSignatureProvider.h" 36 | #import "OARequestParameter.h" 37 | #import "OAServiceTicket.h" 38 | #import "OADataFetcher.h" 39 | #import "OAAsynchronousDataFetcher.h" -------------------------------------------------------------------------------- /Classes/ShareKit/Core/Helpers/SHKRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKRequest.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/9/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | 30 | 31 | @interface SHKRequest : NSObject 32 | { 33 | NSURL *url; 34 | NSString *params; 35 | NSString *method; 36 | NSDictionary *headerFields; 37 | 38 | id delegate; 39 | SEL isFinishedSelector; 40 | 41 | NSURLConnection *connection; 42 | 43 | NSHTTPURLResponse *response; 44 | NSDictionary *headers; 45 | 46 | NSMutableData *data; 47 | NSString *result; 48 | BOOL success; 49 | } 50 | 51 | @property (retain) NSURL *url; 52 | @property (retain) NSString *params; 53 | @property (retain) NSString *method; 54 | @property (retain) NSDictionary *headerFields; 55 | 56 | @property (assign) id delegate; 57 | @property (assign) SEL isFinishedSelector; 58 | 59 | @property (retain) NSURLConnection *connection; 60 | 61 | @property (retain) NSHTTPURLResponse *response; 62 | @property (retain) NSDictionary *headers; 63 | 64 | @property (retain) NSMutableData *data; 65 | @property (nonatomic, retain, getter=getResult) NSString *result; 66 | @property (nonatomic) BOOL success; 67 | 68 | - (id)initWithURL:(NSURL *)u params:(NSString *)p delegate:(id)d isFinishedSelector:(SEL)s method:(NSString *)m autostart:(BOOL)autostart; 69 | 70 | - (void)start; 71 | - (void)finish; 72 | 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/SHKItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKItem.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/18/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | 30 | typedef enum 31 | { 32 | SHKShareTypeUndefined, 33 | SHKShareTypeURL, 34 | SHKShareTypeText, 35 | SHKShareTypeImage, 36 | SHKShareTypeFile 37 | } SHKShareType; 38 | 39 | 40 | @interface SHKItem : NSObject 41 | { 42 | SHKShareType shareType; 43 | 44 | NSURL *URL; 45 | 46 | UIImage *image; 47 | 48 | NSString *title; 49 | NSString *text; 50 | NSString *tags; 51 | 52 | NSData *data; 53 | NSString *mimeType; 54 | NSString *filename; 55 | 56 | @private 57 | NSMutableDictionary *custom; 58 | } 59 | 60 | @property (nonatomic) SHKShareType shareType; 61 | 62 | @property (nonatomic, retain) NSURL *URL; 63 | 64 | @property (nonatomic, retain) UIImage *image; 65 | 66 | @property (nonatomic, retain) NSString *title; 67 | @property (nonatomic, retain) NSString *text; 68 | @property (nonatomic, retain) NSString *tags; 69 | 70 | @property (nonatomic, retain) NSData *data; 71 | @property (nonatomic, retain) NSString *mimeType; 72 | @property (nonatomic, retain) NSString *filename; 73 | 74 | + (SHKItem *)URL:(NSURL *)url title:(NSString *)title; 75 | + (SHKItem *)image:(UIImage *)image title:(NSString *)title; 76 | + (SHKItem *)text:(NSString *)text; 77 | + (SHKItem *)file:(NSData *)data filename:(NSString *)filename mimeType:(NSString *)mimeType title:(NSString *)title; 78 | 79 | - (void)setCustomValue:(NSString *)value forKey:(NSString *)key; 80 | - (NSString *)customValueForKey:(NSString *)key; 81 | - (BOOL)customBoolForSwitchKey:(NSString *)key; 82 | 83 | - (NSDictionary *)dictionaryRepresentation; 84 | + (SHKItem *)itemFromDictionary:(NSDictionary *)dictionary; 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/SHKOfflineSharer.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKOfflineSharer.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/22/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | #import "SHK.h" 30 | #import "SHKSharer.h" 31 | 32 | @interface SHKOfflineSharer : NSOperation 33 | { 34 | SHKItem *item; 35 | NSString *sharerId; 36 | NSString *uid; 37 | BOOL readyToFinish; 38 | NSThread *runLoopThread; 39 | SHKSharer *sharer; 40 | } 41 | 42 | @property (nonatomic, retain) SHKItem *item; 43 | @property (nonatomic, retain) NSString *sharerId; 44 | @property (nonatomic, retain) NSString *uid; 45 | @property BOOL readyToFinish; 46 | @property (nonatomic, retain) NSThread *runLoopThread; 47 | @property (nonatomic, retain) SHKSharer *sharer; 48 | 49 | - (id)initWithItem:(SHKItem *)i forSharer:(NSString *)s uid:(NSString *)u; 50 | 51 | - (void)share; 52 | - (BOOL)shouldRun; 53 | - (void)finish; 54 | - (void)lastSpin; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Classes/ShareKit/Core/SHKSharers.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | actions 6 | 7 | SHKPhotoAlbum 8 | SHKCopy 9 | SHKMail 10 | SHKSafari 11 | SHKTextMessage 12 | 13 | services 14 | 15 | SHKEvernote 16 | SHKTwitter 17 | SHKPinboard 18 | SHKDelicious 19 | SHKGoogleReader 20 | SHKFacebook 21 | SHKReadItLater 22 | SHKInstapaper 23 | SHKTumblr 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Classes/ShareKit/Customize UI/SHKCustomFormController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKCustomFormController.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/28/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | #import "SHKFormController.h" 30 | 31 | @interface SHKCustomFormController : SHKFormController { 32 | 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Classes/ShareKit/Customize UI/SHKCustomFormController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SHKCustomFormController.m 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/28/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import "SHKCustomFormController.h" 29 | 30 | 31 | @implementation SHKCustomFormController 32 | 33 | // See http://getsharekit.com/customize/ for additional information on customizing 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Classes/ShareKit/Customize UI/SHKCustomFormFieldCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKCustomFormFieldCell.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/28/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | #import "SHKFormFieldCell.h" 30 | 31 | @interface SHKCustomFormFieldCell : SHKFormFieldCell 32 | { 33 | 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Classes/ShareKit/Customize UI/SHKCustomFormFieldCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // SHKCustomFormFieldCell.m 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/28/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import "SHKCustomFormFieldCell.h" 29 | 30 | 31 | @implementation SHKCustomFormFieldCell 32 | 33 | // See http://getsharekit.com/customize/ for additional information on customizing 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Classes/ShareKit/Customize UI/SHKCustomShareMenu.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKCustomShareMenu.h 3 | // RIL 4 | // 5 | // Created by Nathan Weiner on 6/30/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | #import "SHKShareMenu.h" 30 | 31 | 32 | 33 | @interface SHKCustomShareMenu : SHKShareMenu 34 | { 35 | // See http://getsharekit.com/customize/ for additional information on customizing 36 | } 37 | 38 | 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Classes/ShareKit/Customize UI/SHKCustomShareMenu.m: -------------------------------------------------------------------------------- 1 | // 2 | // SHKCustomShareMenu.m 3 | // RIL 4 | // 5 | // Created by Nathan Weiner on 6/30/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import "SHKCustomShareMenu.h" 29 | 30 | @implementation SHKCustomShareMenu 31 | 32 | 33 | // See http://getsharekit.com/customize/ for additional information on customizing 34 | 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Classes/ShareKit/Customize UI/SHKCustomShareMenuCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKTableViewCell.h 3 | // RIL 4 | // 5 | // Created by Nathan Weiner on 6/30/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | 30 | 31 | /* 32 | Two ways to customize: 33 | 34 | 1. If you already have a custom UITableViewCell subclass you are using in your app, 35 | simply replace UITableViewCell with your own class. 36 | 37 | 2. Add any customizations by subclassing this (SHKTableViewCell) 38 | */ 39 | 40 | @interface SHKCustomShareMenuCell : UITableViewCell 41 | { 42 | // See http://getsharekit.com/customize/ for additional information on customizing 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Classes/ShareKit/Customize UI/SHKCustomShareMenuCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // SHKTableViewCell.m 3 | // RIL 4 | // 5 | // Created by Nathan Weiner on 6/30/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import "SHKCustomShareMenuCell.h" 29 | 30 | 31 | @implementation SHKCustomShareMenuCell 32 | 33 | // See http://getsharekit.com/customize/ for additional information on customizing 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Classes/ShareKit/Localization/ja.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "Email" = "メール"; 2 | "Username" = "ユーザー名"; 3 | "Password" = "パスワード"; 4 | "Follow %@" = "@%@をフォローする"; 5 | "Continue" = "続ける"; 6 | "Share" = "共有"; 7 | "More..." = "その他"; 8 | "Cancel" = "キャンセル"; 9 | "Slug" = "Slug"; 10 | "Private" = "プライベート"; 11 | "Public" = "パブリック"; 12 | "Caption" = "キャプション"; 13 | "Title" = "タイトル"; 14 | "Tags" = "タグ"; 15 | "Close" = "閉じる"; 16 | "Notes" = "ノート"; 17 | "Note" = "ノート"; 18 | "Share" = "共有"; 19 | "Shared" = "共有"; 20 | "Edit" = "編集"; 21 | "Actions" = "アクション"; 22 | "Services" = "サービス"; 23 | "Send to %@" = "%@に送る"; 24 | "Copy" = "コピー"; 25 | "Copied!" = "コピーしました!"; 26 | "Saving to %@" = "%@に保存中"; 27 | "Saved!" = "保存しました!"; 28 | "Offline" = "オフライン"; 29 | "Error" = "エラー"; 30 | "Login" = "ログイン"; 31 | "Logging In..." = "ログイン中"; 32 | "Login Error" = "ログイン失敗"; 33 | "Connecting..." = "接続中"; 34 | 35 | "Shortening URL..." = "URLを短縮中"; 36 | "Shorten URL Error" = "URLの短縮に失敗しました"; 37 | "We could not shorten the URL." = "URLを短縮できませんでした"; 38 | 39 | "Create a free account at %@" = "%@で無料の新規アカウントを作成"; 40 | "Create an account at %@" = "%@で新規アカウントを作成"; 41 | 42 | "Send to Twitter" = "ツイッターでつぶやく"; 43 | 44 | "Message is too long" = "メッセージが長すぎます"; 45 | "Twitter posts can only be 140 characters in length." = "ツイッターは140文字までしか送れません"; 46 | "Message is empty" = "メッセージが入力されていません"; 47 | "You must enter a message in order to post." = "投稿するためにはメッセージを入力する必要があります"; 48 | 49 | "Enter your message:" = "メッセージを入力:"; 50 | 51 | "Invalid email or password." = "メールアドレスかパスワードが間違えています"; 52 | "The service encountered an error. Please try again later." = "只今サービスが利用できません。しばらくして再試行してください"; 53 | "There was a sending your post to Tumblr." = "Tumblrに未送信の投稿があります"; 54 | 55 | "There was an error saving to Pinboard" = "Pinboardの保存にエラーが起きました"; 56 | 57 | "Sorry, Instapaper did not accept your credentials. Please try again." = "Instapaperが認証情報を受理できませんでした。再試行してください"; 58 | "Sorry, Instapaper encountered an error. Please try again." = "Instapaperエラーが発生しました。再試行してください"; 59 | "There was a problem saving to Instapaper." = "Instapaperに保存中にエラーが発生しました。"; 60 | 61 | "Incorrect username and password" = "ユーザー名かパスワードが間違えています"; 62 | "There was an error logging into Google Reader" = "Googleリーダーにログイン失敗しました"; 63 | "There was a problem authenticating your account." = "ユーザー認証に問題が発生しました"; 64 | "There was a problem saving your note." = "ノートを保存中に問題が発生しました"; 65 | 66 | "There was a problem saving to Delicious." = "TDeliciousに保存中に問題が発生しました"; 67 | 68 | "Open in Safari" = "Safariで開く"; 69 | "Attached: %@" = "添付済: %@"; 70 | 71 | "You must be online to login to %@" = "%@にログインするにはオンラインである必要があります"; 72 | 73 | "Auto Share" = "自動共有"; 74 | "Enable auto share to skip this step in the future." = "今後、この手順をスキップして、自動的に共有する"; 75 | 76 | "You must be online in order to share with %@" = "%@に共有するためにはオンラインである必要があります"; 77 | "There was an error while sharing" = "共有にエラーが発生しました"; 78 | 79 | "Could not authenticate you. Please relogin." = "認証できませんでした。再度ログインしてください。"; 80 | "There was a problem requesting authorization from %@" = "%@への認証要求に問題が発生しました"; 81 | "Request Error" = "通信エラー"; 82 | "There was an error while sharing" = "共有にエラーが発生しました"; 83 | 84 | "Authorize Error" = "認証エラー"; 85 | "There was an error while authorizing" = "認証にエラーが発生しました"; 86 | 87 | "Authenticating..." = "認証中..."; 88 | "There was a problem requesting access from %@" = "%@へのアクセスに問題が発生しました"; 89 | 90 | "Access Error" = "アクセスエラー"; 91 | "There was an error while sharing" = "共有にエラーが発生しました"; -------------------------------------------------------------------------------- /Classes/ShareKit/Localization/ko.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "Email" = "Email"; 2 | "Username" = "아이디"; 3 | "Password" = "비밀번호"; 4 | "Follow %@" = "Follow %@"; 5 | "Continue" = "계속"; 6 | "Share" = "공유"; 7 | "More..." = "기타..."; 8 | "Cancel" = "취소"; 9 | "Slug" = "Slug"; 10 | "Private" = "비공개"; 11 | "Public" = "공개"; 12 | "Caption" = "캡션"; 13 | "Title" = "제목"; 14 | "Tags" = "태그"; 15 | "Close" = "닫기"; 16 | "Notes" = "메모"; 17 | "Note" = "메모"; 18 | "Share" = "공유"; 19 | "Shared" = "공유"; 20 | "Edit" = "편집"; 21 | "Actions" = "Actions"; 22 | "Services" = "Services"; 23 | "Send to %@" = "%@로 보내기"; 24 | "Copy" = "복사"; 25 | "Copied!" = "복사 됨!"; 26 | "Saving to %@" = "%@에 저장 중"; 27 | "Saved!" = "저장 됨!"; 28 | "Offline" = "오프라인"; 29 | "Error" = "오류"; 30 | "Login" = "로그인"; 31 | "Logging In..." = "로그인 중..."; 32 | "Login Error" = "로그인 오류"; 33 | "Connecting..." = "접속 중..."; 34 | 35 | "Shortening URL..." = "URL 줄이는 중..."; 36 | "Shorten URL Error" = "단축 URL 오류"; 37 | "We could not shorten the URL." = "URL을 줄이지 못했습니다."; 38 | 39 | "Create a free account at %@" = "%@ 무료 계정 만들기"; 40 | "Create an account at %@" = "%@ 계정 만들기"; 41 | 42 | "Send to Twitter" = "Twitter로 보내기"; 43 | 44 | "Message is too long" = "메시지가 너무 깁니다"; 45 | "Twitter posts can only be 140 characters in length." = "Twitter 메시지는 140자를 넘을 수 없습니다."; 46 | "Message is empty" = "보낼 메시지가 없습니다"; 47 | "You must enter a message in order to post." = "보낼 메시지를 입력하세요."; 48 | 49 | "Enter your message:" = "메시지 입력:"; 50 | 51 | "Invalid email or password." = "잘못된 email이나 비밀번호."; 52 | "The service encountered an error. Please try again later." = "서비스에 오류가 발생했습니다. 나중에 다시 시도해 주세요."; 53 | "There was a sending your post to Tumblr." = "There was a sending your post to Tumblr."; 54 | 55 | "There was an error saving to Pinboard" = "Pinboard로 저장 중에 오류가 발생했습니다"; 56 | 57 | "Sorry, Instapaper did not accept your credentials. Please try again." = "Instapaper 인증에 실패했습니다. 다시 시도해 주세요."; 58 | "Sorry, Instapaper encountered an error. Please try again." = "Instapaper 오류가 발생했습니다. 다시 시도해 주세요."; 59 | "There was a problem saving to Instapaper." = "Instapaper로 저장 중에 문제가 발생했습니다."; 60 | 61 | "Incorrect username and password" = "잘못된 아이디나 비밀번호"; 62 | "There was an error logging into Google Reader" = "Google Reader 로그인 중 오류가 발생했습니다"; 63 | "There was a problem authenticating your account." = "게정 인증에 실패했습니다."; 64 | "There was a problem saving your note." = "메모 저장에 실패했습니다."; 65 | 66 | "There was a problem saving to Delicious." = "Delicious로 저장 중에 문제가 발생했습니다."; 67 | 68 | "Open in Safari" = "Safari로 열기"; 69 | "Attached: %@" = "첨부: %@"; 70 | 71 | "You must be online to login to %@" = "%@에 로그인 하려면 온라인 상태여야 합니다"; 72 | 73 | "Auto Share" = "자동 공유"; 74 | "Enable auto share to skip this step in the future." = "나중에 이 단계를 건너뛰려면 자동 공유를 활성화하세요."; 75 | 76 | "You must be online in order to share with %@" = "%@(으)로 공유하려면 온라인 상태여야 합니다"; 77 | "There was an error while sharing" = "공유 중에 오류가 발생했습니다"; 78 | 79 | "Could not authenticate you. Please relogin." = "인증할 수 없습니다. 다시 로그인 하세요."; 80 | "There was a problem requesting authorization from %@" = "%@ 인증 요청에 문제가 발생했습니다"; 81 | "Request Error" = "요청 오류"; 82 | "There was an error while sharing" = "공유 중에 오류가 발생했습니다"; 83 | 84 | "Authorize Error" = "인증 오류"; 85 | "There was an error while authorizing" = "인증 중에 오류가 발생했습니다"; 86 | 87 | "Authenticating..." = "인증 중..."; 88 | "There was a problem requesting access from %@" = "%@ 접근 권한을 얻는데 실패했습니다"; 89 | 90 | "Access Error" = "접근 오류"; 91 | "There was an error while sharing" = "공유 중에 오류가 발생했습니다"; -------------------------------------------------------------------------------- /Classes/ShareKit/Localization/vi.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ideashower/ShareKit/9139332ef1ab10128697487185c106d81215df6a/Classes/ShareKit/Localization/vi.lproj/Localizable.strings -------------------------------------------------------------------------------- /Classes/ShareKit/Localization/zh_CN.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "Email" = "电子邮件"; 2 | "Username" = "用户名"; 3 | "Password" = "密码"; 4 | "Follow %@" = "关注%@"; 5 | "Continue" = "继续"; 6 | "Share" = "分享"; 7 | "More..." = "更多…"; 8 | "Cancel" = "取消"; 9 | "Slug" = "Slug"; 10 | "Private" = "私有"; 11 | "Public" = "公开"; 12 | "Caption" = "标题"; 13 | "Title" = "标题"; 14 | "Tags" = "标签"; 15 | "Close" = "关闭"; 16 | "Notes" = "笔记"; 17 | "Note" = "笔记"; 18 | "Share" = "分享"; 19 | "Shared" = "已分享"; 20 | "Edit" = "编辑"; 21 | "Actions" = "动作"; 22 | "Services" = "服务"; 23 | "Send to %@" = "发送到 %@"; 24 | "Copy" = "复制"; 25 | "Copied!" = "已复制!"; 26 | "Saving to %@" = "保存至%@"; 27 | "Saved!" = "已保存!"; 28 | "Offline" = "离线"; 29 | "Error" = "错误"; 30 | "Login" = "登录"; 31 | "Logging In..." = "登录中…"; 32 | "Login Error" = "登录出错"; 33 | "Connecting..." = "连接中…"; 34 | 35 | 36 | "Shortening URL..." = "缩短网址…"; 37 | "Shorten URL Error" = "缩短网址出错"; 38 | "We could not shorten the URL." = "我们无法缩短网址。"; 39 | 40 | "Create a free account at %@" = "在 %@ 上创建一个免费账户"; 41 | "Create an account at %@" = "在 %@ 上创建一个账户"; 42 | 43 | "Send to Twitter" = "发送到 Twitter"; 44 | 45 | "Message is too long" = "消息太长了"; 46 | "Twitter posts can only be 140 characters in length." = "Twitter 消息不能超过 140 个字符。"; 47 | "Message is empty" = "消息为空"; 48 | "You must enter a message in order to post." = "你必须先输入一条消息。"; 49 | 50 | "Enter your message:" = "输入你的消息:"; 51 | 52 | "Invalid email or password." = "Email 或密码不正确。"; 53 | "The service encountered an error. Please try again later." = "此服务碰到了一点错误,请稍后重试。"; 54 | "There was an error sending your post to Tumblr." = "发送至 Tumblr 的过程中出错。"; 55 | 56 | "There was an error saving to Pinboard" = "保存到 Pinboard 的过程中出错"; 57 | 58 | "Sorry, Instapaper did not accept your credentials. Please try again." = "抱歉,Instapaper 无法验证您的账号,请重试。"; 59 | "Sorry, Instapaper encountered an error. Please try again." = "抱歉,Instapaper 碰到了一个问题,请重试。"; 60 | "There was a problem saving to Instapaper." = "保存到 Instapaper 的过程中出错。"; 61 | 62 | "Incorrect username and password" = "用户名或密码不正确"; 63 | "There was an error logging into Google Reader" = "登录到 Google Reader 的过程中出错"; 64 | "There was a problem authenticating your account." = "验证您账户的过程中出错。"; 65 | "There was a problem saving your note." = "保存您笔记的过程中出错。"; 66 | 67 | "There was a problem saving to Delicious." = "保存到 Delicious 的过程中出错。"; 68 | 69 | "Open in Safari" = "在 Safari 中打开"; 70 | "Attached: %@" = "附件: %@"; 71 | 72 | "You must be online to login to %@" = "要登录到 %@ 上您必须在线"; 73 | 74 | "Auto Share" = "自动分享"; 75 | "Enable auto share to skip this step in the future." = "启动自动分享,在以后可以跳过此步。"; 76 | 77 | "You must be online in order to share with %@" = "要分享 %@ 的话您必须在线。"; 78 | "There was an error while sharing" = "分享过程中出错"; 79 | 80 | "Could not authenticate you. Please relogin." = "无法验证,请重新登录。"; 81 | "There was a problem requesting authorization from %@" = "在向 %@ 请求验证的过程中出错"; 82 | "Request Error" = "请求错误"; 83 | "There was an error while sharing" = "分享过程中出错"; 84 | 85 | "Authorize Error" = "验证错误"; 86 | "There was an error while authorizing" = "验证的过程中出错"; 87 | 88 | "Authenticating..." = "验证中…"; 89 | "There was a problem requesting access from %@" = "从 %@ 获取口令出错"; 90 | 91 | "Access Error" = "访问错误"; 92 | "There was an error while sharing" = "在分享的过程中出错"; 93 | 94 | "Save to Photo Album" = "保存到相簿"; -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Actions/Copy/SHKCopy.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKCopy.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/20/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | #import "SHKSharer.h" 30 | 31 | @interface SHKCopy : SHKSharer 32 | { 33 | 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Actions/Copy/SHKCopy.m: -------------------------------------------------------------------------------- 1 | // 2 | // SHKCopy.m 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/20/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import "SHKCopy.h" 29 | 30 | 31 | @implementation SHKCopy 32 | 33 | #pragma mark - 34 | #pragma mark Configuration : Service Defination 35 | 36 | + (NSString *)sharerTitle 37 | { 38 | return SHKLocalizedString(@"Copy"); 39 | } 40 | 41 | + (BOOL)canShareURL 42 | { 43 | return YES; 44 | } 45 | 46 | + (BOOL)canShareImage 47 | { 48 | return YES; 49 | } 50 | 51 | + (BOOL)shareRequiresInternetConnection 52 | { 53 | return NO; 54 | } 55 | 56 | + (BOOL)requiresAuthentication 57 | { 58 | return NO; 59 | } 60 | 61 | 62 | #pragma mark - 63 | #pragma mark Configuration : Dynamic Enable 64 | 65 | - (BOOL)shouldAutoShare 66 | { 67 | return YES; 68 | } 69 | 70 | 71 | #pragma mark - 72 | #pragma mark Share API Methods 73 | 74 | - (BOOL)send 75 | { 76 | if (item.shareType == SHKShareTypeURL) 77 | [[UIPasteboard generalPasteboard] setString:item.URL.absoluteString]; 78 | 79 | else 80 | [[UIPasteboard generalPasteboard] setImage:item.image]; 81 | 82 | // Notify user 83 | [[SHKActivityIndicator currentIndicator] displayCompleted:SHKLocalizedString(@"Copied!")]; 84 | 85 | // Notify delegate, but quietly 86 | self.quiet = YES; 87 | [self sendDidFinish]; 88 | 89 | return YES; 90 | } 91 | 92 | @end 93 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Actions/Email/SHKMail.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKMail.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/17/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | #import "SHKSharer.h" 30 | #import 31 | 32 | 33 | @interface MFMailComposeViewController (SHK) 34 | - (void)SHKviewDidDisappear:(BOOL)animated; 35 | @end 36 | 37 | 38 | @interface SHKMail : SHKSharer 39 | { 40 | 41 | } 42 | 43 | - (BOOL)sendMail; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Actions/Open in Safari/SHKSafari.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKSafari.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/20/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | #import "SHKSharer.h" 30 | 31 | @interface SHKSafari : SHKSharer 32 | { 33 | 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Actions/Open in Safari/SHKSafari.m: -------------------------------------------------------------------------------- 1 | // 2 | // SHKSafari.m 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/20/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import "SHKSafari.h" 29 | 30 | 31 | @implementation SHKSafari 32 | 33 | 34 | 35 | #pragma mark - 36 | #pragma mark Configuration : Service Defination 37 | 38 | + (NSString *)sharerTitle 39 | { 40 | return SHKLocalizedString(@"Open in Safari"); 41 | } 42 | 43 | + (BOOL)canShareURL 44 | { 45 | return YES; 46 | } 47 | 48 | + (BOOL)shareRequiresInternetConnection 49 | { 50 | return NO; 51 | } 52 | 53 | + (BOOL)requiresAuthentication 54 | { 55 | return NO; 56 | } 57 | 58 | 59 | 60 | #pragma mark - 61 | #pragma mark Configuration : Dynamic Enable 62 | 63 | - (BOOL)shouldAutoShare 64 | { 65 | return YES; 66 | } 67 | 68 | 69 | #pragma mark - 70 | #pragma mark Share API Methods 71 | 72 | - (BOOL)send 73 | { 74 | self.quiet = YES; 75 | 76 | [[UIApplication sharedApplication] openURL:item.URL]; 77 | 78 | [self sendDidFinish]; 79 | 80 | return YES; 81 | } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Actions/Save to Album/SHKPhotoAlbum.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKPhotoAlbum.h 3 | // ShareKit 4 | // 5 | // Created by Richard Johnson on 7/22/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | #import "SHKSharer.h" 30 | 31 | @interface SHKPhotoAlbum : SHKSharer 32 | { 33 | 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Actions/Save to Album/SHKPhotoAlbum.m: -------------------------------------------------------------------------------- 1 | // 2 | // SHKPhotoAlbum.m 3 | // ShareKit 4 | // 5 | // Created by Richard Johnson on 7/22/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import "SHKPhotoAlbum.h" 29 | 30 | 31 | @implementation SHKPhotoAlbum 32 | 33 | #pragma mark - 34 | #pragma mark Configuration : Service Definition 35 | 36 | + (NSString *)sharerTitle 37 | { 38 | return SHKLocalizedString(@"Save to Photo Album"); 39 | } 40 | 41 | + (BOOL)canShareImage 42 | { 43 | return YES; 44 | } 45 | 46 | + (BOOL)shareRequiresInternetConnection 47 | { 48 | return NO; 49 | } 50 | 51 | + (BOOL)requiresAuthentication 52 | { 53 | return NO; 54 | } 55 | 56 | 57 | #pragma mark - 58 | #pragma mark Configuration : Dynamic Enable 59 | 60 | - (BOOL)shouldAutoShare 61 | { 62 | return YES; 63 | } 64 | 65 | 66 | #pragma mark - 67 | #pragma mark Share API Methods 68 | 69 | - (BOOL)send 70 | { 71 | if (item.shareType == SHKShareTypeImage) 72 | UIImageWriteToSavedPhotosAlbum(item.image, nil, nil, nil); 73 | 74 | // Notify user 75 | [[SHKActivityIndicator currentIndicator] displayCompleted:SHKLocalizedString(@"Copied!")]; 76 | 77 | // Notify delegate, but quietly 78 | self.quiet = YES; 79 | [self sendDidFinish]; 80 | 81 | return YES; 82 | } 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Actions/Text Message/SHKTextMessage.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKTextMessage.h 3 | // ShareKit 4 | // 5 | // Created by Jeremy Lyman on 9/21/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | #import 30 | #import "SHKSharer.h" 31 | 32 | @interface SHKTextMessage : SHKSharer 33 | { 34 | 35 | } 36 | 37 | - (BOOL)sendText; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Delicious/SHKDelicious.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKDelicious.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/21/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | #import "SHKOAuthSharer.h" 30 | 31 | @interface SHKDelicious : SHKOAuthSharer 32 | { 33 | 34 | } 35 | 36 | - (BOOL)handleResponse:(SHKRequest *)aRequest; 37 | 38 | - (void)sendTicket:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data; 39 | - (void)sendTicket:(OAServiceTicket *)ticket didFailWithError:(NSError*)error; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TApplicationException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #import "TException.h" 21 | #import "TProtocol.h" 22 | 23 | enum { 24 | TApplicationException_UNKNOWN = 0, 25 | TApplicationException_UNKNOWN_METHOD = 1, 26 | TApplicationException_INVALID_MESSAGE_TYPE = 2, 27 | TApplicationException_WRONG_METHOD_NAME = 3, 28 | TApplicationException_BAD_SEQUENCE_ID = 4, 29 | TApplicationException_MISSING_RESULT = 5 30 | }; 31 | 32 | // FIXME 33 | @interface TApplicationException : TException { 34 | int mType; 35 | } 36 | 37 | + (TApplicationException *) read: (id ) protocol; 38 | 39 | - (void) write: (id ) protocol; 40 | 41 | + (TApplicationException *) exceptionWithType: (int) type 42 | reason: (NSString *) message; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #import 21 | 22 | @interface TException : NSException { 23 | } 24 | 25 | + (id) exceptionWithName: (NSString *) name; 26 | 27 | + (id) exceptionWithName: (NSString *) name 28 | reason: (NSString *) reason; 29 | 30 | + (id) exceptionWithName: (NSString *) name 31 | reason: (NSString *) reason 32 | error: (NSError *) error; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TException.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #import "TException.h" 21 | 22 | @implementation TException 23 | 24 | + (id) exceptionWithName: (NSString *) name 25 | { 26 | return [self exceptionWithName: name reason: @"unknown" error: nil]; 27 | } 28 | 29 | 30 | + (id) exceptionWithName: (NSString *) name 31 | reason: (NSString *) reason 32 | { 33 | return [self exceptionWithName: name reason: reason error: nil]; 34 | } 35 | 36 | 37 | + (id) exceptionWithName: (NSString *) name 38 | reason: (NSString *) reason 39 | error: (NSError *) error 40 | { 41 | NSDictionary * userInfo = nil; 42 | if (error != nil) { 43 | userInfo = [NSDictionary dictionaryWithObject: error forKey: @"error"]; 44 | } 45 | 46 | return [super exceptionWithName: name 47 | reason: reason 48 | userInfo: userInfo]; 49 | } 50 | 51 | 52 | - (NSString *) description 53 | { 54 | NSMutableString * result = [NSMutableString stringWithString: [self name]]; 55 | [result appendFormat: @": %@", [self reason]]; 56 | if ([self userInfo] != nil) { 57 | [result appendFormat: @"\n userInfo = %@", [self userInfo]]; 58 | } 59 | 60 | return result; 61 | } 62 | 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TProcessor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #import 21 | #import "TProtocol.h" 22 | 23 | 24 | @protocol TProcessor 25 | 26 | - (BOOL) processOnInputProtocol: (id ) inProtocol 27 | outputProtocol: (id ) outProtocol; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TProcessorFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #import 21 | #import "TProcessor.h" 22 | 23 | @protocol TProcessorFactory 24 | 25 | - (id) processorForTransport: (id) transport; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TSharedProcessorFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #import 21 | #import "TProcessorFactory.h" 22 | 23 | @interface TSharedProcessorFactory : NSObject { 24 | id mSharedProcessor; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TSharedProcessorFactory.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | 21 | #import "TSharedProcessorFactory.h" 22 | 23 | 24 | @implementation TSharedProcessorFactory 25 | 26 | 27 | - (id) initWithSharedProcessor: (id) sharedProcessor 28 | { 29 | self = [super init]; 30 | if (!self) { 31 | return nil; 32 | } 33 | 34 | mSharedProcessor = [sharedProcessor retain]; 35 | return self; 36 | } 37 | 38 | 39 | - (void) dealloc 40 | { 41 | [mSharedProcessor release]; 42 | [super dealloc]; 43 | } 44 | 45 | 46 | - (id) processorForTransport: (id) transport 47 | { 48 | return [[mSharedProcessor retain] autorelease]; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TBinaryProtocol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #import "TProtocol.h" 21 | #import "TTransport.h" 22 | #import "TProtocolFactory.h" 23 | 24 | 25 | @interface TBinaryProtocol : NSObject { 26 | id mTransport; 27 | BOOL mStrictRead; 28 | BOOL mStrictWrite; 29 | int32_t mMessageSizeLimit; 30 | } 31 | 32 | - (id) initWithTransport: (id ) transport; 33 | 34 | - (id) initWithTransport: (id ) transport 35 | strictRead: (BOOL) strictRead 36 | strictWrite: (BOOL) strictWrite; 37 | 38 | - (int32_t) messageSizeLimit; 39 | - (void) setMessageSizeLimit: (int32_t) sizeLimit; 40 | 41 | @end; 42 | 43 | 44 | @interface TBinaryProtocolFactory : NSObject { 45 | } 46 | 47 | + (TBinaryProtocolFactory *) sharedFactory; 48 | 49 | - (TBinaryProtocol *) newProtocolOnTransport: (id ) transport; 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocolException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #import "TException.h" 21 | 22 | @interface TProtocolException : TException { 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocolException.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #import "TProtocolException.h" 21 | 22 | @implementation TProtocolException 23 | @end 24 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocolFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #import 21 | #import "TProtocol.h" 22 | #import "TTransport.h" 23 | 24 | 25 | @protocol TProtocolFactory 26 | 27 | - (id ) newProtocolOnTransport: (id ) transport; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocolUtil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #import "TProtocol.h" 21 | #import "TTransport.h" 22 | 23 | @interface TProtocolUtil : NSObject { 24 | 25 | } 26 | 27 | + (void) skipType: (int) type onProtocol: (id ) protocol; 28 | 29 | @end; 30 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocolUtil.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #import "TProtocolUtil.h" 21 | 22 | @implementation TProtocolUtil 23 | 24 | + (void) skipType: (int) type onProtocol: (id ) protocol 25 | { 26 | switch (type) { 27 | case TType_BOOL: 28 | [protocol readBool]; 29 | break; 30 | case TType_BYTE: 31 | [protocol readByte]; 32 | break; 33 | case TType_I16: 34 | [protocol readI16]; 35 | break; 36 | case TType_I32: 37 | [protocol readI32]; 38 | break; 39 | case TType_I64: 40 | [protocol readI64]; 41 | break; 42 | case TType_DOUBLE: 43 | [protocol readDouble]; 44 | break; 45 | case TType_STRING: 46 | [protocol readString]; 47 | break; 48 | case TType_STRUCT: 49 | [protocol readStructBeginReturningName: NULL]; 50 | while (true) { 51 | int fieldType; 52 | [protocol readFieldBeginReturningName: nil type: &fieldType fieldID: nil]; 53 | if (fieldType == TType_STOP) { 54 | break; 55 | } 56 | [TProtocolUtil skipType: fieldType onProtocol: protocol]; 57 | [protocol readFieldEnd]; 58 | } 59 | [protocol readStructEnd]; 60 | break; 61 | case TType_MAP: 62 | { 63 | int keyType; 64 | int valueType; 65 | int size; 66 | [protocol readMapBeginReturningKeyType: &keyType valueType: &valueType size: &size]; 67 | int i; 68 | for (i = 0; i < size; i++) { 69 | [TProtocolUtil skipType: keyType onProtocol: protocol]; 70 | [TProtocolUtil skipType: valueType onProtocol: protocol]; 71 | } 72 | [protocol readMapEnd]; 73 | } 74 | break; 75 | case TType_SET: 76 | { 77 | int elemType; 78 | int size; 79 | [protocol readSetBeginReturningElementType: &elemType size: &size]; 80 | int i; 81 | for (i = 0; i < size; i++) { 82 | [TProtocolUtil skipType: elemType onProtocol: protocol]; 83 | } 84 | [protocol readSetEnd]; 85 | } 86 | break; 87 | case TType_LIST: 88 | { 89 | int elemType; 90 | int size; 91 | [protocol readListBeginReturningElementType: &elemType size: &size]; 92 | int i; 93 | for (i = 0; i < size; i++) { 94 | [TProtocolUtil skipType: elemType onProtocol: protocol]; 95 | } 96 | [protocol readListEnd]; 97 | } 98 | break; 99 | default: 100 | return; 101 | } 102 | } 103 | 104 | @end 105 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/THTTPClient.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #import 21 | #import "TTransport.h" 22 | 23 | @interface THTTPClient : NSObject { 24 | NSURL * mURL; 25 | NSMutableURLRequest * mRequest; 26 | NSMutableData * mRequestData; 27 | NSData * mResponseData; 28 | int mResponseDataOffset; 29 | NSString * mUserAgent; 30 | int mTimeout; 31 | } 32 | 33 | - (id) initWithURL: (NSURL *) aURL; 34 | 35 | - (id) initWithURL: (NSURL *) aURL 36 | userAgent: (NSString *) userAgent 37 | timeout: (int) timeout; 38 | 39 | - (void) setURL: (NSURL *) aURL; 40 | 41 | @end 42 | 43 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/TMemoryBuffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #import 21 | #import "TTransport.h" 22 | 23 | @interface TMemoryBuffer : NSObject { 24 | NSMutableData *mBuffer; 25 | NSUInteger mOffset; 26 | } 27 | - (id)initWithData:(NSData *)data; 28 | - (NSData *)getBuffer; 29 | @end 30 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/TMemoryBuffer.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #import "TMemoryBuffer.h" 21 | #import "TTransportException.h" 22 | 23 | #define GARBAGE_BUFFER_SIZE 4096 // 4KiB 24 | 25 | @implementation TMemoryBuffer 26 | - (id)init { 27 | if (self = [super init]) { 28 | mBuffer = [[NSMutableData alloc] init]; 29 | mOffset = 0; 30 | } 31 | return self; 32 | } 33 | 34 | - (id)initWithData:(NSData *)data { 35 | if (self = [super init]) { 36 | mBuffer = [data mutableCopy]; 37 | mOffset = 0; 38 | } 39 | return self; 40 | } 41 | 42 | - (int)readAll:(uint8_t *)buf offset:(int)off length:(int)len { 43 | if ([mBuffer length] - mOffset < len) { 44 | @throw [TTransportException exceptionWithReason:@"Not enough bytes remain in buffer"]; 45 | } 46 | [mBuffer getBytes:buf range:NSMakeRange(mOffset, len)]; 47 | mOffset += len; 48 | if (mOffset >= GARBAGE_BUFFER_SIZE) { 49 | [mBuffer replaceBytesInRange:NSMakeRange(0, mOffset) withBytes:NULL length:0]; 50 | mOffset = 0; 51 | } 52 | return len; 53 | } 54 | 55 | - (void)write:(const uint8_t *)data offset:(unsigned int)offset length:(unsigned int)length { 56 | [mBuffer appendBytes:data+offset length:length]; 57 | } 58 | 59 | - (void)flush { 60 | // noop 61 | } 62 | 63 | - (NSData *)getBuffer { 64 | return [[mBuffer copy] autorelease]; 65 | } 66 | 67 | - (void)dealloc { 68 | [mBuffer release]; 69 | [super dealloc]; 70 | } 71 | @end 72 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/TTransport.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | @protocol TTransport 21 | 22 | /** 23 | * Guarantees that all of len bytes are read 24 | * 25 | * @param buf Buffer to read into 26 | * @param off Index in buffer to start storing bytes at 27 | * @param len Maximum number of bytes to read 28 | * @return The number of bytes actually read, which must be equal to len 29 | * @throws TTransportException if there was an error reading data 30 | */ 31 | - (int) readAll: (uint8_t *) buf offset: (int) off length: (int) len; 32 | 33 | - (void) write: (const uint8_t *) data offset: (unsigned int) offset length: (unsigned int) length; 34 | 35 | - (void) flush; 36 | @end 37 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/TTransportException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #import "TException.h" 21 | 22 | @interface TTransportException : TException { 23 | } 24 | 25 | + (id) exceptionWithReason: (NSString *) reason 26 | error: (NSError *) error; 27 | 28 | + (id) exceptionWithReason: (NSString *) reason; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/TTransportException.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | #import "TTransportException.h" 21 | 22 | @implementation TTransportException 23 | 24 | + (id) exceptionWithReason: (NSString *) reason 25 | error: (NSError *) error 26 | { 27 | NSDictionary * userInfo = nil; 28 | if (error != nil) { 29 | userInfo = [NSDictionary dictionaryWithObject: error forKey: @"error"]; 30 | } 31 | 32 | return [super exceptionWithName: @"TTransportException" 33 | reason: reason 34 | userInfo: userInfo]; 35 | } 36 | 37 | 38 | + (id) exceptionWithReason: (NSString *) reason 39 | { 40 | return [self exceptionWithReason: reason error: nil]; 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Evernote/SHKEvernote.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKEvernote 3 | // ShareKit Evernote Additions 4 | // 5 | // Created by Atsushi Nagase on 8/28/10. 6 | // Copyright 2010 LittleApps Inc. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SHK.h" 11 | #import "SHKSharer.h" 12 | 13 | #import "Types.h" 14 | #import "UserStore.h" 15 | #import "NoteStore.h" 16 | 17 | #define kENMLPrefix @"" 18 | #define kENMLSuffix @"" 19 | 20 | @interface SHKEvernoteItem : SHKItem {} 21 | @property (retain) EDAMNote* note; 22 | @end 23 | 24 | 25 | @interface SHKEvernote : SHKSharer {} 26 | 27 | - (EDAMAuthenticationResult *)getAuthenticationResultForUsername:(NSString *)username password:(NSString *)password; 28 | - (EDAMNotebook *)defaultNoteBookFromNoteStore:(EDAMNoteStoreClient *)noteStore authToken:(NSString *)authToken; 29 | - (NSString *)enMediaTagWithResource:(EDAMResource *)src width:(CGFloat)width height:(CGFloat)height; 30 | 31 | @end 32 | 33 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Evernote/SHKEvernote.md: -------------------------------------------------------------------------------- 1 | # Using SHKEvernote 2 | 3 | SHKEvernote supports sharing links, images, text and files. 4 | In default: 5 | 6 | + Links and text will be sent as rich text format. 7 | + Images and files will be sent as attachments. 8 | 9 | Evernote's consumer and secret key are required. 10 | Request an API Key from [Evernote API Overview](http://www.evernote.com/about/developer/api/) page. 11 | 12 | When you received an API Key, define them to `SHKEvernoteConsumerKey` and `SHKEvernoteSecretKey` constants in `SHKConfig.h`. 13 | 14 | 15 | ## Sending custom EDAM content 16 | If you want to send custom EDAM content, use `SHKEvernoteItem` instead of `SHKItem`. 17 | 18 | This is a subclass of SHKItem, extended for support `(EDAMNote *)note` property. 19 | 20 | 21 | #import SHKEvernote.h 22 | 23 | ... 24 | 25 | NSString *noteTitle = @"My custom evernote."; 26 | 27 | EDAMNote *note = [[[EDAMNote alloc] init] autorelease]; 28 | 29 | // Note content as mutable string 30 | // kENMLPrefix and kENMLSuffix are defined in SHKEvernote.h 31 | NSMutableString *content = [NSMutableString stringWithString:kENMLPrefix]; 32 | // Resources to embed 33 | NSMutableArray *resources = [NSMutableArray array]; 34 | 35 | [content appendString:@"

Apple

"]; 36 | 37 | // Image to clip 38 | NSString *myImageURL = @"http://images.apple.com/iphone/home/images/route-facetime-20100923.png"; 39 | 40 | EDAMResource *imgResource = [[[EDAMResource alloc] init] autorelease]; 41 | EDAMResourceAttributes *imgAttr = [[[EDAMResourceAttributes alloc] init] autorelease]; 42 | 43 | // Automatically downloaded from the URL. 44 | imgAttr.sourceURL = myImageURL; 45 | imgResource.mime = @"image/jpeg"; 46 | 47 | imgResource.attributes = imgAttr; 48 | 49 | [resources addObject:imgResource]; 50 | // Plural embed images are supported, 51 | // but this makes slow sharing process 52 | [content appendFormat:@"

",myImageURL]; 53 | // img element will be replaced with en-media element automatically. 54 | 55 | 56 | [content appendString:kENMLSuffix]; 57 | 58 | [note setTitle:noteTitle]; 59 | [note setContent:content]; 60 | [note setResources:resources]; 61 | 62 | SHKEvernoteItem *item = [[SHKEvernoteItem alloc] init] autorelease]; 63 | item.title = noteTitle; 64 | item.shareType = SHKShareTypeURL; 65 | item.note = note; 66 | 67 | SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item]; 68 | [actionSheet showFromToolbar:self.navigationController.toolbar]; 69 | 70 | 71 | Learn more about `EDAMNote` at [Evernote official developer overview](http://www.evernote.com/about/developer/api/evernote-api.htm#_Toc272854029). -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ideashower/ShareKit/9139332ef1ab10128697487185c106d81215df6a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/close.png -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/fbicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ideashower/ShareKit/9139332ef1ab10128697487185c106d81215df6a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/fbicon.png -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ideashower/ShareKit/9139332ef1ab10128697487185c106d81215df6a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login.png -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ideashower/ShareKit/9139332ef1ab10128697487185c106d81215df6a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login2.png -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login2_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ideashower/ShareKit/9139332ef1ab10128697487185c106d81215df6a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login2_down.png -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ideashower/ShareKit/9139332ef1ab10128697487185c106d81215df6a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login_down.png -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/logout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ideashower/ShareKit/9139332ef1ab10128697487185c106d81215df6a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/logout.png -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/logout_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ideashower/ShareKit/9139332ef1ab10128697487185c106d81215df6a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/logout_down.png -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Facebook 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #import "FBSession.h" 18 | #import "FBRequest.h" 19 | #import "FBLoginButton.h" 20 | #import "FBLoginDialog.h" 21 | #import "FBPermissionDialog.h" 22 | #import "FBStreamDialog.h" 23 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnectGlobal.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Facebook 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #import "FBConnectGlobal.h" 18 | 19 | const NSString* kFB_SDK_VersionNumber = @"iphone/1.3.0"; 20 | 21 | /////////////////////////////////////////////////////////////////////////////////////////////////// 22 | // private 23 | 24 | const void* RetainNoOp(CFAllocatorRef allocator, const void *value) { return value; } 25 | void ReleaseNoOp(CFAllocatorRef allocator, const void *value) { } 26 | 27 | /////////////////////////////////////////////////////////////////////////////////////////////////// 28 | // public 29 | 30 | NSMutableArray* FBCreateNonRetainingArray() { 31 | CFArrayCallBacks callbacks = kCFTypeArrayCallBacks; 32 | callbacks.retain = RetainNoOp; 33 | callbacks.release = ReleaseNoOp; 34 | return (NSMutableArray*)CFArrayCreateMutable(nil, 0, &callbacks); 35 | } 36 | 37 | 38 | BOOL FBIsDeviceIPad() { 39 | #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200 40 | if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { 41 | return YES; 42 | } 43 | #endif 44 | return NO; 45 | } 46 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBFeedDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Facebook 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #import "FBDialog.h" 18 | 19 | @interface FBFeedDialog : FBDialog { 20 | long long _templateBundleId; 21 | NSString* _templateData; 22 | NSString* _bodyGeneral; 23 | } 24 | 25 | /** 26 | * The id for a previously registered template bundle. 27 | */ 28 | @property(nonatomic) long long templateBundleId; 29 | 30 | /** 31 | * A JSON string containing template data. 32 | * 33 | * See http://wiki.developers.facebook.com/index.php/Template_Data 34 | */ 35 | @property(nonatomic,copy) NSString* templateData; 36 | 37 | /** 38 | * Additional markup for a short story. 39 | */ 40 | @property(nonatomic,copy) NSString* bodyGeneral; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBFeedDialog.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Facebook 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #import "FBFeedDialog.h" 18 | #import "FBSession.h" 19 | 20 | /////////////////////////////////////////////////////////////////////////////////////////////////// 21 | // global 22 | 23 | static NSString* kFeedURL = @"http://www.facebook.com/connect/prompt_feed.php"; 24 | 25 | /////////////////////////////////////////////////////////////////////////////////////////////////// 26 | 27 | @implementation FBFeedDialog 28 | 29 | @synthesize templateBundleId = _templateBundleId, templateData = _templateData, 30 | bodyGeneral = _bodyGeneral; 31 | 32 | /////////////////////////////////////////////////////////////////////////////////////////////////// 33 | // private 34 | 35 | - (NSString*)generateFeedInfo { 36 | NSMutableArray* pairs = [NSMutableArray array]; 37 | 38 | if (_templateBundleId) { 39 | [pairs addObject:[NSString stringWithFormat:@"\"template_id\": %lld", _templateBundleId]]; 40 | } 41 | if (_templateData) { 42 | [pairs addObject:[NSString stringWithFormat:@"\"template_data\": %@", _templateData]]; 43 | } 44 | if (_bodyGeneral) { 45 | [pairs addObject:[NSString stringWithFormat:@"\"body_general\": \"%@\"", _bodyGeneral]]; 46 | } 47 | 48 | return [NSString stringWithFormat:@"{%@}", [pairs componentsJoinedByString:@","]]; 49 | } 50 | 51 | /////////////////////////////////////////////////////////////////////////////////////////////////// 52 | // NSObject 53 | 54 | - (id)initWithSession:(FBSession*)session { 55 | if (self = [super initWithSession:session]) { 56 | _templateBundleId = 0; 57 | _templateData = nil; 58 | _bodyGeneral = nil; 59 | } 60 | return self; 61 | } 62 | 63 | - (void)dealloc { 64 | [_templateData release]; 65 | [_bodyGeneral release]; 66 | [super dealloc]; 67 | } 68 | 69 | /////////////////////////////////////////////////////////////////////////////////////////////////// 70 | // FBDialog 71 | 72 | - (void)load { 73 | NSDictionary* getParams = [NSDictionary dictionaryWithObjectsAndKeys: 74 | @"touch", @"display", nil]; 75 | 76 | NSString* feedInfo = [self generateFeedInfo]; 77 | NSDictionary* postParams = [NSDictionary dictionaryWithObjectsAndKeys: 78 | _session.apiKey, @"api_key", _session.sessionKey, @"session_key", 79 | @"1", @"preview", @"fbconnect:success", @"callback", @"fbconnect:cancel", @"cancel", 80 | feedInfo, @"feed_info", @"self_feed", @"feed_target_type", nil]; 81 | 82 | [self loadURL:kFeedURL method:@"POST" get:getParams post:postParams]; 83 | } 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBLoginButton.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Facebook 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #import "FBSession.h" 18 | 19 | typedef enum { 20 | FBLoginButtonStyleNormal, 21 | FBLoginButtonStyleWide, 22 | } FBLoginButtonStyle; 23 | 24 | /** 25 | * Standard button which lets the user log in or out of the session. 26 | * 27 | * The button will automatically change to reflect the state of the session, showing 28 | * "login" if the session is not connected, and "logout" if the session is connected. 29 | */ 30 | @interface FBLoginButton : UIControl { 31 | FBLoginButtonStyle _style; 32 | FBSession* _session; 33 | UIImageView* _imageView; 34 | } 35 | 36 | /** 37 | * The visual style of the button. 38 | */ 39 | @property(nonatomic) FBLoginButtonStyle style; 40 | 41 | /** 42 | * The session object that the button will log in and out of. 43 | * 44 | * The default value is the global session singleton, so there is usually no need to 45 | * set this property yourself. 46 | */ 47 | @property(nonatomic,retain) FBSession* session; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBLoginDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Facebook 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #import "FBDialog.h" 18 | #import "FBRequest.h" 19 | 20 | @interface FBLoginDialog : FBDialog { 21 | FBRequest* _getSessionRequest; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBPermissionDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Facebook 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #import "FBLoginDialog.h" 18 | 19 | @interface FBPermissionDialog : FBLoginDialog { 20 | NSString* _permission; 21 | NSTimer* _redirectTimer; 22 | } 23 | 24 | /** 25 | * The extended permission to request. 26 | * 27 | * See http://wiki.developers.facebook.com/index.php/Extended_permissions 28 | */ 29 | @property(nonatomic,copy) NSString* permission; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBStreamDialog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Facebook 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #import "FBDialog.h" 18 | 19 | @interface FBStreamDialog : FBDialog { 20 | NSString* _attachment; 21 | NSString* _actionLinks; 22 | NSString* _targetId; 23 | NSString* _userMessagePrompt; 24 | } 25 | 26 | /** 27 | * A JSON-encoded object containing the text of the post, relevant links, a 28 | * media type (image, video, mp3, flash), as well as any other key/value pairs 29 | * you may want to add. 30 | * 31 | * Note: If you want to use this call to update a user's status, don't pass an 32 | * attachment; the content of the userMessage parameter will become the user's 33 | * new status and will appear at the top of the user's profile. 34 | * 35 | * For more info, see http://wiki.developers.facebook.com/index.php/Attachment_(Streams) 36 | */ 37 | @property(nonatomic,copy) NSString* attachment; 38 | 39 | /** 40 | * A JSON-encoded array of action link objects, containing the link text and a 41 | * hyperlink. 42 | */ 43 | @property(nonatomic,copy) NSString* actionLinks; 44 | 45 | /** 46 | * The ID of the user or the Page where you are publishing the content. If this 47 | * is specified, the post appears on the Wall of the target user, not on the 48 | * Wall of the user who published the post. This mimics the action of posting 49 | * on a friend's Wall on Facebook itself. 50 | * 51 | * Note: To post on the user's own wall, leave this blank. 52 | */ 53 | @property(nonatomic,copy) NSString* targetId; 54 | 55 | /** 56 | * Text you provide the user as a prompt to specify a userMessage. This appears 57 | * above the box where the user enters a custom message. 58 | * For example, "What's on your mind?" 59 | */ 60 | @property(nonatomic,copy) NSString* userMessagePrompt; 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBStreamDialog.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Facebook 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #import "FBStreamDialog.h" 18 | #import "FBSession.h" 19 | 20 | /////////////////////////////////////////////////////////////////////////////////////////////////// 21 | // global 22 | 23 | static NSString* kStreamURL = @"http://www.facebook.com/connect/prompt_feed.php"; 24 | 25 | /////////////////////////////////////////////////////////////////////////////////////////////////// 26 | 27 | @implementation FBStreamDialog 28 | 29 | @synthesize attachment = _attachment, 30 | actionLinks = _actionLinks, 31 | targetId = _targetId, 32 | userMessagePrompt = _userMessagePrompt; 33 | 34 | /////////////////////////////////////////////////////////////////////////////////////////////////// 35 | // NSObject 36 | 37 | - (id)initWithSession:(FBSession*)session { 38 | if (self = [super initWithSession:session]) { 39 | _attachment = @""; 40 | _actionLinks = @""; 41 | _targetId = @""; 42 | _userMessagePrompt = @""; 43 | } 44 | return self; 45 | } 46 | 47 | - (void)dealloc { 48 | [_attachment release]; 49 | [_actionLinks release]; 50 | [_targetId release]; 51 | [_userMessagePrompt release]; 52 | [super dealloc]; 53 | } 54 | 55 | /////////////////////////////////////////////////////////////////////////////////////////////////// 56 | // FBDialog 57 | 58 | - (void)load { 59 | NSDictionary* getParams = [NSDictionary dictionaryWithObjectsAndKeys: 60 | @"touch", @"display", nil]; 61 | 62 | NSDictionary* postParams = [NSDictionary dictionaryWithObjectsAndKeys: 63 | _session.apiKey, @"api_key", 64 | _session.sessionKey, @"session_key", 65 | @"1", @"preview", 66 | @"fbconnect:success", @"callback", 67 | @"fbconnect:cancel", @"cancel", 68 | _attachment, @"attachment", 69 | _actionLinks, @"action_links", 70 | _targetId, @"target_id", 71 | _userMessagePrompt, @"user_message_prompt", 72 | nil]; 73 | 74 | [self loadURL:kStreamURL method:@"POST" get:getParams post:postParams]; 75 | } 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBXMLHandler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2009 Facebook 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | #import "FBConnectGlobal.h" 18 | 19 | @interface FBXMLHandler : NSObject { 20 | NSMutableArray* _stack; 21 | NSMutableArray* _nameStack; 22 | id _rootObject; 23 | NSString* _rootName; 24 | NSMutableString* _chars; 25 | NSError* _parseError; 26 | } 27 | 28 | @property(nonatomic,readonly) id rootObject; 29 | @property(nonatomic,readonly) NSString* rootName; 30 | @property(nonatomic,readonly) NSError* parseError; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Facebook/SHKFBStreamDialog.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKFBStreamDialog.h 3 | // Adds a little bit extra control to FBStreamDialog 4 | // 5 | // Created by Nathan Weiner on 7/26/10. 6 | // Copyright 2010 Idea Shower, LLC. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FBStreamDialog.h" 11 | 12 | @interface SHKFBStreamDialog : FBStreamDialog 13 | { 14 | NSString *defaultStatus; 15 | } 16 | 17 | @property (nonatomic, retain) NSString *defaultStatus; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Facebook/SHKFBStreamDialog.m: -------------------------------------------------------------------------------- 1 | // 2 | // SHKFBStreamDialog.m 3 | // RIL 4 | // 5 | // Created by Nathan Weiner on 7/26/10. 6 | // Copyright 2010 Idea Shower, LLC. All rights reserved. 7 | // 8 | 9 | #import "SHKFBStreamDialog.h" 10 | #import "SHK.h" 11 | 12 | @implementation SHKFBStreamDialog 13 | 14 | @synthesize defaultStatus; 15 | 16 | - (void)dealloc 17 | { 18 | [defaultStatus release]; 19 | [super dealloc]; 20 | } 21 | 22 | - (void)webViewDidFinishLoad:(UIWebView *)webView 23 | { 24 | [super webViewDidFinishLoad:webView]; 25 | 26 | if (defaultStatus) 27 | { 28 | // Set the pre-filled status message 29 | [_webView stringByEvaluatingJavaScriptFromString: 30 | [NSString stringWithFormat:@"document.getElementsByName('feedform_user_message')[0].value = decodeURIComponent('%@')", 31 | [SHKEncode(defaultStatus) stringByReplacingOccurrencesOfString:@"'" withString:@"\\'"] 32 | ] 33 | ]; 34 | 35 | // Make the text field bigger 36 | [_webView stringByEvaluatingJavaScriptFromString:@"document.getElementsByName('feedform_user_message')[0].style.height='100px'"]; 37 | } 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Facebook/SHKFacebook.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKFacebook.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/18/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | #import "SHKSharer.h" 30 | #import "FBConnect.h" 31 | 32 | typedef enum 33 | { 34 | SHKFacebookPendingNone, 35 | SHKFacebookPendingLogin, 36 | SHKFacebookPendingStatus, 37 | SHKFacebookPendingImage 38 | } SHKFacebookPendingAction; 39 | 40 | 41 | @interface SHKFacebook : SHKSharer 42 | { 43 | FBSession *session; 44 | SHKFacebookPendingAction pendingFacebookAction; 45 | FBLoginDialog *login; 46 | } 47 | 48 | @property (retain) FBSession *session; 49 | @property SHKFacebookPendingAction pendingFacebookAction; 50 | @property (retain) FBLoginDialog *login; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Google Reader/SHKGoogleReader.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKGoogleReader.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/20/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | #import "SHKSharer.h" 30 | 31 | @interface SHKGoogleReader : SHKSharer 32 | { 33 | NSMutableDictionary *session; 34 | BOOL sendAfterLogin; 35 | } 36 | 37 | @property (nonatomic, retain) NSMutableDictionary *session; 38 | @property (nonatomic) BOOL sendAfterLogin; 39 | 40 | - (void)sendWithToken:(NSString *)token; 41 | - (void)getSession:(NSString *)email password:(NSString *)password; 42 | - (void)signRequest:(SHKRequest *)aRequest; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Instapaper/SHKInstapaper.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKInstapaper.h 3 | // ShareKit 4 | // 5 | // Created by Sean Murphy on 7/8/10. 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | // 26 | 27 | #import 28 | #import "SHKSharer.h" 29 | 30 | @interface SHKInstapaper : SHKSharer { 31 | 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Pinboard/SHKPinboard.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKPinboard.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/21/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | #import "SHKSharer.h" 30 | 31 | @interface SHKPinboard : SHKSharer 32 | { 33 | 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Read It Later/SHKReadItLater.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKReadItLater.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/8/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | #import "SHKSharer.h" 30 | 31 | @interface SHKReadItLater : SHKSharer 32 | { 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Tumblr/SHKTumblr.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKTumblr.h 3 | // ShareKit 4 | // 5 | // Created by Jamie Pinkham on 7/10/10. 6 | // Copyright 2010 Mobelux. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "SHKSharer.h" 11 | 12 | @interface SHKTumblr : SHKSharer { 13 | //for photo posts 14 | NSMutableData *data; 15 | NSHTTPURLResponse *response; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Twitter/SHKTwitter.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKTwitter.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/21/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | #import "SHKOAuthSharer.h" 30 | #import "SHKTwitterForm.h" 31 | 32 | @interface SHKTwitter : SHKOAuthSharer 33 | { 34 | BOOL xAuth; 35 | } 36 | 37 | @property BOOL xAuth; 38 | 39 | 40 | #pragma mark - 41 | #pragma mark UI Implementation 42 | 43 | - (void)showTwitterForm; 44 | 45 | #pragma mark - 46 | #pragma mark Share API Methods 47 | 48 | - (void)shortenURL; 49 | - (void)shortenURLFinished:(SHKRequest *)aRequest; 50 | 51 | - (void)sendForm:(SHKTwitterForm *)form; 52 | 53 | - (void)sendStatus; 54 | - (void)sendStatusTicket:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data; 55 | - (void)sendStatusTicket:(OAServiceTicket *)ticket didFailWithError:(NSError*)error; 56 | - (void)sendImage; 57 | - (void)sendImageTicket:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data; 58 | - (void)sendImageTicket:(OAServiceTicket *)ticket didFailWithError:(NSError*)error; 59 | 60 | - (void)followMe; 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /Classes/ShareKit/Sharers/Services/Twitter/SHKTwitterForm.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKTwitterForm.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/22/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | 30 | 31 | @interface SHKTwitterForm : UIViewController 32 | { 33 | id delegate; 34 | UITextView *textView; 35 | UILabel *counter; 36 | BOOL hasAttachment; 37 | } 38 | 39 | @property (nonatomic, retain) id delegate; 40 | @property (nonatomic, retain) UITextView *textView; 41 | @property (nonatomic, retain) UILabel *counter; 42 | @property BOOL hasAttachment; 43 | 44 | - (void)layoutCounter; 45 | - (void)save; 46 | - (void)keyboardWillShow:(NSNotification *)notification; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Classes/ShareKit/UI/SHKActionSheet.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKActionSheet.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/10/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | #import "SHK.h" 30 | 31 | @interface SHKActionSheet : UIActionSheet 32 | { 33 | NSMutableArray *sharers; 34 | 35 | SHKItem *item; 36 | } 37 | 38 | @property (retain) NSMutableArray *sharers; 39 | 40 | @property (retain) SHKItem *item; 41 | 42 | + (SHKActionSheet *)actionSheetForType:(SHKShareType)type; 43 | + (SHKActionSheet *)actionSheetForItem:(SHKItem *)i; 44 | 45 | @end -------------------------------------------------------------------------------- /Classes/ShareKit/UI/SHKActivityIndicator.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKActivityIndicator.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/16/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | 30 | 31 | @interface SHKActivityIndicator : UIView 32 | { 33 | UILabel *centerMessageLabel; 34 | UILabel *subMessageLabel; 35 | 36 | UIActivityIndicatorView *spinner; 37 | } 38 | 39 | @property (nonatomic, retain) UILabel *centerMessageLabel; 40 | @property (nonatomic, retain) UILabel *subMessageLabel; 41 | 42 | @property (nonatomic, retain) UIActivityIndicatorView *spinner; 43 | 44 | 45 | + (SHKActivityIndicator *)currentIndicator; 46 | 47 | - (void)show; 48 | - (void)hideAfterDelay; 49 | - (void)hide; 50 | - (void)hidden; 51 | - (void)displayActivity:(NSString *)m; 52 | - (void)displayCompleted:(NSString *)m; 53 | - (void)setCenterMessage:(NSString *)message; 54 | - (void)setSubMessage:(NSString *)message; 55 | - (void)showSpinner; 56 | - (void)setProperRotation; 57 | - (void)setProperRotation:(BOOL)animated; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /Classes/ShareKit/UI/SHKFormController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKFormController.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/17/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | #import "SHKFormFieldSettings.h" 30 | #import "SHKCustomFormFieldCell.h" 31 | 32 | @interface SHKFormController : UITableViewController 33 | { 34 | id delegate; 35 | SEL validateSelector; 36 | SEL saveSelector; 37 | 38 | NSMutableArray *sections; 39 | NSMutableDictionary *values; 40 | 41 | CGFloat labelWidth; 42 | 43 | UITextField *activeField; 44 | 45 | BOOL autoSelect; 46 | } 47 | 48 | @property (retain) id delegate; 49 | @property SEL validateSelector; 50 | @property SEL saveSelector; 51 | 52 | @property (retain) NSMutableArray *sections; 53 | @property (retain) NSMutableDictionary *values; 54 | 55 | @property CGFloat labelWidth; 56 | 57 | @property (nonatomic, retain) UITextField *activeField; 58 | 59 | @property BOOL autoSelect; 60 | 61 | 62 | - (id)initWithStyle:(UITableViewStyle)style title:(NSString *)barTitle rightButtonTitle:(NSString *)rightButtonTitle; 63 | - (void)addSection:(NSArray *)fields header:(NSString *)header footer:(NSString *)footer; 64 | 65 | #pragma mark - 66 | 67 | - (SHKFormFieldSettings *)rowSettingsForIndexPath:(NSIndexPath *)indexPath; 68 | 69 | #pragma mark - 70 | #pragma mark Completion 71 | 72 | - (void)close; 73 | - (void)cancel; 74 | - (void)validateForm; 75 | - (void)saveForm; 76 | 77 | #pragma mark - 78 | 79 | - (NSMutableDictionary *)formValues; 80 | - (NSMutableDictionary *)formValuesForSection:(int)section; 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /Classes/ShareKit/UI/SHKFormFieldCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKFormFieldCell.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/17/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | #import "SHK.h" 30 | 31 | @class SHKFormController; 32 | 33 | @interface SHKFormFieldCell : UITableViewCell 34 | { 35 | SHKFormFieldSettings *settings; 36 | 37 | CGFloat labelWidth; 38 | 39 | UITextField *textField; 40 | UISwitch *toggle; 41 | 42 | NSString *tmpValue; 43 | 44 | SHKFormController *form; 45 | } 46 | 47 | @property (nonatomic, retain) SHKFormFieldSettings *settings; 48 | 49 | @property (nonatomic) CGFloat labelWidth; 50 | 51 | @property (nonatomic, retain, getter=getTextField) UITextField *textField; 52 | @property (nonatomic, retain) UISwitch *toggle; 53 | 54 | @property (nonatomic, retain) NSString *tmpValue; 55 | 56 | @property (nonatomic, assign) SHKFormController *form; 57 | 58 | - (void)setValue:(NSString *)value; 59 | - (NSString *)getValue; 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Classes/ShareKit/UI/SHKFormFieldSettings.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKFormFieldSettings.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/22/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | 30 | typedef enum 31 | { 32 | SHKFormFieldTypeText, 33 | SHKFormFieldTypePassword, 34 | SHKFormFieldTypeSwitch 35 | } SHKFormFieldType; 36 | 37 | #define SHKFormFieldSwitchOff @"0" 38 | #define SHKFormFieldSwitchOn @"1" 39 | 40 | @interface SHKFormFieldSettings : NSObject 41 | { 42 | NSString *label; 43 | NSString *key; 44 | SHKFormFieldType type; 45 | NSString *start; 46 | } 47 | 48 | @property (nonatomic, retain) NSString *label; 49 | @property (nonatomic, retain) NSString *key; 50 | @property SHKFormFieldType type; 51 | @property (nonatomic, retain) NSString *start; 52 | 53 | + (id)label:(NSString *)l key:(NSString *)k type:(SHKFormFieldType)t start:(NSString *)s; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /Classes/ShareKit/UI/SHKFormFieldSettings.m: -------------------------------------------------------------------------------- 1 | // 2 | // SHKFormFieldSettings.m 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/22/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import "SHKFormFieldSettings.h" 29 | 30 | 31 | @implementation SHKFormFieldSettings 32 | 33 | @synthesize label, key, type, start; 34 | 35 | - (void)dealloc 36 | { 37 | [label release]; 38 | [key release]; 39 | [start release]; 40 | 41 | [super dealloc]; 42 | } 43 | 44 | + (id)label:(NSString *)l key:(NSString *)k type:(SHKFormFieldType)t start:(NSString *)s 45 | { 46 | SHKFormFieldSettings *settings = [[SHKFormFieldSettings alloc] init]; 47 | settings.label = l; 48 | settings.key = k; 49 | settings.type = t; 50 | settings.start = s; 51 | return [settings autorelease]; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Classes/ShareKit/UI/SHKOAuthView.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKTwitterAuthView.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/21/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | 30 | @class SHKOAuthView; 31 | @class SHKOAuthSharer; 32 | 33 | @protocol SHKOAuthViewDelegate 34 | 35 | - (void)tokenAuthorizeView:(SHKOAuthView *)authView didFinishWithSuccess:(BOOL)success queryParams:(NSMutableDictionary *)queryParams error:(NSError *)error; 36 | - (void)tokenAuthorizeCancelledView:(SHKOAuthView *)authView; 37 | - (NSURL *)authorizeCallbackURL; 38 | 39 | @end 40 | 41 | 42 | @interface SHKOAuthView : UIViewController 43 | { 44 | UIWebView *webView; 45 | id delegate; 46 | UIActivityIndicatorView *spinner; 47 | } 48 | 49 | @property (nonatomic, retain) UIWebView *webView; 50 | @property (retain) id delegate; 51 | @property (nonatomic, retain) UIActivityIndicatorView *spinner; 52 | 53 | - (id)initWithURL:(NSURL *)authorizeURL delegate:(id)d; 54 | 55 | - (void)startSpinner; 56 | - (void)stopSpinner; 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Classes/ShareKit/UI/SHKShareMenu.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKShareMenu.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/18/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | #import "SHK.h" 30 | 31 | @interface SHKShareMenu : UITableViewController 32 | { 33 | SHKItem *item; 34 | NSMutableArray *tableData; 35 | NSMutableDictionary *exclusions; 36 | } 37 | 38 | @property (nonatomic, retain) SHKItem *item; 39 | @property (retain) NSMutableArray *tableData; 40 | @property (retain) NSMutableDictionary *exclusions; 41 | 42 | 43 | - (void)rebuildTableDataAnimated:(BOOL)animated; 44 | - (NSMutableArray *)section:(NSString *)section; 45 | - (NSDictionary *)rowDataAtIndexPath:(NSIndexPath *)indexPath; 46 | 47 | #pragma mark - 48 | #pragma mark Toolbar Buttons 49 | 50 | - (void)cancel; 51 | - (void)edit; 52 | - (void)save; 53 | 54 | 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Classes/ShareKit/UI/SHKViewControllerWrapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // SHKViewControllerWrapper.h 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/28/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import 29 | 30 | 31 | @interface SHKViewControllerWrapper : UIViewController { 32 | 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Classes/ShareKit/UI/SHKViewControllerWrapper.m: -------------------------------------------------------------------------------- 1 | // 2 | // SHKViewControllerWrapper.m 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/28/10. 6 | 7 | // 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files (the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions: 14 | // 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // 18 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | // THE SOFTWARE. 25 | // 26 | // 27 | 28 | #import "SHKViewControllerWrapper.h" 29 | 30 | 31 | @implementation SHKViewControllerWrapper 32 | 33 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 34 | { 35 | return YES; 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | The code hosted here on github is for ongoing development and contributions and may contain untested code. Please use a stable release from http://getsharekit.com for use in your own app. 2 | 3 | *** 4 | 5 | To download a stable release visit: 6 | http://getsharekit.com/install 7 | 8 | Installation instructions: 9 | http://getsharekit.com/install 10 | 11 | How to add new services: 12 | http://getsharekit.com/add 13 | 14 | How to customize the look of ShareKit: 15 | http://getsharekit.com/customize 16 | 17 | Full documentation: 18 | http://getsharekit.com/docs 19 | 20 | *** 21 | 22 | Follow @IdeaShower or http://getsharekit.com/blog for updates 23 | -------------------------------------------------------------------------------- /ShareKit-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | NSMainNibFile 28 | MainWindow 29 | NSMainNibFile~ipad 30 | MainWindow-iPad 31 | 32 | 33 | -------------------------------------------------------------------------------- /ShareKit_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'ShareKit' target in the 'ShareKit' project 3 | // 4 | #import 5 | 6 | #ifndef __IPHONE_3_0 7 | #warning "This project uses features only available in iPhone SDK 3.0 and later." 8 | #endif 9 | 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ShareKit 4 | // 5 | // Created by Nathan Weiner on 6/4/10. 6 | // Copyright Idea Shower, LLC 2010. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) { 12 | 13 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 14 | int retVal = UIApplicationMain(argc, argv, nil, nil); 15 | [pool release]; 16 | return retVal; 17 | } 18 | --------------------------------------------------------------------------------