diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..a9e6555d --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.DS_Store +*~ +*.pbxuser +*.perspective +*.perspectivev3 +*.mode1v3 +build +.DS_Store diff --git a/Classes/Example/ExampleShareFile.h b/Classes/Example/ExampleShareFile.h new file mode 100644 index 00000000..43ce4379 --- /dev/null +++ b/Classes/Example/ExampleShareFile.h @@ -0,0 +1,38 @@ +// +// ExampleShareFile.h +// ShareKit +// +// Created by Nathan Weiner on 6/29/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import + + +@interface ExampleShareFile : UIViewController +{ + UIWebView *webView; +} + +@property (nonatomic, retain) UIWebView *webView; + +@end diff --git a/Classes/Example/ExampleShareFile.m b/Classes/Example/ExampleShareFile.m new file mode 100644 index 00000000..142d00cb --- /dev/null +++ b/Classes/Example/ExampleShareFile.m @@ -0,0 +1,83 @@ +// +// ExampleShareFile.m +// ShareKit +// +// Created by Nathan Weiner on 6/29/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "ExampleShareFile.h" +#import "SHK.h" +#import "SHKActionSheet.h" + +@implementation ExampleShareFile + +@synthesize webView; + +- (void)dealloc +{ + [webView release]; + [super dealloc]; +} + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) + { + self.toolbarItems = [NSArray arrayWithObjects: + [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease], + [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(share)] autorelease], + [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease], + nil + ]; + } + + return self; +} + +- (void)loadView +{ + self.webView = [[UIWebView alloc] initWithFrame:CGRectZero]; + webView.delegate = self; + webView.scalesPageToFit = YES; + [webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"example.pdf"]]]]; + + self.view = webView; + [webView release]; +} + +- (void)share +{ + NSString *filePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"example.pdf"]; + NSData *file = [NSData dataWithContentsOfFile:filePath]; + + SHKItem *item = [SHKItem file:file filename:@"Awesome.pdf" mimeType:@"application/pdf" title:@"My Awesome PDF"]; + SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item]; + [actionSheet showFromToolbar:self.navigationController.toolbar]; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + +@end diff --git a/Classes/Example/ExampleShareImage.h b/Classes/Example/ExampleShareImage.h new file mode 100644 index 00000000..10526ad9 --- /dev/null +++ b/Classes/Example/ExampleShareImage.h @@ -0,0 +1,38 @@ +// +// ExampleShareImage.h +// ShareKit +// +// Created by Nathan Weiner on 6/18/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import + + +@interface ExampleShareImage : UIViewController +{ + UIImageView *imageView; +} + +@property (nonatomic, retain) UIImageView *imageView; + +@end diff --git a/Classes/Example/ExampleShareImage.m b/Classes/Example/ExampleShareImage.m new file mode 100644 index 00000000..e7031f0f --- /dev/null +++ b/Classes/Example/ExampleShareImage.m @@ -0,0 +1,83 @@ + // +// ExampleShareImage.m +// ShareKit +// +// Created by Nathan Weiner on 6/18/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "ExampleShareImage.h" +#import "SHKItem.h" +#import "SHKActionSheet.h" + +@implementation ExampleShareImage + +@synthesize imageView; + +- (void)dealloc +{ + [imageView release]; + [super dealloc]; +} + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) + { + self.toolbarItems = [NSArray arrayWithObjects: + [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease], + [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(share)] autorelease], + [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease], + nil + ]; + } + + return self; +} + +- (void)loadView +{ + [super loadView]; + + self.imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"sanFran.jpg"]]; + + imageView.frame = CGRectMake(0,0,self.view.bounds.size.width,self.view.bounds.size.height); + + [self.view addSubview:imageView]; + + [imageView release]; +} + +- (void)share +{ + SHKItem *item = [SHKItem image:imageView.image title:@"San Francisco"]; + SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item]; + + [actionSheet showFromToolbar:self.navigationController.toolbar]; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + +@end diff --git a/Classes/Example/ExampleShareLink.h b/Classes/Example/ExampleShareLink.h new file mode 100644 index 00000000..5fffd2a1 --- /dev/null +++ b/Classes/Example/ExampleShareLink.h @@ -0,0 +1,38 @@ +// +// ExampleShareLink.h +// ShareKit +// +// Created by Nathan Weiner on 6/17/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import + + +@interface ExampleShareLink : UIViewController +{ + UIWebView *webView; +} + +@property (nonatomic, retain) UIWebView *webView; + +@end diff --git a/Classes/Example/ExampleShareLink.m b/Classes/Example/ExampleShareLink.m new file mode 100644 index 00000000..308de462 --- /dev/null +++ b/Classes/Example/ExampleShareLink.m @@ -0,0 +1,79 @@ + // +// ExampleShareLink.m +// ShareKit +// +// Created by Nathan Weiner on 6/17/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "ExampleShareLink.h" +#import "SHK.h" + +@implementation ExampleShareLink + +@synthesize webView; + +- (void)dealloc +{ + [webView release]; + [super dealloc]; +} + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) + { + self.toolbarItems = [NSArray arrayWithObjects: + [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease], + [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(share)] autorelease], + [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease], + nil + ]; + } + + return self; +} + +- (void)share +{ + SHKItem *item = [SHKItem URL:webView.request.URL title:[webView pageTitle]]; + SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item]; + [actionSheet showFromToolbar:self.navigationController.toolbar]; +} + +- (void)loadView +{ + self.webView = [[UIWebView alloc] initWithFrame:CGRectZero]; + webView.delegate = self; + webView.scalesPageToFit = YES; + [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://apple.com"]]]; + + self.view = webView; + [webView release]; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + +@end diff --git a/Classes/Example/ExampleShareText.h b/Classes/Example/ExampleShareText.h new file mode 100644 index 00000000..1625839b --- /dev/null +++ b/Classes/Example/ExampleShareText.h @@ -0,0 +1,38 @@ +// +// ExampleShareText.h +// ShareKit +// +// Created by Nathan Weiner on 6/18/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import + + +@interface ExampleShareText : UIViewController +{ + UITextView *textView; +} + +@property (nonatomic, retain) UITextView *textView; + +@end diff --git a/Classes/Example/ExampleShareText.m b/Classes/Example/ExampleShareText.m new file mode 100644 index 00000000..cc66d29f --- /dev/null +++ b/Classes/Example/ExampleShareText.m @@ -0,0 +1,91 @@ + // +// ExampleShareText.m +// ShareKit +// +// Created by Nathan Weiner on 6/18/10. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#import "ExampleShareText.h" +#import "SHKItem.h" +#import "SHKActionSheet.h" + +@implementation ExampleShareText + +@synthesize textView; + +- (void)dealloc +{ + [textView release]; + [super dealloc]; +} + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) + { + self.toolbarItems = [NSArray arrayWithObjects: + [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease], + [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:self action:@selector(share)] autorelease], + [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease], + nil + ]; + } + + return self; +} + +- (void)loadView +{ + [super loadView]; + + self.textView = [[UITextView alloc] initWithFrame:CGRectMake(0,0,self.view.bounds.size.width,self.view.bounds.size.height)]; + [self.view addSubview:textView]; + + 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."; + textView.editable = NO; + + [textView release]; +} + +- (void)share +{ + NSString *text; + + if (textView.selectedRange.length > 0) + text = [textView.text substringWithRange:textView.selectedRange]; + + else + text = textView.text; + + + SHKItem *item = [SHKItem text:text]; + SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item]; + + [actionSheet showFromToolbar:self.navigationController.toolbar]; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + + +@end diff --git a/Classes/Example/RootViewController.h b/Classes/Example/RootViewController.h new file mode 100644 index 00000000..289d499a --- /dev/null +++ b/Classes/Example/RootViewController.h @@ -0,0 +1,14 @@ +// +// RootViewController.h +// ShareKit +// +// Created by Nathan Weiner on 6/4/10. +// Copyright Idea Shower, LLC 2010. All rights reserved. +// + +#import + +@interface RootViewController : UITableViewController { +} + +@end diff --git a/Classes/Example/RootViewController.m b/Classes/Example/RootViewController.m new file mode 100644 index 00000000..0e873e2e --- /dev/null +++ b/Classes/Example/RootViewController.m @@ -0,0 +1,140 @@ +// +// RootViewController.m +// ShareKit +// +// Created by Nathan Weiner on 6/4/10. +// Copyright Idea Shower, LLC 2010. All rights reserved. +// + +#import "RootViewController.h" +#import "ExampleShareLink.h" +#import "ExampleShareImage.h" +#import "ExampleShareText.h" +#import "ExampleShareFile.h" +#import "SHK.h" + +@implementation RootViewController + +- (void)loadView +{ + [super loadView]; + + self.toolbarItems = [NSArray arrayWithObjects: + [[[UIBarButtonItem alloc] initWithTitle:SHKLocalizedString(@"Logout") style:UIBarButtonItemStyleBordered target:self action:@selector(logout)] autorelease], + nil + ]; +} + +#pragma mark - +#pragma mark Table view data source + + +// Customize the number of sections in the table view. +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; +} + + +// Customize the number of rows in the table view. +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return 4;//5; +} + + +// Customize the appearance of table view cells. +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *CellIdentifier = @"Cell"; + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; + if (cell == nil) { + cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; + } + + switch (indexPath.row) + { + case 0: + cell.textLabel.text = SHKLocalizedString(@"Sharing a Link"); + break; + + case 1: + cell.textLabel.text = SHKLocalizedString(@"Sharing an Image"); + break; + + case 2: + cell.textLabel.text = SHKLocalizedString(@"Sharing Text"); + break; + + case 3: + cell.textLabel.text = SHKLocalizedString(@"Sharing a File"); + break; + + //case 4: + // cell.textLabel.text = @"Logout of All Services"; + // break; + } + + return cell; +} + + +#pragma mark - +#pragma mark Table view delegate + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + switch (indexPath.row) + { + case 0: + [self.navigationController pushViewController:[[[ExampleShareLink alloc] initWithNibName:nil bundle:nil] autorelease] animated:YES]; + break; + + case 1: + + [self.navigationController pushViewController:[[[ExampleShareImage alloc] initWithNibName:nil bundle:nil] autorelease] animated:YES]; + break; + + case 2: + [self.navigationController pushViewController:[[[ExampleShareText alloc] initWithNibName:nil bundle:nil] autorelease] animated:YES]; + break; + + case 3: + [self.navigationController pushViewController:[[[ExampleShareFile alloc] initWithNibName:nil bundle:nil] autorelease] animated:YES]; + break; + + //case 4: + // [SHK logoutOfAll]; + // break; + + } +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + + +#pragma mark - + +- (void)logout +{ + [[[[UIAlertView alloc] initWithTitle:SHKLocalizedString(@"Logout") + message:SHKLocalizedString(@"Are you sure you want to logout of all share services?") + delegate:self + cancelButtonTitle:SHKLocalizedString(@"Cancel") + otherButtonTitles:@"Logout",nil] autorelease] show]; + + [SHK logoutOfAll]; +} + +- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex +{ + if (buttonIndex == 0) + [SHK logoutOfAll]; +} + + +@end + diff --git a/Classes/Example/ShareKitAppDelegate.h b/Classes/Example/ShareKitAppDelegate.h new file mode 100644 index 00000000..0824f973 --- /dev/null +++ b/Classes/Example/ShareKitAppDelegate.h @@ -0,0 +1,21 @@ +// +// ShareKitAppDelegate.h +// ShareKit +// +// Created by Nathan Weiner on 6/4/10. +// Copyright Idea Shower, LLC 2010. All rights reserved. +// + +#import + +@interface ShareKitAppDelegate : NSObject { + + UIWindow *window; + UINavigationController *navigationController; +} + +@property (nonatomic, retain) IBOutlet UIWindow *window; +@property (nonatomic, retain) IBOutlet UINavigationController *navigationController; + +@end + diff --git a/Classes/Example/ShareKitAppDelegate.m b/Classes/Example/ShareKitAppDelegate.m new file mode 100644 index 00000000..e905ec41 --- /dev/null +++ b/Classes/Example/ShareKitAppDelegate.m @@ -0,0 +1,60 @@ +// +// ShareKitAppDelegate.m +// ShareKit +// +// Created by Nathan Weiner on 6/4/10. +// Copyright Idea Shower, LLC 2010. All rights reserved. +// + +#import "ShareKitAppDelegate.h" +#import "RootViewController.h" + +#import "SHKReadItLater.h" +#import "SHKFacebook.h" + +@implementation ShareKitAppDelegate + +@synthesize window; +@synthesize navigationController; + + +#pragma mark - +#pragma mark Application lifecycle + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after app launch + + [window addSubview:[navigationController view]]; + [window makeKeyAndVisible]; + + navigationController.topViewController.title = SHKLocalizedString(@"Examples"); + [navigationController setToolbarHidden:NO]; + + [self performSelector:@selector(testOffline) withObject:nil afterDelay:0.5]; + + return YES; +} + +- (void)testOffline +{ + [SHK flushOfflineQueue]; +} + +- (void)applicationWillTerminate:(UIApplication *)application +{ + // Save data if appropriate +} + + +#pragma mark - +#pragma mark Memory management + +- (void)dealloc { + [navigationController release]; + [window release]; + [super dealloc]; +} + + +@end + diff --git a/Classes/Example/example.pdf b/Classes/Example/example.pdf new file mode 100644 index 00000000..4da5f931 Binary files /dev/null and b/Classes/Example/example.pdf differ diff --git a/Classes/Example/sanFran.jpg b/Classes/Example/sanFran.jpg new file mode 100644 index 00000000..6ad777ca Binary files /dev/null and b/Classes/Example/sanFran.jpg differ diff --git a/Classes/ShareKit/Core/Base Sharer Classes/SHKOAuthSharer.h b/Classes/ShareKit/Core/Base Sharer Classes/SHKOAuthSharer.h new file mode 100644 index 00000000..9bcfec55 --- /dev/null +++ b/Classes/ShareKit/Core/Base Sharer Classes/SHKOAuthSharer.h @@ -0,0 +1,91 @@ +// +// SHKOAuthSharer.h +// ShareKit +// +// Created by Nathan Weiner on 6/21/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import +#import "SHKSharer.h" +#import "SHKOAuthView.h" +#import "OAuthConsumer.h" + +@interface SHKOAuthSharer : SHKSharer +{ + NSString *consumerKey; + NSString *secretKey; + NSURL *authorizeCallbackURL; + + NSURL *authorizeURL; + NSURL *accessURL; + NSURL *requestURL; + + OAConsumer *consumer; + OAToken *requestToken; + OAToken *accessToken; + + id signatureProvider; + + NSDictionary *authorizeResponseQueryVars; +} + +@property (nonatomic, retain) NSString *consumerKey; +@property (nonatomic, retain) NSString *secretKey; +@property (nonatomic, retain) NSURL *authorizeCallbackURL; + +@property (nonatomic, retain) NSURL *authorizeURL; +@property (nonatomic, retain) NSURL *accessURL; +@property (nonatomic, retain) NSURL *requestURL; + +@property (retain) OAConsumer *consumer; +@property (retain) OAToken *requestToken; +@property (retain) OAToken *accessToken; + +@property (retain) id signatureProvider; + +@property (nonatomic, retain) NSDictionary *authorizeResponseQueryVars; + + + +#pragma mark - +#pragma mark OAuth Authorization + +- (void)tokenRequest; +- (void)tokenRequestModifyRequest:(OAMutableURLRequest *)oRequest; +- (void)tokenRequestTicket:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data; +- (void)tokenRequestTicket:(OAServiceTicket *)ticket didFailWithError:(NSError*)error; + +- (void)tokenAuthorize; + +- (void)tokenAccess; +- (void)tokenAccess:(BOOL)refresh; +- (void)tokenAccessModifyRequest:(OAMutableURLRequest *)oRequest; +- (void)tokenAccessTicket:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data; +- (void)tokenAccessTicket:(OAServiceTicket *)ticket didFailWithError:(NSError*)error; + +- (void)storeAccessToken; +- (BOOL)restoreAccessToken; +- (void)refreshToken; + + +@end diff --git a/Classes/ShareKit/Core/Base Sharer Classes/SHKOAuthSharer.m b/Classes/ShareKit/Core/Base Sharer Classes/SHKOAuthSharer.m new file mode 100644 index 00000000..e2edf057 --- /dev/null +++ b/Classes/ShareKit/Core/Base Sharer Classes/SHKOAuthSharer.m @@ -0,0 +1,348 @@ +// +// SHKOAuthSharer.m +// ShareKit +// +// Created by Nathan Weiner on 6/21/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKOAuthSharer.h" +#import "SHKOAuthView.h" +#import "OAuthConsumer.h" + + +@implementation SHKOAuthSharer + +@synthesize consumerKey, secretKey, authorizeCallbackURL; +@synthesize authorizeURL, requestURL, accessURL; +@synthesize consumer, requestToken, accessToken; +@synthesize signatureProvider; +@synthesize authorizeResponseQueryVars; + + +- (void)dealloc +{ + [consumerKey release]; + [secretKey release]; + [authorizeCallbackURL release]; + [authorizeURL release]; + [requestURL release]; + [accessURL release]; + [consumer release]; + [requestToken release]; + [accessToken release]; + [signatureProvider release]; + [authorizeResponseQueryVars release]; + + [super dealloc]; +} + + + +#pragma mark - +#pragma mark Authorization + +- (BOOL)isAuthorized +{ + return [self restoreAccessToken]; +} + +- (void)promptAuthorization +{ + [self tokenRequest]; +} + + +#pragma mark Request + +- (void)tokenRequest +{ + [[SHKActivityIndicator currentIndicator] displayActivity:SHKLocalizedString(@"Connecting...")]; + + OAMutableURLRequest *oRequest = [[OAMutableURLRequest alloc] initWithURL:requestURL + consumer:consumer + token:nil // we don't have a Token yet + realm:nil // our service provider doesn't specify a realm + signatureProvider:signatureProvider]; + + + [oRequest setHTTPMethod:@"POST"]; + + [self tokenRequestModifyRequest:oRequest]; + + OAAsynchronousDataFetcher *fetcher = [OAAsynchronousDataFetcher asynchronousFetcherWithRequest:oRequest + delegate:self + didFinishSelector:@selector(tokenRequestTicket:didFinishWithData:) + didFailSelector:@selector(tokenRequestTicket:didFailWithError:)]; + [fetcher start]; + [oRequest release]; +} + +- (void)tokenRequestModifyRequest:(OAMutableURLRequest *)oRequest +{ + // Subclass to add custom paramaters and headers +} + +- (void)tokenRequestTicket:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data +{ + if (SHKDebugShowLogs) // check so we don't have to alloc the string with the data if we aren't logging + SHKLog(@"tokenRequestTicket Response Body: %@", [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]); + + [[SHKActivityIndicator currentIndicator] hide]; + + if (ticket.didSucceed) + { + NSString *responseBody = [[NSString alloc] initWithData:data + encoding:NSUTF8StringEncoding]; + self.requestToken = [[OAToken alloc] initWithHTTPResponseBody:responseBody]; + [responseBody release]; + + [self tokenAuthorize]; + } + + else + // TODO - better error handling here + [self tokenRequestTicket:ticket didFailWithError:[SHK error:SHKLocalizedString(@"There was a problem requesting authorization from %@", [self sharerTitle])]]; +} + +- (void)tokenRequestTicket:(OAServiceTicket *)ticket didFailWithError:(NSError*)error +{ + [[SHKActivityIndicator currentIndicator] hide]; + + [[[[UIAlertView alloc] initWithTitle:SHKLocalizedString(@"Request Error") + message:error!=nil?[error localizedDescription]:SHKLocalizedString(@"There was an error while sharing") + delegate:nil + cancelButtonTitle:SHKLocalizedString(@"Close") + otherButtonTitles:nil] autorelease] show]; +} + + +#pragma mark Authorize + +- (void)tokenAuthorize +{ + NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@?oauth_token=%@", authorizeURL.absoluteString, requestToken.key]]; + + SHKOAuthView *auth = [[SHKOAuthView alloc] initWithURL:url delegate:self]; + [[SHK currentHelper] showViewController:auth]; + [auth release]; +} + +- (void)tokenAuthorizeView:(SHKOAuthView *)authView didFinishWithSuccess:(BOOL)success queryParams:(NSMutableDictionary *)queryParams error:(NSError *)error; +{ + [[SHK currentHelper] hideCurrentViewControllerAnimated:YES]; + + if (!success) + { + [[[[UIAlertView alloc] initWithTitle:SHKLocalizedString(@"Authorize Error") + message:error!=nil?[error localizedDescription]:SHKLocalizedString(@"There was an error while authorizing") + delegate:nil + cancelButtonTitle:SHKLocalizedString(@"Close") + otherButtonTitles:nil] autorelease] show]; + } + + else + { + self.authorizeResponseQueryVars = queryParams; + + [self tokenAccess]; + } +} + +- (void)tokenAuthorizeCancelledView:(SHKOAuthView *)authView +{ + [[SHK currentHelper] hideCurrentViewControllerAnimated:YES]; +} + + +#pragma mark Access + +- (void)tokenAccess +{ + [self tokenAccess:NO]; +} + +- (void)tokenAccess:(BOOL)refresh +{ + if (!refresh) + [[SHKActivityIndicator currentIndicator] displayActivity:SHKLocalizedString(@"Authenticating...")]; + + OAMutableURLRequest *oRequest = [[OAMutableURLRequest alloc] initWithURL:accessURL + consumer:consumer + token:(refresh ? accessToken : requestToken) + realm:nil // our service provider doesn't specify a realm + signatureProvider:signatureProvider]; // use the default method, HMAC-SHA1 + + [oRequest setHTTPMethod:@"POST"]; + + [self tokenAccessModifyRequest:oRequest]; + + OAAsynchronousDataFetcher *fetcher = [OAAsynchronousDataFetcher asynchronousFetcherWithRequest:oRequest + delegate:self + didFinishSelector:@selector(tokenAccessTicket:didFinishWithData:) + didFailSelector:@selector(tokenAccessTicket:didFailWithError:)]; + [fetcher start]; + [oRequest release]; +} + +- (void)tokenAccessModifyRequest:(OAMutableURLRequest *)oRequest +{ + // Subclass to add custom paramaters or headers +} + +- (void)tokenAccessTicket:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data +{ + if (SHKDebugShowLogs) // check so we don't have to alloc the string with the data if we aren't logging + SHKLog(@"tokenAccessTicket Response Body: %@", [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]); + + [[SHKActivityIndicator currentIndicator] hide]; + + if (ticket.didSucceed) + { + NSString *responseBody = [[NSString alloc] initWithData:data + encoding:NSUTF8StringEncoding]; + self.accessToken = [[OAToken alloc] initWithHTTPResponseBody:responseBody]; + [responseBody release]; + + [self storeAccessToken]; + + [self tryPendingAction]; + } + + + else + // TODO - better error handling here + [self tokenAccessTicket:ticket didFailWithError:[SHK error:SHKLocalizedString(@"There was a problem requesting access from %@", [self sharerTitle])]]; +} + +- (void)tokenAccessTicket:(OAServiceTicket *)ticket didFailWithError:(NSError*)error +{ + [[SHKActivityIndicator currentIndicator] hide]; + + [[[[UIAlertView alloc] initWithTitle:SHKLocalizedString(@"Access Error") + message:error!=nil?[error localizedDescription]:SHKLocalizedString(@"There was an error while sharing") + delegate:nil + cancelButtonTitle:SHKLocalizedString(@"Close") + otherButtonTitles:nil] autorelease] show]; +} + +- (void)storeAccessToken +{ + [SHK setAuthValue:accessToken.key + forKey:@"accessKey" + forSharer:[self sharerId]]; + + [SHK setAuthValue:accessToken.secret + forKey:@"accessSecret" + forSharer:[self sharerId]]; + + [SHK setAuthValue:accessToken.sessionHandle + forKey:@"sessionHandle" + forSharer:[self sharerId]]; +} + ++ (void)deleteStoredAccessToken +{ + NSString *sharerId = [self sharerId]; + + [SHK removeAuthValueForKey:@"accessKey" forSharer:sharerId]; + [SHK removeAuthValueForKey:@"accessSecret" forSharer:sharerId]; + [SHK removeAuthValueForKey:@"sessionHandle" forSharer:sharerId]; +} + ++ (void)logout +{ + [self deleteStoredAccessToken]; + + // Clear cookies (for OAuth, doesn't affect XAuth) + // TODO - move the authorizeURL out of the init call (into a define) so we don't have to create an object just to get it + SHKOAuthSharer *sharer = [[self alloc] init]; + if (sharer.authorizeURL) + { + NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; + NSArray *cookies = [storage cookiesForURL:sharer.authorizeURL]; + for (NSHTTPCookie *each in cookies) + { + [storage deleteCookie:each]; + } + } + [sharer release]; +} + +- (BOOL)restoreAccessToken +{ + self.consumer = [[[OAConsumer alloc] initWithKey:consumerKey secret:secretKey] autorelease]; + + if (accessToken != nil) + return YES; + + NSString *key = [SHK getAuthValueForKey:@"accessKey" + forSharer:[self sharerId]]; + + NSString *secret = [SHK getAuthValueForKey:@"accessSecret" + forSharer:[self sharerId]]; + + NSString *sessionHandle = [SHK getAuthValueForKey:@"sessionHandle" + forSharer:[self sharerId]]; + + if (key != nil && secret != nil) + { + self.accessToken = [[[OAToken alloc] initWithKey:key secret:secret] autorelease]; + + if (sessionHandle != nil) + accessToken.sessionHandle = sessionHandle; + + return accessToken != nil; + } + + return NO; +} + + +#pragma mark Expired + +- (void)refreshToken +{ + self.pendingAction = SHKPendingRefreshToken; + [self tokenAccess:YES]; +} + +#pragma mark - +#pragma mark Pending Actions +#pragma mark - +#pragma mark Pending Actions + +- (void)tryPendingAction +{ + switch (pendingAction) + { + case SHKPendingRefreshToken: + [self tryToSend]; // try to resend + break; + + default: + [super tryPendingAction]; + } +} + + +@end diff --git a/Classes/ShareKit/Core/Base Sharer Classes/SHKSharer.h b/Classes/ShareKit/Core/Base Sharer Classes/SHKSharer.h new file mode 100644 index 00000000..e608d072 --- /dev/null +++ b/Classes/ShareKit/Core/Base Sharer Classes/SHKSharer.h @@ -0,0 +1,187 @@ +// +// SHKSharer.h +// ShareKit +// +// Created by Nathan Weiner on 6/8/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import +#import "SHK.h" +#import "SHKCustomFormController.h" + + +@class SHKSharer; + +@protocol SHKSharerDelegate + +- (void)sharerStartedSending:(SHKSharer *)sharer; +- (void)sharerFinishedSending:(SHKSharer *)sharer; +- (void)sharer:(SHKSharer *)sharer failedWithError:(NSError *)error shouldRelogin:(BOOL)shouldRelogin; +- (void)sharerCancelledSending:(SHKSharer *)sharer; + +@end + + +typedef enum +{ + SHKPendingNone, + SHKPendingShare, + SHKPendingRefreshToken +} SHKSharerPendingAction; + + +@interface SHKSharer : UINavigationController +{ + id shareDelegate; + + SHKItem *item; + SHKFormController *pendingForm; + SHKRequest *request; + + NSError *lastError; + + BOOL quiet; + SHKSharerPendingAction pendingAction; +} + +@property (nonatomic, retain) id shareDelegate; + +@property (retain) SHKItem *item; +@property (retain) SHKFormController *pendingForm; +@property (retain) SHKRequest *request; + +@property (nonatomic, retain) NSError *lastError; + +@property BOOL quiet; +@property SHKSharerPendingAction pendingAction; + + + +#pragma mark - +#pragma mark Configuration : Service Defination + ++ (NSString *)sharerTitle; +- (NSString *)sharerTitle; ++ (NSString *)sharerId; +- (NSString *)sharerId; ++ (BOOL)canShareText; ++ (BOOL)canShareURL; ++ (BOOL)canShareImage; ++ (BOOL)canShareFile; ++ (BOOL)shareRequiresInternetConnection; ++ (BOOL)canShareOffline; ++ (BOOL)requiresAuthentication; ++ (BOOL)canShareType:(SHKShareType)type; ++ (BOOL)canAutoShare; + + +#pragma mark - +#pragma mark Configuration : Dynamic Enable + ++ (BOOL)canShare; +- (BOOL)shouldAutoShare; + +#pragma mark - +#pragma mark Initialization + +- (id)init; + + +#pragma mark - +#pragma mark Share Item Loading Convenience Methods + ++ (id)shareItem:(SHKItem *)i; + ++ (id)shareURL:(NSURL *)url; ++ (id)shareURL:(NSURL *)url title:(NSString *)title; + ++ (id)shareImage:(UIImage *)image title:(NSString *)title; + ++ (id)shareText:(NSString *)text; + ++ (id)shareFile:(NSData *)file filename:(NSString *)filename mimeType:(NSString *)mimeType title:(NSString *)title; + + +#pragma mark - +#pragma mark Commit Share + +- (void)share; + +#pragma mark - +#pragma mark Authentication + +- (BOOL)isAuthorized; +- (BOOL)authorize; +- (void)promptAuthorization; +- (NSString *)getAuthValueForKey:(NSString *)key; + +#pragma mark Authorization Form + +- (void)authorizationFormShow; +- (void)authorizationFormValidate:(SHKFormController *)form; +- (void)authorizationFormSave:(SHKFormController *)form; +- (NSArray *)authorizationFormFields; +- (NSString *)authorizationFormCaption; ++ (NSArray *)authorizationFormFields; ++ (NSString *)authorizationFormCaption; ++ (void)logout; ++ (BOOL)isServiceAuthorized; + +#pragma mark - +#pragma mark API Implementation + +- (BOOL)validateItem; +- (BOOL)tryToSend; +- (BOOL)send; + +#pragma mark - +#pragma mark UI Implementation + +- (void)show; + +#pragma mark - +#pragma mark Share Form + +- (NSArray *)shareFormFieldsForType:(SHKShareType)type; +- (void)shareFormValidate:(SHKFormController *)form; +- (void)shareFormSave:(SHKFormController *)form; + +#pragma mark - +#pragma mark Pending Actions + +- (void)tryPendingAction; + +#pragma mark - +#pragma mark Delegate Notifications + +- (void)sendDidStart; +- (void)sendDidFinish; +- (void)sendDidFailShouldRelogin; +- (void)sendDidFailWithError:(NSError *)error; +- (void)sendDidFailWithError:(NSError *)error shouldRelogin:(BOOL)shouldRelogin; +- (void)sendDidCancel; + +@end + + + diff --git a/Classes/ShareKit/Core/Base Sharer Classes/SHKSharer.m b/Classes/ShareKit/Core/Base Sharer Classes/SHKSharer.m new file mode 100644 index 00000000..01b5834b --- /dev/null +++ b/Classes/ShareKit/Core/Base Sharer Classes/SHKSharer.m @@ -0,0 +1,733 @@ + // +// SHKSharer.m +// ShareKit +// +// Created by Nathan Weiner on 6/8/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKSharer.h" +#import "SHKActivityIndicator.h" + +@implementation SHKSharer + +@synthesize shareDelegate; +@synthesize item, pendingForm, request; +@synthesize lastError; +@synthesize quiet, pendingAction; + +- (void)dealloc +{ + [item release]; + [shareDelegate release]; + [pendingForm release]; + [request release]; + [lastError release]; + + [super dealloc]; +} + + +#pragma mark - +#pragma mark Configuration : Service Defination + +// Each service should subclass these and return YES/NO to indicate what type of sharing they support. +// Superclass defaults to NO so that subclasses only need to add methods for types they support + ++ (NSString *)sharerTitle +{ + return @""; +} + +- (NSString *)sharerTitle +{ + return [[self class] sharerTitle]; +} + ++ (NSString *)sharerId +{ + return NSStringFromClass([self class]); +} + +- (NSString *)sharerId +{ + return [[self class] sharerId]; +} + ++ (BOOL)canShareText +{ + return NO; +} + ++ (BOOL)canShareURL +{ + return NO; +} + ++ (BOOL)canShareImage +{ + return NO; +} + ++ (BOOL)canShareFile +{ + return NO; +} + ++ (BOOL)shareRequiresInternetConnection +{ + return YES; +} + ++ (BOOL)canShareOffline +{ + return YES; +} + ++ (BOOL)requiresAuthentication +{ + return YES; +} + ++ (BOOL)canShareType:(SHKShareType)type +{ + switch (type) + { + case SHKShareTypeURL: + return [self canShareURL]; + break; + + case SHKShareTypeImage: + return [self canShareImage]; + break; + + case SHKShareTypeText: + return [self canShareText]; + break; + + case SHKShareTypeFile: + return [self canShareFile]; + break; + + default: + return NO; + } + return NO; +} + ++ (BOOL)canAutoShare +{ + return YES; +} + + + +#pragma mark - +#pragma mark Configuration : Dynamic Enable + +// Allows a subclass to programically disable/enable services depending on the current environment + ++ (BOOL)canShare +{ + return YES; +} + +- (BOOL)shouldAutoShare +{ + return [[NSUserDefaults standardUserDefaults] boolForKey:[NSString stringWithFormat:@"%@_shouldAutoShare", [self sharerId]]]; +} + + +#pragma mark - +#pragma mark Initialization + +- (id)init +{ + if (self = [super initWithNibName:nil bundle:nil]) + { + self.shareDelegate = self; + self.item = [[[SHKItem alloc] init] autorelease]; + + if ([self respondsToSelector:@selector(modalPresentationStyle)]) + self.modalPresentationStyle = [SHK modalPresentationStyle]; + + if ([self respondsToSelector:@selector(modalTransitionStyle)]) + self.modalTransitionStyle = [SHK modalTransitionStyle]; + } + return self; +} + + +#pragma mark - +#pragma mark Share Item Loading Convenience Methods + ++ (id)shareItem:(SHKItem *)i +{ + [SHK pushOnFavorites:[self sharerId] forType:i.shareType]; + + // Create controller and set share options + SHKSharer *controller = [[self alloc] init]; + controller.item = i; + + // share and/or show UI + [controller share]; + + return [controller autorelease]; +} + ++ (id)shareURL:(NSURL *)url +{ + return [self shareURL:url title:nil]; +} + ++ (id)shareURL:(NSURL *)url title:(NSString *)title +{ + // Create controller and set share options + SHKSharer *controller = [[self alloc] init]; + controller.item.shareType = SHKShareTypeURL; + controller.item.URL = url; + controller.item.title = title; + + // share and/or show UI + [controller share]; + + return [controller autorelease]; +} + ++ (id)shareImage:(UIImage *)image title:(NSString *)title +{ + // Create controller and set share options + SHKSharer *controller = [[self alloc] init]; + controller.item.shareType = SHKShareTypeImage; + controller.item.image = image; + controller.item.title = title; + + // share and/or show UI + [controller share]; + + return [controller autorelease]; +} + ++ (id)shareText:(NSString *)text +{ + // Create controller and set share options + SHKSharer *controller = [[self alloc] init]; + controller.item.shareType = SHKShareTypeText; + controller.item.text = text; + + // share and/or show UI + [controller share]; + + return [controller autorelease]; +} + ++ (id)shareFile:(NSData *)file filename:(NSString *)filename mimeType:(NSString *)mimeType title:(NSString *)title +{ + // Create controller and set share options + SHKSharer *controller = [[self alloc] init]; + controller.item.shareType = SHKShareTypeFile; + controller.item.data = file; + controller.item.filename = filename; + controller.item.mimeType = mimeType; + controller.item.title = title; + + // share and/or show UI + [controller share]; + + return [controller autorelease]; +} + + +#pragma mark - +#pragma mark Commit Share + +- (void)share +{ + // isAuthorized - If service requires login and details have not been saved, present login dialog + if (![self authorize]) + self.pendingAction = SHKPendingShare; + + // A. First check if auto share is set + // B. If it is, try to send + // If either A or B fail, display the UI + else if (![self shouldAutoShare] || ![self tryToSend]) + [self show]; +} + + +#pragma mark - +#pragma mark Authentication + +- (BOOL)isAuthorized +{ + if (![[self class] requiresAuthentication]) + return YES; + + // Checks to make sure we just have at least one variable from the authorization form + // If the send request fails it'll reprompt the user for their new login anyway + + NSString *sharerId = [self sharerId]; + NSArray *fields = [self authorizationFormFields]; + for (SHKFormFieldSettings *field in fields) + { + if ([SHK getAuthValueForKey:field.key forSharer:sharerId] != nil) + return YES; + } + + return NO; +} + +- (BOOL)authorize +{ + if ([self isAuthorized]) + return YES; + + else + [self promptAuthorization]; + + return NO; +} + +- (void)promptAuthorization +{ + if ([[self class] shareRequiresInternetConnection] && ![SHK connected]) + { + if (!quiet) + { + [[[[UIAlertView alloc] initWithTitle:SHKLocalizedString(@"Offline") + message:SHKLocalizedString(@"You must be online to login to %@", [self sharerTitle]) + delegate:nil + cancelButtonTitle:SHKLocalizedString(@"Close") + otherButtonTitles:nil] autorelease] show]; + } + return; + } + + [self authorizationFormShow]; +} + +- (NSString *)getAuthValueForKey:(NSString *)key +{ + return [SHK getAuthValueForKey:key forSharer:[self sharerId]]; +} + +- (void)setShouldAutoShare:(BOOL)b +{ + return [[NSUserDefaults standardUserDefaults] setBool:b forKey:[NSString stringWithFormat:@"%@_shouldAutoShare", [self sharerId]]]; +} + +#pragma mark Authorization Form + +- (void)authorizationFormShow +{ + // Create the form + SHKCustomFormController *form = [[SHKCustomFormController alloc] initWithStyle:UITableViewStyleGrouped title:SHKLocalizedString(@"Login") rightButtonTitle:SHKLocalizedString(@"Login")]; + [form addSection:[self authorizationFormFields] header:nil footer:[self authorizationFormCaption]]; + form.delegate = self; + form.validateSelector = @selector(authorizationFormValidate:); + form.saveSelector = @selector(authorizationFormSave:); + form.autoSelect = YES; + + [[SHK currentHelper] showViewController:form]; + [form release]; +} + +- (void)authorizationFormValidate:(SHKFormController *)form +{ + /* + + Services should subclass this. + You can get a dictionary of the field values from [form formValues] + + -- + + You should perform one of the following actions: + + 1. Display an error - If the user input was incorrect, display an error to the user and tell them what to do to fix it + + 2. Save the form - If everything is correct call [form saveForm] + + 3. Display a pending indicator - If you need to authorize the details on the server, display an activity indicator with [form displayActivity:@"DESCRIPTION OF WHAT YOU ARE DOING"] + After your process completes be sure to perform either 1 or 2 above. + + */ +} + +- (void)authorizationFormSave:(SHKFormController *)form +{ + // -- Save values + NSDictionary *formValues = [form formValues]; + + NSString *value; + NSString *sharerId = [self sharerId]; + NSArray *fields = [[[form sections] objectAtIndex:0] objectForKey:@"rows"]; + for(SHKFormFieldSettings *field in fields) + { + value = [formValues objectForKey:field.key]; + [SHK setAuthValue:value forKey:field.key forSharer:sharerId]; + } + + // -- Try to share again + [self share]; +} + +- (NSArray *)authorizationFormFields +{ + return [[self class] authorizationFormFields]; +} + ++ (NSArray *)authorizationFormFields +{ + return [NSArray arrayWithObjects: + [SHKFormFieldSettings label:SHKLocalizedString(@"Username") key:@"username" type:SHKFormFieldTypeText start:nil], + [SHKFormFieldSettings label:SHKLocalizedString(@"Password") key:@"password" type:SHKFormFieldTypePassword start:nil], + nil]; +} + +- (NSString *)authorizationFormCaption +{ + return [[self class] authorizationFormCaption]; +} + ++ (NSString *)authorizationFormCaption +{ + return nil; +} + ++ (void)logout +{ + NSString *sharerId = [self sharerId]; + NSArray *authFields = [self authorizationFormFields]; + if (authFields != nil) + { + for(SHKFormFieldSettings *field in authFields) + [SHK removeAuthValueForKey:field.key forSharer:sharerId]; + } +} + +// Credit: GreatWiz ++ (BOOL)isServiceAuthorized +{ + SHKSharer *controller = [[self alloc] init]; + BOOL isAuthorized = [controller isAuthorized]; + [controller release]; + + return isAuthorized; +} + + + + +#pragma mark - +#pragma mark UI Implementation + +- (void)show +{ + NSArray *shareFormFields = [self shareFormFieldsForType:item.shareType]; + + if (shareFormFields == nil) + [self tryToSend]; + + else + { + SHKCustomFormController *rootView = [[SHKCustomFormController alloc] initWithStyle:UITableViewStyleGrouped + title:nil + rightButtonTitle:SHKLocalizedString(@"Send to %@", [[self class] sharerTitle]) + ]; + [rootView addSection:[self shareFormFieldsForType:item.shareType] header:nil footer:item.URL!=nil?item.URL.absoluteString:nil]; + + if ([[self class] canAutoShare]) + { + [rootView addSection: + [NSArray arrayWithObject: + [SHKFormFieldSettings label:SHKLocalizedString(@"Auto Share") key:@"autoShare" type:SHKFormFieldTypeSwitch start:([self shouldAutoShare]?SHKFormFieldSwitchOn:SHKFormFieldSwitchOff)] + ] + header:nil + footer:SHKLocalizedString(@"Enable auto share to skip this step in the future.")]; + } + + rootView.delegate = self; + rootView.validateSelector = @selector(shareFormValidate:); + rootView.saveSelector = @selector(shareFormSave:); + + [self pushViewController:rootView animated:NO]; + + [[SHK currentHelper] showViewController:self]; + } +} + + + + +#pragma mark - +#pragma mark Share Form + +- (NSArray *)shareFormFieldsForType:(SHKShareType)type +{ + if (type == SHKShareTypeURL) + return [NSArray arrayWithObjects: + [SHKFormFieldSettings label:SHKLocalizedString(@"Title") key:@"title" type:SHKFormFieldTypeText start:item.title], + nil]; + + return nil; +} + +- (void)shareFormValidate:(SHKCustomFormController *)form +{ + /* + + Services should subclass this if they need to validate any data before sending. + You can get a dictionary of the field values from [form formValues] + + -- + + You should perform one of the following actions: + + 1. Display an error - If the user input was incorrect, display an error to the user and tell them what to do to fix it + + 2. Save the form - If everything is correct call [form save] + + 3. Display a pending indicator - If you need to authorize the details on the server, display an activity indicator with [form displayActivity:@"DESCRIPTION OF WHAT YOU ARE DOING"] + After your process completes be sure to perform either 1 or 2 above. + + */ + + + // default does no checking and proceeds to share + [form saveForm]; +} + +- (void)shareFormSave:(SHKFormController *)form +{ + // Update item with new values from form + NSDictionary *formValues = [form formValues]; + for(NSString *key in formValues) + { + if ([key isEqualToString:@"title"]) + item.title = [formValues objectForKey:key]; + + else if ([key isEqualToString:@"text"]) + item.text = [formValues objectForKey:key]; + + else if ([key isEqualToString:@"tags"]) + item.tags = [formValues objectForKey:key]; + + else + [item setCustomValue:[formValues objectForKey:key] forKey:key]; + } + + // Update shouldAutoShare + if ([[self class] canAutoShare]) + { + NSDictionary *advancedOptions = [form formValuesForSection:1]; + if ([advancedOptions objectForKey:@"autoShare"] != nil) + [self setShouldAutoShare:[[advancedOptions objectForKey:@"autoShare"] isEqualToString:SHKFormFieldSwitchOn]]; + } + + // Send the share + [self tryToSend]; +} + + +#pragma mark - +#pragma mark API Implementation + +- (BOOL)validateItem +{ + switch (item.shareType) + { + case SHKShareTypeURL: + return (item.URL != nil); + break; + + case SHKShareTypeImage: + return (item.image != nil); + break; + + case SHKShareTypeText: + return (item.text != nil); + break; + + case SHKShareTypeFile: + return (item.data != nil); + break; + } + + return NO; +} + +- (BOOL)tryToSend +{ + if (![[self class] shareRequiresInternetConnection] || [SHK connected]) + return [self send]; + + else if ([[self class] canShareOffline]) + return [SHK addToOfflineQueue:item forSharer:[self sharerId]]; + + else if (!quiet) + { + [[[[UIAlertView alloc] initWithTitle:SHKLocalizedString(@"Offline") + message:SHKLocalizedString(@"You must be online in order to share with %@", [self sharerTitle]) + delegate:nil + cancelButtonTitle:SHKLocalizedString(@"Close") + otherButtonTitles:nil] autorelease] show]; + + return YES; + } + + + return NO; +} + +- (BOOL)send +{ + // Does not actually send anything. + // Your subclass should implement the sending logic. + // There is no reason to call [super send] in your subclass + + // You should never call [XXX send] directly, you should use [XXX tryToSend]. TryToSend will perform an online check before trying to send. + return NO; +} + +#pragma mark - +#pragma mark Default UI Updating + +// These are used if you do not provide your own custom UI and delegate + + +- (void)sharerStartedSending:(SHKSharer *)sharer +{ + if (!quiet) + [[SHKActivityIndicator currentIndicator] displayActivity:SHKLocalizedString(@"Saving to %@", [[self class] sharerTitle])]; +} + +- (void)sharerFinishedSending:(SHKSharer *)sharer +{ + if (!quiet) + [[SHKActivityIndicator currentIndicator] displayCompleted:SHKLocalizedString(@"Saved!")]; +} + +- (void)sharer:(SHKSharer *)sharer failedWithError:(NSError *)error shouldRelogin:(BOOL)shouldRelogin +{ + if (!quiet) + { + [[SHKActivityIndicator currentIndicator] hide]; + + [[[[UIAlertView alloc] initWithTitle:SHKLocalizedString(@"Error") + message:sharer.lastError!=nil?[sharer.lastError localizedDescription]:SHKLocalizedString(@"There was an error while sharing") + delegate:nil + cancelButtonTitle:SHKLocalizedString(@"Close") + otherButtonTitles:nil] autorelease] show]; + + if (shouldRelogin) + [self promptAuthorization]; + } +} + +- (void)sharerCancelledSending:(SHKSharer *)sharer +{ + +} + +#pragma mark - +#pragma mark Pending Actions + +- (void)tryPendingAction +{ + switch (pendingAction) + { + case SHKPendingShare: + [self share]; + break; + default: + break; + + } +} + + + +#pragma mark - + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + +- (void)viewDidDisappear:(BOOL)animated +{ + [super viewDidDisappear:animated]; + + // Remove the SHK view wrapper from the window + [[SHK currentHelper] viewWasDismissed]; +} + + +#pragma mark - +#pragma mark Delegate Notifications + +- (void)sendDidStart +{ + if ([shareDelegate respondsToSelector:@selector(sharerStartedSending:)]) + [shareDelegate performSelector:@selector(sharerStartedSending:) withObject:self]; + + [[NSNotificationCenter defaultCenter] postNotificationName:@"SHKSendDidStartNotification" object:self]; +} + +- (void)sendDidFinish +{ + if ([shareDelegate respondsToSelector:@selector(sharerFinishedSending:)]) + [shareDelegate performSelector:@selector(sharerFinishedSending:) withObject:self]; + + [[NSNotificationCenter defaultCenter] postNotificationName:@"SHKSendDidFinish" object:self]; +} + +- (void)sendDidFailShouldRelogin +{ + [self sendDidFailWithError:[SHK error:SHKLocalizedString(@"Could not authenticate you. Please relogin.")] shouldRelogin:YES]; +} + +- (void)sendDidFailWithError:(NSError *)error +{ + [self sendDidFailWithError:error shouldRelogin:NO]; +} + +- (void)sendDidFailWithError:(NSError *)error shouldRelogin:(BOOL)shouldRelogin +{ + self.lastError = error; + + if ([shareDelegate respondsToSelector:@selector(sharer:failedWithError:shouldRelogin:)]) + [(SHKSharer *)shareDelegate sharer:self failedWithError:error shouldRelogin:shouldRelogin]; + + [[NSNotificationCenter defaultCenter] postNotificationName:@"SHKSendDidFailWithError" object:self]; +} + +- (void)sendDidCancel +{ + if ([shareDelegate respondsToSelector:@selector(sharerCancelledSending:)]) + [shareDelegate performSelector:@selector(sharerCancelledSending:) withObject:self]; + + [[NSNotificationCenter defaultCenter] postNotificationName:@"SHKSendDidCancel" object:self]; +} + + +@end diff --git a/Classes/ShareKit/Core/Categories/NSData+md5.h b/Classes/ShareKit/Core/Categories/NSData+md5.h new file mode 100644 index 00000000..9217265c --- /dev/null +++ b/Classes/ShareKit/Core/Categories/NSData+md5.h @@ -0,0 +1,3 @@ +@interface NSData (md5) +- (NSString *) md5; +@end \ No newline at end of file diff --git a/Classes/ShareKit/Core/Categories/NSData+md5.m b/Classes/ShareKit/Core/Categories/NSData+md5.m new file mode 100644 index 00000000..d106489e --- /dev/null +++ b/Classes/ShareKit/Core/Categories/NSData+md5.m @@ -0,0 +1,22 @@ +#import "NSData+md5.h" +#import + +@implementation NSData (md5) + +-(NSString*)md5{ + const char *cStr = [self bytes]; + unsigned char digest[CC_MD5_DIGEST_LENGTH]; + CC_MD5( cStr, [self length], digest ); + NSString* s = [NSString stringWithFormat: @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", + digest[0], digest[1], + digest[2], digest[3], + digest[4], digest[5], + digest[6], digest[7], + digest[8], digest[9], + digest[10], digest[11], + digest[12], digest[13], + digest[14], digest[15]]; + return s; +} + +@end \ No newline at end of file diff --git a/Classes/ShareKit/Core/Categories/UIWebView+SHK.h b/Classes/ShareKit/Core/Categories/UIWebView+SHK.h new file mode 100644 index 00000000..94d420a7 --- /dev/null +++ b/Classes/ShareKit/Core/Categories/UIWebView+SHK.h @@ -0,0 +1,38 @@ +// +// UIWebView+SHK.h +// ShareKit +// +// Created by Nathan Weiner on 6/16/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import + + +@interface UIWebView (SHK) + +// Retrieves the title from the page loaded in a UIWebView +// Useful for providing a title when sharing URLs + +- (NSString *)pageTitle; + +@end diff --git a/Classes/ShareKit/Core/Categories/UIWebView+SHK.m b/Classes/ShareKit/Core/Categories/UIWebView+SHK.m new file mode 100644 index 00000000..3570617f --- /dev/null +++ b/Classes/ShareKit/Core/Categories/UIWebView+SHK.m @@ -0,0 +1,37 @@ +// +// UIWebView+SHK.m +// ShareKit +// +// Created by Nathan Weiner on 6/16/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "UIWebView+SHK.h" + +@implementation UIWebView (SHK) + +- (NSString *)pageTitle +{ + return [self stringByEvaluatingJavaScriptFromString:@"document.title"]; +} + +@end diff --git a/Classes/ShareKit/Core/Helpers/Keychain/SFHFKeychainUtils.h b/Classes/ShareKit/Core/Helpers/Keychain/SFHFKeychainUtils.h new file mode 100644 index 00000000..70b83aca --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/Keychain/SFHFKeychainUtils.h @@ -0,0 +1,41 @@ +// +// SFHFKeychainUtils.h +// +// Created by Buzz Andersen on 10/20/08. +// Based partly on code by Jonathan Wight, Jon Crosby, and Mike Malone. +// Copyright 2008 Sci-Fi Hi-Fi. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + +#import + + +@interface SFHFKeychainUtils : NSObject { + +} + ++ (NSString *) getPasswordForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error; ++ (BOOL) storeUsername: (NSString *) username andPassword: (NSString *) password forServiceName: (NSString *) serviceName updateExisting: (BOOL) updateExisting error: (NSError **) error; ++ (BOOL) deleteItemForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error; + +@end \ No newline at end of file diff --git a/Classes/ShareKit/Core/Helpers/Keychain/SFHFKeychainUtils.m b/Classes/ShareKit/Core/Helpers/Keychain/SFHFKeychainUtils.m new file mode 100644 index 00000000..b05ed5f8 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/Keychain/SFHFKeychainUtils.m @@ -0,0 +1,434 @@ +// +// SFHFKeychainUtils.m +// +// Created by Buzz Andersen on 10/20/08. +// Based partly on code by Jonathan Wight, Jon Crosby, and Mike Malone. +// Copyright 2008 Sci-Fi Hi-Fi. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. +// + +#import "SFHFKeychainUtils.h" +#import + +static NSString *SFHFKeychainUtilsErrorDomain = @"SFHFKeychainUtilsErrorDomain"; + +#if __IPHONE_OS_VERSION_MIN_REQUIRED < 30000 && TARGET_IPHONE_SIMULATOR +@interface SFHFKeychainUtils (PrivateMethods) ++ (SecKeychainItemRef) getKeychainItemReferenceForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error; +@end +#endif + +@implementation SFHFKeychainUtils + +#if __IPHONE_OS_VERSION_MIN_REQUIRED < 30000 && TARGET_IPHONE_SIMULATOR + ++ (NSString *) getPasswordForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error { + if (!username || !serviceName) { + *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: -2000 userInfo: nil]; + return nil; + } + + SecKeychainItemRef item = [SFHFKeychainUtils getKeychainItemReferenceForUsername: username andServiceName: serviceName error: error]; + + if (*error || !item) { + return nil; + } + + // from Advanced Mac OS X Programming, ch. 16 + UInt32 length; + char *password; + SecKeychainAttribute attributes[8]; + SecKeychainAttributeList list; + + attributes[0].tag = kSecAccountItemAttr; + attributes[1].tag = kSecDescriptionItemAttr; + attributes[2].tag = kSecLabelItemAttr; + attributes[3].tag = kSecModDateItemAttr; + + list.count = 4; + list.attr = attributes; + + OSStatus status = SecKeychainItemCopyContent(item, NULL, &list, &length, (void **)&password); + + if (status != noErr) { + *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: status userInfo: nil]; + return nil; + } + + NSString *passwordString = nil; + + if (password != NULL) { + char passwordBuffer[1024]; + + if (length > 1023) { + length = 1023; + } + strncpy(passwordBuffer, password, length); + + passwordBuffer[length] = '\0'; + passwordString = [NSString stringWithCString:passwordBuffer]; + } + + SecKeychainItemFreeContent(&list, password); + + CFRelease(item); + + return passwordString; +} + ++ (void) storeUsername: (NSString *) username andPassword: (NSString *) password forServiceName: (NSString *) serviceName updateExisting: (BOOL) updateExisting error: (NSError **) error { + if (!username || !password || !serviceName) { + *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: -2000 userInfo: nil]; + return; + } + + OSStatus status = noErr; + + SecKeychainItemRef item = [SFHFKeychainUtils getKeychainItemReferenceForUsername: username andServiceName: serviceName error: error]; + + if (*error && [*error code] != noErr) { + return; + } + + *error = nil; + + if (item) { + status = SecKeychainItemModifyAttributesAndData(item, + NULL, + strlen([password UTF8String]), + [password UTF8String]); + + CFRelease(item); + } + else { + status = SecKeychainAddGenericPassword(NULL, + strlen([serviceName UTF8String]), + [serviceName UTF8String], + strlen([username UTF8String]), + [username UTF8String], + strlen([password UTF8String]), + [password UTF8String], + NULL); + } + + if (status != noErr) { + *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: status userInfo: nil]; + } +} + ++ (void) deleteItemForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error { + if (!username || !serviceName) { + *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: 2000 userInfo: nil]; + return; + } + + *error = nil; + + SecKeychainItemRef item = [SFHFKeychainUtils getKeychainItemReferenceForUsername: username andServiceName: serviceName error: error]; + + if (*error && [*error code] != noErr) { + return; + } + + OSStatus status; + + if (item) { + status = SecKeychainItemDelete(item); + + CFRelease(item); + } + + if (status != noErr) { + *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: status userInfo: nil]; + } +} + ++ (SecKeychainItemRef) getKeychainItemReferenceForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error { + if (!username || !serviceName) { + *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: -2000 userInfo: nil]; + return nil; + } + + *error = nil; + + SecKeychainItemRef item; + + OSStatus status = SecKeychainFindGenericPassword(NULL, + strlen([serviceName UTF8String]), + [serviceName UTF8String], + strlen([username UTF8String]), + [username UTF8String], + NULL, + NULL, + &item); + + if (status != noErr) { + if (status != errSecItemNotFound) { + *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: status userInfo: nil]; + } + + return nil; + } + + return item; +} + +#else + ++ (NSString *) getPasswordForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error { + if (!username || !serviceName) { + if (error != nil) { + *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: -2000 userInfo: nil]; + } + return nil; + } + + if (error != nil) { + *error = nil; + } + + // Set up a query dictionary with the base query attributes: item type (generic), username, and service + + NSArray *keys = [[[NSArray alloc] initWithObjects: (NSString *) kSecClass, kSecAttrAccount, kSecAttrService, nil] autorelease]; + NSArray *objects = [[[NSArray alloc] initWithObjects: (NSString *) kSecClassGenericPassword, username, serviceName, nil] autorelease]; + + NSMutableDictionary *query = [[[NSMutableDictionary alloc] initWithObjects: objects forKeys: keys] autorelease]; + + // First do a query for attributes, in case we already have a Keychain item with no password data set. + // One likely way such an incorrect item could have come about is due to the previous (incorrect) + // version of this code (which set the password as a generic attribute instead of password data). + + NSDictionary *attributeResult = NULL; + NSMutableDictionary *attributeQuery = [query mutableCopy]; + [attributeQuery setObject: (id) kCFBooleanTrue forKey:(id) kSecReturnAttributes]; + OSStatus status = SecItemCopyMatching((CFDictionaryRef) attributeQuery, (CFTypeRef *) &attributeResult); + + [attributeResult release]; + [attributeQuery release]; + + if (status != noErr) { + // No existing item found--simply return nil for the password + if (error != nil && status != errSecItemNotFound) { + //Only return an error if a real exception happened--not simply for "not found." + *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: status userInfo: nil]; + } + + return nil; + } + + // We have an existing item, now query for the password data associated with it. + + NSData *resultData = nil; + NSMutableDictionary *passwordQuery = [query mutableCopy]; + [passwordQuery setObject: (id) kCFBooleanTrue forKey: (id) kSecReturnData]; + + status = SecItemCopyMatching((CFDictionaryRef) passwordQuery, (CFTypeRef *) &resultData); + + [resultData autorelease]; + [passwordQuery release]; + + if (status != noErr) { + if (status == errSecItemNotFound) { + // We found attributes for the item previously, but no password now, so return a special error. + // Users of this API will probably want to detect this error and prompt the user to + // re-enter their credentials. When you attempt to store the re-entered credentials + // using storeUsername:andPassword:forServiceName:updateExisting:error + // the old, incorrect entry will be deleted and a new one with a properly encrypted + // password will be added. + if (error != nil) { + *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: -1999 userInfo: nil]; + } + } + else { + // Something else went wrong. Simply return the normal Keychain API error code. + if (error != nil) { + *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: status userInfo: nil]; + } + } + + return nil; + } + + NSString *password = nil; + + if (resultData) { + password = [[NSString alloc] initWithData: resultData encoding: NSUTF8StringEncoding]; + } + else { + // There is an existing item, but we weren't able to get password data for it for some reason, + // Possibly as a result of an item being incorrectly entered by the previous code. + // Set the -1999 error so the code above us can prompt the user again. + if (error != nil) { + *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: -1999 userInfo: nil]; + } + } + + return [password autorelease]; +} + ++ (BOOL) storeUsername: (NSString *) username andPassword: (NSString *) password forServiceName: (NSString *) serviceName updateExisting: (BOOL) updateExisting error: (NSError **) error +{ + if (!username || !password || !serviceName) + { + if (error != nil) + { + *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: -2000 userInfo: nil]; + } + return NO; + } + + // See if we already have a password entered for these credentials. + NSError *getError = nil; + NSString *existingPassword = [SFHFKeychainUtils getPasswordForUsername: username andServiceName: serviceName error:&getError]; + + if ([getError code] == -1999) + { + // There is an existing entry without a password properly stored (possibly as a result of the previous incorrect version of this code. + // Delete the existing item before moving on entering a correct one. + + getError = nil; + + [self deleteItemForUsername: username andServiceName: serviceName error: &getError]; + + if ([getError code] != noErr) + { + if (error != nil) + { + *error = getError; + } + return NO; + } + } + else if ([getError code] != noErr) + { + if (error != nil) + { + *error = getError; + } + return NO; + } + + if (error != nil) + { + *error = nil; + } + + OSStatus status = noErr; + + if (existingPassword) + { + // We have an existing, properly entered item with a password. + // Update the existing item. + + if (![existingPassword isEqualToString:password] && updateExisting) + { + //Only update if we're allowed to update existing. If not, simply do nothing. + + NSArray *keys = [[[NSArray alloc] initWithObjects: (NSString *) kSecClass, + kSecAttrService, + kSecAttrLabel, + kSecAttrAccount, + nil] autorelease]; + + NSArray *objects = [[[NSArray alloc] initWithObjects: (NSString *) kSecClassGenericPassword, + serviceName, + serviceName, + username, + nil] autorelease]; + + NSDictionary *query = [[[NSDictionary alloc] initWithObjects: objects forKeys: keys] autorelease]; + + status = SecItemUpdate((CFDictionaryRef) query, (CFDictionaryRef) [NSDictionary dictionaryWithObject: [password dataUsingEncoding: NSUTF8StringEncoding] forKey: (NSString *) kSecValueData]); + } + } + else + { + // No existing entry (or an existing, improperly entered, and therefore now + // deleted, entry). Create a new entry. + + NSArray *keys = [[[NSArray alloc] initWithObjects: (NSString *) kSecClass, + kSecAttrService, + kSecAttrLabel, + kSecAttrAccount, + kSecValueData, + nil] autorelease]; + + NSArray *objects = [[[NSArray alloc] initWithObjects: (NSString *) kSecClassGenericPassword, + serviceName, + serviceName, + username, + [password dataUsingEncoding: NSUTF8StringEncoding], + nil] autorelease]; + + NSDictionary *query = [[[NSDictionary alloc] initWithObjects: objects forKeys: keys] autorelease]; + + status = SecItemAdd((CFDictionaryRef) query, NULL); + } + + if (error != nil && status != noErr) + { + // Something went wrong with adding the new item. Return the Keychain error code. + *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: status userInfo: nil]; + + return NO; + } + + return YES; +} + ++ (BOOL) deleteItemForUsername: (NSString *) username andServiceName: (NSString *) serviceName error: (NSError **) error +{ + if (!username || !serviceName) + { + if (error != nil) + { + *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: -2000 userInfo: nil]; + } + return NO; + } + + if (error != nil) + { + *error = nil; + } + + NSArray *keys = [[[NSArray alloc] initWithObjects: (NSString *) kSecClass, kSecAttrAccount, kSecAttrService, kSecReturnAttributes, nil] autorelease]; + NSArray *objects = [[[NSArray alloc] initWithObjects: (NSString *) kSecClassGenericPassword, username, serviceName, kCFBooleanTrue, nil] autorelease]; + + NSDictionary *query = [[[NSDictionary alloc] initWithObjects: objects forKeys: keys] autorelease]; + + OSStatus status = SecItemDelete((CFDictionaryRef) query); + + if (error != nil && status != noErr) + { + *error = [NSError errorWithDomain: SFHFKeychainUtilsErrorDomain code: status userInfo: nil]; + + return NO; + } + + return YES; +} + +#endif + +@end \ No newline at end of file diff --git a/Classes/ShareKit/Core/Helpers/OAuth/Categories/NSMutableURLRequest+Parameters.h b/Classes/ShareKit/Core/Helpers/OAuth/Categories/NSMutableURLRequest+Parameters.h new file mode 100755 index 00000000..13bf9afa --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/Categories/NSMutableURLRequest+Parameters.h @@ -0,0 +1,35 @@ +// +// NSMutableURLRequest+Parameters.h +// +// Created by Jon Crosby on 10/19/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import +#import "OARequestParameter.h" +#import "NSURL+Base.h" + + +@interface NSMutableURLRequest (OAParameterAdditions) + +- (NSArray *)parameters; +- (void)setParameters:(NSArray *)parameters; + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/Categories/NSMutableURLRequest+Parameters.m b/Classes/ShareKit/Core/Helpers/OAuth/Categories/NSMutableURLRequest+Parameters.m new file mode 100755 index 00000000..24035ed8 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/Categories/NSMutableURLRequest+Parameters.m @@ -0,0 +1,97 @@ +// +// NSMutableURLRequest+Parameters.m +// +// Created by Jon Crosby on 10/19/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import "NSMutableURLRequest+Parameters.h" + + +@implementation NSMutableURLRequest (OAParameterAdditions) + +- (NSArray *)parameters +{ + NSString *encodedParameters; + BOOL shouldfree = NO; + + if ([[self HTTPMethod] isEqualToString:@"GET"] || [[self HTTPMethod] isEqualToString:@"DELETE"]) + encodedParameters = [[self URL] query]; + else + { + // POST, PUT + shouldfree = YES; + encodedParameters = [[NSString alloc] initWithData:[self HTTPBody] encoding:NSASCIIStringEncoding]; + } + + if ((encodedParameters == nil) || ([encodedParameters isEqualToString:@""])) + { + if (shouldfree) + [encodedParameters release]; + + return nil; + } + + NSArray *encodedParameterPairs = [encodedParameters componentsSeparatedByString:@"&"]; + NSMutableArray *requestParameters = [[[NSMutableArray alloc] initWithCapacity:16] autorelease]; + + for (NSString *encodedPair in encodedParameterPairs) + { + NSArray *encodedPairElements = [encodedPair componentsSeparatedByString:@"="]; + OARequestParameter *parameter = [OARequestParameter requestParameterWithName:[[encodedPairElements objectAtIndex:0] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding] + value:[[encodedPairElements objectAtIndex:1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; + [requestParameters addObject:parameter]; + } + + // Cleanup + if (shouldfree) + [encodedParameters release]; + + return requestParameters; +} + +- (void)setParameters:(NSArray *)parameters +{ + NSMutableString *encodedParameterPairs = [NSMutableString stringWithCapacity:256]; + + int position = 1; + for (OARequestParameter *requestParameter in parameters) + { + [encodedParameterPairs appendString:[requestParameter URLEncodedNameValuePair]]; + if (position < [parameters count]) + [encodedParameterPairs appendString:@"&"]; + + position++; + } + + if ([[self HTTPMethod] isEqualToString:@"GET"] || [[self HTTPMethod] isEqualToString:@"DELETE"]) + [self setURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@?%@", [[self URL] URLStringWithoutQuery], encodedParameterPairs]]]; + else + { + // POST, PUT + NSData *postData = [encodedParameterPairs dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; + [self setHTTPBody:postData]; + [self setValue:[NSString stringWithFormat:@"%d", [postData length]] forHTTPHeaderField:@"Content-Length"]; + [self setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"]; + } +} + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/Categories/NSString+URLEncoding.h b/Classes/ShareKit/Core/Helpers/OAuth/Categories/NSString+URLEncoding.h new file mode 100755 index 00000000..de06fe77 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/Categories/NSString+URLEncoding.h @@ -0,0 +1,34 @@ +// +// NSString+URLEncoding.h +// +// Created by Jon Crosby on 10/19/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import + + +@interface NSString (OAURLEncodingAdditions) + +- (NSString *)URLEncodedString; +- (NSString *)URLDecodedString; + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/Categories/NSString+URLEncoding.m b/Classes/ShareKit/Core/Helpers/OAuth/Categories/NSString+URLEncoding.m new file mode 100755 index 00000000..540492de --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/Categories/NSString+URLEncoding.m @@ -0,0 +1,52 @@ +// +// NSString+URLEncoding.m +// +// Created by Jon Crosby on 10/19/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import "NSString+URLEncoding.h" + + +@implementation NSString (OAURLEncodingAdditions) + +- (NSString *)URLEncodedString +{ + NSString *result = (NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, + (CFStringRef)self, + NULL, + CFSTR("!*'();:@&=+$,/?%#[]"), + kCFStringEncodingUTF8); + [result autorelease]; + return result; +} + +- (NSString*)URLDecodedString +{ + NSString *result = (NSString *)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(kCFAllocatorDefault, + (CFStringRef)self, + CFSTR(""), + kCFStringEncodingUTF8); + [result autorelease]; + return result; +} + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/Categories/NSURL+Base.h b/Classes/ShareKit/Core/Helpers/OAuth/Categories/NSURL+Base.h new file mode 100755 index 00000000..5d12b696 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/Categories/NSURL+Base.h @@ -0,0 +1,34 @@ +// +// NSURL+Base.h +// OAuthConsumer +// +// Created by Jon Crosby on 10/19/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import + + +@interface NSURL (OABaseAdditions) + +- (NSString *)URLStringWithoutQuery; + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/Categories/NSURL+Base.m b/Classes/ShareKit/Core/Helpers/OAuth/Categories/NSURL+Base.m new file mode 100755 index 00000000..8d4d4209 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/Categories/NSURL+Base.m @@ -0,0 +1,38 @@ +// +// NSURL+Base.m +// OAuthConsumer +// +// Created by Jon Crosby on 10/19/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import "NSURL+Base.h" + + +@implementation NSURL (OABaseAdditions) + +- (NSString *)URLStringWithoutQuery +{ + NSArray *parts = [[self absoluteString] componentsSeparatedByString:@"?"]; + return [parts objectAtIndex:0]; +} + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/Crytpo/Base64Transcoder.c b/Classes/ShareKit/Core/Helpers/OAuth/Crytpo/Base64Transcoder.c new file mode 100755 index 00000000..d110d7a0 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/Crytpo/Base64Transcoder.c @@ -0,0 +1,231 @@ +/* + * Base64Transcoder.c + * Base64Test + * + * Created by Jonathan Wight on Tue Mar 18 2003. + * Copyright (c) 2003 Toxic Software. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#include "Base64Transcoder.h" + +#include +#include + +const u_int8_t kBase64EncodeTable[64] = { + /* 0 */ 'A', /* 1 */ 'B', /* 2 */ 'C', /* 3 */ 'D', + /* 4 */ 'E', /* 5 */ 'F', /* 6 */ 'G', /* 7 */ 'H', + /* 8 */ 'I', /* 9 */ 'J', /* 10 */ 'K', /* 11 */ 'L', + /* 12 */ 'M', /* 13 */ 'N', /* 14 */ 'O', /* 15 */ 'P', + /* 16 */ 'Q', /* 17 */ 'R', /* 18 */ 'S', /* 19 */ 'T', + /* 20 */ 'U', /* 21 */ 'V', /* 22 */ 'W', /* 23 */ 'X', + /* 24 */ 'Y', /* 25 */ 'Z', /* 26 */ 'a', /* 27 */ 'b', + /* 28 */ 'c', /* 29 */ 'd', /* 30 */ 'e', /* 31 */ 'f', + /* 32 */ 'g', /* 33 */ 'h', /* 34 */ 'i', /* 35 */ 'j', + /* 36 */ 'k', /* 37 */ 'l', /* 38 */ 'm', /* 39 */ 'n', + /* 40 */ 'o', /* 41 */ 'p', /* 42 */ 'q', /* 43 */ 'r', + /* 44 */ 's', /* 45 */ 't', /* 46 */ 'u', /* 47 */ 'v', + /* 48 */ 'w', /* 49 */ 'x', /* 50 */ 'y', /* 51 */ 'z', + /* 52 */ '0', /* 53 */ '1', /* 54 */ '2', /* 55 */ '3', + /* 56 */ '4', /* 57 */ '5', /* 58 */ '6', /* 59 */ '7', + /* 60 */ '8', /* 61 */ '9', /* 62 */ '+', /* 63 */ '/' +}; + +/* +-1 = Base64 end of data marker. +-2 = White space (tabs, cr, lf, space) +-3 = Noise (all non whitespace, non-base64 characters) +-4 = Dangerous noise +-5 = Illegal noise (null byte) +*/ + +const int8_t kBase64DecodeTable[128] = { + /* 0x00 */ -5, /* 0x01 */ -3, /* 0x02 */ -3, /* 0x03 */ -3, + /* 0x04 */ -3, /* 0x05 */ -3, /* 0x06 */ -3, /* 0x07 */ -3, + /* 0x08 */ -3, /* 0x09 */ -2, /* 0x0a */ -2, /* 0x0b */ -2, + /* 0x0c */ -2, /* 0x0d */ -2, /* 0x0e */ -3, /* 0x0f */ -3, + /* 0x10 */ -3, /* 0x11 */ -3, /* 0x12 */ -3, /* 0x13 */ -3, + /* 0x14 */ -3, /* 0x15 */ -3, /* 0x16 */ -3, /* 0x17 */ -3, + /* 0x18 */ -3, /* 0x19 */ -3, /* 0x1a */ -3, /* 0x1b */ -3, + /* 0x1c */ -3, /* 0x1d */ -3, /* 0x1e */ -3, /* 0x1f */ -3, + /* ' ' */ -2, /* '!' */ -3, /* '"' */ -3, /* '#' */ -3, + /* '$' */ -3, /* '%' */ -3, /* '&' */ -3, /* ''' */ -3, + /* '(' */ -3, /* ')' */ -3, /* '*' */ -3, /* '+' */ 62, + /* ',' */ -3, /* '-' */ -3, /* '.' */ -3, /* '/' */ 63, + /* '0' */ 52, /* '1' */ 53, /* '2' */ 54, /* '3' */ 55, + /* '4' */ 56, /* '5' */ 57, /* '6' */ 58, /* '7' */ 59, + /* '8' */ 60, /* '9' */ 61, /* ':' */ -3, /* ';' */ -3, + /* '<' */ -3, /* '=' */ -1, /* '>' */ -3, /* '?' */ -3, + /* '@' */ -3, /* 'A' */ 0, /* 'B' */ 1, /* 'C' */ 2, + /* 'D' */ 3, /* 'E' */ 4, /* 'F' */ 5, /* 'G' */ 6, + /* 'H' */ 7, /* 'I' */ 8, /* 'J' */ 9, /* 'K' */ 10, + /* 'L' */ 11, /* 'M' */ 12, /* 'N' */ 13, /* 'O' */ 14, + /* 'P' */ 15, /* 'Q' */ 16, /* 'R' */ 17, /* 'S' */ 18, + /* 'T' */ 19, /* 'U' */ 20, /* 'V' */ 21, /* 'W' */ 22, + /* 'X' */ 23, /* 'Y' */ 24, /* 'Z' */ 25, /* '[' */ -3, + /* '\' */ -3, /* ']' */ -3, /* '^' */ -3, /* '_' */ -3, + /* '`' */ -3, /* 'a' */ 26, /* 'b' */ 27, /* 'c' */ 28, + /* 'd' */ 29, /* 'e' */ 30, /* 'f' */ 31, /* 'g' */ 32, + /* 'h' */ 33, /* 'i' */ 34, /* 'j' */ 35, /* 'k' */ 36, + /* 'l' */ 37, /* 'm' */ 38, /* 'n' */ 39, /* 'o' */ 40, + /* 'p' */ 41, /* 'q' */ 42, /* 'r' */ 43, /* 's' */ 44, + /* 't' */ 45, /* 'u' */ 46, /* 'v' */ 47, /* 'w' */ 48, + /* 'x' */ 49, /* 'y' */ 50, /* 'z' */ 51, /* '{' */ -3, + /* '|' */ -3, /* '}' */ -3, /* '~' */ -3, /* 0x7f */ -3 +}; + +const u_int8_t kBits_00000011 = 0x03; +const u_int8_t kBits_00001111 = 0x0F; +const u_int8_t kBits_00110000 = 0x30; +const u_int8_t kBits_00111100 = 0x3C; +const u_int8_t kBits_00111111 = 0x3F; +const u_int8_t kBits_11000000 = 0xC0; +const u_int8_t kBits_11110000 = 0xF0; +const u_int8_t kBits_11111100 = 0xFC; + +size_t EstimateBas64EncodedDataSize(size_t inDataSize) +{ +size_t theEncodedDataSize = (int)ceil(inDataSize / 3.0) * 4; +theEncodedDataSize = theEncodedDataSize / 72 * 74 + theEncodedDataSize % 72; +return(theEncodedDataSize); +} + +size_t EstimateBas64DecodedDataSize(size_t inDataSize) +{ +size_t theDecodedDataSize = (int)ceil(inDataSize / 4.0) * 3; +//theDecodedDataSize = theDecodedDataSize / 72 * 74 + theDecodedDataSize % 72; +return(theDecodedDataSize); +} + +bool Base64EncodeData(const void *inInputData, size_t inInputDataSize, char *outOutputData, size_t *ioOutputDataSize) +{ +size_t theEncodedDataSize = EstimateBas64EncodedDataSize(inInputDataSize); +if (*ioOutputDataSize < theEncodedDataSize) + return(false); +*ioOutputDataSize = theEncodedDataSize; +const u_int8_t *theInPtr = (const u_int8_t *)inInputData; +u_int32_t theInIndex = 0, theOutIndex = 0; +for (; theInIndex < (inInputDataSize / 3) * 3; theInIndex += 3) + { + outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex] & kBits_11111100) >> 2]; + outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex] & kBits_00000011) << 4 | (theInPtr[theInIndex + 1] & kBits_11110000) >> 4]; + outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex + 1] & kBits_00001111) << 2 | (theInPtr[theInIndex + 2] & kBits_11000000) >> 6]; + outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex + 2] & kBits_00111111) >> 0]; + if (theOutIndex % 74 == 72) + { + outOutputData[theOutIndex++] = '\r'; + outOutputData[theOutIndex++] = '\n'; + } + } +const size_t theRemainingBytes = inInputDataSize - theInIndex; +if (theRemainingBytes == 1) + { + outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex] & kBits_11111100) >> 2]; + outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex] & kBits_00000011) << 4 | (0 & kBits_11110000) >> 4]; + outOutputData[theOutIndex++] = '='; + outOutputData[theOutIndex++] = '='; + if (theOutIndex % 74 == 72) + { + outOutputData[theOutIndex++] = '\r'; + outOutputData[theOutIndex++] = '\n'; + } + } +else if (theRemainingBytes == 2) + { + outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex] & kBits_11111100) >> 2]; + outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex] & kBits_00000011) << 4 | (theInPtr[theInIndex + 1] & kBits_11110000) >> 4]; + outOutputData[theOutIndex++] = kBase64EncodeTable[(theInPtr[theInIndex + 1] & kBits_00001111) << 2 | (0 & kBits_11000000) >> 6]; + outOutputData[theOutIndex++] = '='; + if (theOutIndex % 74 == 72) + { + outOutputData[theOutIndex++] = '\r'; + outOutputData[theOutIndex++] = '\n'; + } + } + theOutIndex; // make static analyzer happy +return(true); +} + +bool Base64DecodeData(const void *inInputData, size_t inInputDataSize, void *ioOutputData, size_t *ioOutputDataSize) +{ +memset(ioOutputData, '.', *ioOutputDataSize); + +size_t theDecodedDataSize = EstimateBas64DecodedDataSize(inInputDataSize); +if (*ioOutputDataSize < theDecodedDataSize) + return(false); +*ioOutputDataSize = 0; +const u_int8_t *theInPtr = (const u_int8_t *)inInputData; +u_int8_t *theOutPtr = (u_int8_t *)ioOutputData; +size_t theInIndex = 0, theOutIndex = 0; +u_int8_t theOutputOctet = 0; +size_t theSequence = 0; +for (; theInIndex < inInputDataSize; ) + { + int8_t theSextet = 0; + + int8_t theCurrentInputOctet = theInPtr[theInIndex]; + theSextet = kBase64DecodeTable[theCurrentInputOctet]; + if (theSextet == -1) + break; + while (theSextet == -2) + { + theCurrentInputOctet = theInPtr[++theInIndex]; + theSextet = kBase64DecodeTable[theCurrentInputOctet]; + } + while (theSextet == -3) + { + theCurrentInputOctet = theInPtr[++theInIndex]; + theSextet = kBase64DecodeTable[theCurrentInputOctet]; + } + if (theSequence == 0) + { + theOutputOctet = (theSextet >= 0 ? theSextet : 0) << 2 & kBits_11111100; + } + else if (theSequence == 1) + { + theOutputOctet |= (theSextet >- 0 ? theSextet : 0) >> 4 & kBits_00000011; + theOutPtr[theOutIndex++] = theOutputOctet; + } + else if (theSequence == 2) + { + theOutputOctet = (theSextet >= 0 ? theSextet : 0) << 4 & kBits_11110000; + } + else if (theSequence == 3) + { + theOutputOctet |= (theSextet >= 0 ? theSextet : 0) >> 2 & kBits_00001111; + theOutPtr[theOutIndex++] = theOutputOctet; + } + else if (theSequence == 4) + { + theOutputOctet = (theSextet >= 0 ? theSextet : 0) << 6 & kBits_11000000; + } + else if (theSequence == 5) + { + theOutputOctet |= (theSextet >= 0 ? theSextet : 0) >> 0 & kBits_00111111; + theOutPtr[theOutIndex++] = theOutputOctet; + } + theSequence = (theSequence + 1) % 6; + if (theSequence != 2 && theSequence != 4) + theInIndex++; + } +*ioOutputDataSize = theOutIndex; +return(true); +} diff --git a/Classes/ShareKit/Core/Helpers/OAuth/Crytpo/Base64Transcoder.h b/Classes/ShareKit/Core/Helpers/OAuth/Crytpo/Base64Transcoder.h new file mode 100755 index 00000000..87520989 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/Crytpo/Base64Transcoder.h @@ -0,0 +1,36 @@ +/* + * Base64Transcoder.h + * Base64Test + * + * Created by Jonathan Wight on Tue Mar 18 2003. + * Copyright (c) 2003 Toxic Software. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +#include +#include + +extern size_t EstimateBas64EncodedDataSize(size_t inDataSize); +extern size_t EstimateBas64DecodedDataSize(size_t inDataSize); + +extern bool Base64EncodeData(const void *inInputData, size_t inInputDataSize, char *outOutputData, size_t *ioOutputDataSize); +extern bool Base64DecodeData(const void *inInputData, size_t inInputDataSize, void *ioOutputData, size_t *ioOutputDataSize); + diff --git a/Classes/ShareKit/Core/Helpers/OAuth/Crytpo/hmac.c b/Classes/ShareKit/Core/Helpers/OAuth/Crytpo/hmac.c new file mode 100755 index 00000000..eea9a707 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/Crytpo/hmac.c @@ -0,0 +1,86 @@ +// +// hmac.c +// OAuthConsumer +// +// Created by Jonathan Wight on 4/8/8. +// Copyright 2008 Jonathan Wight. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +/* + * Implementation of HMAC-SHA1. Adapted from example at http://tools.ietf.org/html/rfc2104 + + */ + +#include "sha1.h" + +#include +#include + +void hmac_sha1(const unsigned char *inText, size_t inTextLength, unsigned char* inKey, size_t inKeyLength, unsigned char *outDigest) +{ +const size_t B = 64; +const size_t L = 20; + +SHA1_CTX theSHA1Context; +unsigned char k_ipad[B + 1]; /* inner padding - key XORd with ipad */ +unsigned char k_opad[B + 1]; /* outer padding - key XORd with opad */ + +/* if key is longer than 64 bytes reset it to key=SHA1 (key) */ +if (inKeyLength > B) + { + SHA1Init(&theSHA1Context); + SHA1Update(&theSHA1Context, inKey, inKeyLength); + SHA1Final(inKey, &theSHA1Context); + inKeyLength = L; + } + +/* start out by storing key in pads */ +memset(k_ipad, 0, sizeof k_ipad); +memset(k_opad, 0, sizeof k_opad); +memcpy(k_ipad, inKey, inKeyLength); +memcpy(k_opad, inKey, inKeyLength); + +/* XOR key with ipad and opad values */ +int i; +for (i = 0; i < B; i++) + { + k_ipad[i] ^= 0x36; + k_opad[i] ^= 0x5c; + } + +/* +* perform inner SHA1 +*/ +SHA1Init(&theSHA1Context); /* init context for 1st pass */ +SHA1Update(&theSHA1Context, k_ipad, B); /* start with inner pad */ +SHA1Update(&theSHA1Context, (unsigned char *)inText, inTextLength); /* then text of datagram */ +SHA1Final((unsigned char *)outDigest, &theSHA1Context); /* finish up 1st pass */ + +/* +* perform outer SHA1 +*/ +SHA1Init(&theSHA1Context); /* init context for 2nd +* pass */ +SHA1Update(&theSHA1Context, k_opad, B); /* start with outer pad */ +SHA1Update(&theSHA1Context, outDigest, L); /* then results of 1st +* hash */ +SHA1Final(outDigest, &theSHA1Context); /* finish up 2nd pass */ + +} \ No newline at end of file diff --git a/Classes/ShareKit/Core/Helpers/OAuth/Crytpo/hmac.h b/Classes/ShareKit/Core/Helpers/OAuth/Crytpo/hmac.h new file mode 100755 index 00000000..51eca9f6 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/Crytpo/hmac.h @@ -0,0 +1,31 @@ +// +// hmac.h +// OAuthConsumer +// +// Created by Jonathan Wight on 4/8/8. +// Copyright 2008 Jonathan Wight. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#ifndef HMAC_H +#define HMAC_H 1 + +extern void hmac_sha1(const unsigned char *inText, int inTextLength, unsigned char* inKey, const unsigned int inKeyLength, unsigned char *outDigest); + +#endif /* HMAC_H */ \ No newline at end of file diff --git a/Classes/ShareKit/Core/Helpers/OAuth/Crytpo/sha1.c b/Classes/ShareKit/Core/Helpers/OAuth/Crytpo/sha1.c new file mode 100755 index 00000000..cae68dee --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/Crytpo/sha1.c @@ -0,0 +1,165 @@ +/* +SHA-1 in C +By Steve Reid +100% Public Domain + +Test Vectors (from FIPS PUB 180-1) +"abc" + A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D +"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" + 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 +A million repetitions of "a" + 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F +*/ + +/* #define LITTLE_ENDIAN * This should be #define'd if true. */ +#if __LITTLE_ENDIAN__ +#define LITTLE_ENDIAN +#endif +/* #define SHA1HANDSOFF * Copies data before messing with it. */ + +#include +#include + +#include "sha1.h" + +void SHA1Transform(unsigned long state[5], unsigned char buffer[64]); + +#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) + +/* blk0() and blk() perform the initial expand. */ +/* I got the idea of expanding during the round function from SSLeay */ +#ifdef LITTLE_ENDIAN +#define blk0(i) (block->l[i] = (rol(block->l[i],24)&0xFF00FF00) \ + |(rol(block->l[i],8)&0x00FF00FF)) +#else +#define blk0(i) block->l[i] +#endif +#define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \ + ^block->l[(i+2)&15]^block->l[i&15],1)) + +/* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */ +#define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30); +#define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30); +#define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30); +#define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30); +#define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); + + +/* Hash a single 512-bit block. This is the core of the algorithm. */ + +void SHA1Transform(unsigned long state[5], unsigned char buffer[64]) +{ +unsigned long a, b, c, d, e; +typedef union { + unsigned char c[64]; + unsigned long l[16]; +} CHAR64LONG16; +CHAR64LONG16* block; +#ifdef SHA1HANDSOFF +static unsigned char workspace[64]; + block = (CHAR64LONG16*)workspace; + memcpy(block, buffer, 64); +#else + block = (CHAR64LONG16*)buffer; +#endif + /* Copy context->state[] to working vars */ + a = state[0]; + b = state[1]; + c = state[2]; + d = state[3]; + e = state[4]; + /* 4 rounds of 20 operations each. Loop unrolled. */ + R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3); + R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7); + R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11); + R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15); + R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19); + R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23); + R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27); + R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31); + R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35); + R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39); + R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43); + R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47); + R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51); + R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55); + R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59); + R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63); + R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67); + R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71); + R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75); + R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79); + /* Add the working vars back into context.state[] */ + state[0] += a; + state[1] += b; + state[2] += c; + state[3] += d; + state[4] += e; +} + + +/* SHA1Init - Initialize new context */ + +void SHA1Init(SHA1_CTX* context) +{ + /* SHA1 initialization constants */ + context->state[0] = 0x67452301; + context->state[1] = 0xEFCDAB89; + context->state[2] = 0x98BADCFE; + context->state[3] = 0x10325476; + context->state[4] = 0xC3D2E1F0; + context->count[0] = context->count[1] = 0; +} + + +/* Run your data through this. */ + +void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int len) +{ +unsigned int i, j; + + j = (context->count[0] >> 3) & 63; + if ((context->count[0] += len << 3) < (len << 3)) context->count[1]++; + context->count[1] += (len >> 29); + if ((j + len) > 63) { + memcpy(&context->buffer[j], data, (i = 64-j)); + SHA1Transform(context->state, context->buffer); + for ( ; i + 63 < len; i += 64) { + SHA1Transform(context->state, &data[i]); + } + j = 0; + } + else i = 0; + memcpy(&context->buffer[j], &data[i], len - i); +} + + +/* Add padding and return the message digest. */ + +void SHA1Final(unsigned char digest[20], SHA1_CTX* context) +{ +unsigned long i; +unsigned char finalcount[8]; + + for (i = 0; i < 8; i++) { + finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)] + >> ((3-(i & 3)) * 8) ) & 255); /* Endian independent */ + } + SHA1Update(context, (unsigned char *)"\200", 1); + while ((context->count[0] & 504) != 448) { + SHA1Update(context, (unsigned char *)"\0", 1); + } + SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() */ + for (i = 0; i < 20; i++) { + digest[i] = (unsigned char) + ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255); + } + memset(context->buffer, 0, 64); + memset(context->state, 0, 20); + memset(context->count, 0, 8); + memset(&finalcount, 0, 8); +#ifdef SHA1HANDSOFF /* make SHA1Transform overwrite it's own static vars */ + SHA1Transform(context->state, context->buffer); +#endif +} diff --git a/Classes/ShareKit/Core/Helpers/OAuth/Crytpo/sha1.h b/Classes/ShareKit/Core/Helpers/OAuth/Crytpo/sha1.h new file mode 100755 index 00000000..f3218ee5 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/Crytpo/sha1.h @@ -0,0 +1,12 @@ + +// From http://www.mirrors.wiretapped.net/security/cryptography/hashes/sha1/sha1.c + +typedef struct { + unsigned long state[5]; + unsigned long count[2]; + unsigned char buffer[64]; +} SHA1_CTX; + +extern void SHA1Init(SHA1_CTX* context); +extern void SHA1Update(SHA1_CTX* context, unsigned char* data, unsigned int len); +extern void SHA1Final(unsigned char digest[20], SHA1_CTX* context); diff --git a/Classes/ShareKit/Core/Helpers/OAuth/OAAsynchronousDataFetcher.h b/Classes/ShareKit/Core/Helpers/OAuth/OAAsynchronousDataFetcher.h new file mode 100644 index 00000000..dd6c0498 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/OAAsynchronousDataFetcher.h @@ -0,0 +1,45 @@ +// +// OAAsynchronousDataFetcher.h +// OAuthConsumer +// +// Created by Zsombor Szabó on 12/3/08. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +#import "OAMutableURLRequest.h" + +@interface OAAsynchronousDataFetcher : NSObject { + OAMutableURLRequest *request; + NSHTTPURLResponse *response; + NSURLConnection *connection; + NSMutableData *responseData; + id delegate; + SEL didFinishSelector; + SEL didFailSelector; +} + ++ (id)asynchronousFetcherWithRequest:(OAMutableURLRequest *)aRequest delegate:(id)aDelegate didFinishSelector:(SEL)finishSelector didFailSelector:(SEL)failSelector; +- (id)initWithRequest:(OAMutableURLRequest *)aRequest delegate:(id)aDelegate didFinishSelector:(SEL)finishSelector didFailSelector:(SEL)failSelector; + +- (void)start; +- (void)cancel; + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/OAAsynchronousDataFetcher.m b/Classes/ShareKit/Core/Helpers/OAuth/OAAsynchronousDataFetcher.m new file mode 100644 index 00000000..58472bc8 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/OAAsynchronousDataFetcher.m @@ -0,0 +1,134 @@ +// +// OAAsynchronousDataFetcher.m +// OAuthConsumer +// +// Created by Zsombor Szabó on 12/3/08. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "OAAsynchronousDataFetcher.h" + +#import "OAServiceTicket.h" + +@implementation OAAsynchronousDataFetcher + ++ (id)asynchronousFetcherWithRequest:(OAMutableURLRequest *)aRequest delegate:(id)aDelegate didFinishSelector:(SEL)finishSelector didFailSelector:(SEL)failSelector +{ + return [[[OAAsynchronousDataFetcher alloc] initWithRequest:aRequest delegate:aDelegate didFinishSelector:finishSelector didFailSelector:failSelector] autorelease]; +} + +- (id)initWithRequest:(OAMutableURLRequest *)aRequest delegate:(id)aDelegate didFinishSelector:(SEL)finishSelector didFailSelector:(SEL)failSelector +{ + if (self = [super init]) + { + request = [aRequest retain]; + delegate = aDelegate; + didFinishSelector = finishSelector; + didFailSelector = failSelector; + } + return self; +} + +- (void)start +{ + [request prepare]; + + if (connection) + [connection release]; + + connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; + + if (connection) + { + if (responseData) + [responseData release]; + responseData = [[NSMutableData data] retain]; + } + else + { + OAServiceTicket *ticket= [[OAServiceTicket alloc] initWithRequest:request + response:nil + didSucceed:NO]; + [delegate performSelector:didFailSelector + withObject:ticket + withObject:nil]; + [ticket release]; + } +} + +- (void)cancel +{ + if (connection) + { + [connection cancel]; + [connection release]; + connection = nil; + } +} + +- (void)dealloc +{ + if (request) [request release]; + if (connection) [connection release]; + if (response) [response release]; + if (responseData) [responseData release]; + [super dealloc]; +} + +#pragma mark - +#pragma mark NSURLConnection methods + +- (void)connection:(NSURLConnection *)aConnection didReceiveResponse:(NSURLResponse *)aResponse +{ + if (response) + [response release]; + response = [aResponse retain]; + [responseData setLength:0]; +} + +- (void)connection:(NSURLConnection *)aConnection didReceiveData:(NSData *)data +{ + [responseData appendData:data]; +} + +- (void)connection:(NSURLConnection *)aConnection didFailWithError:(NSError *)error +{ + OAServiceTicket *ticket= [[OAServiceTicket alloc] initWithRequest:request + response:response + didSucceed:NO]; + [delegate performSelector:didFailSelector + withObject:ticket + withObject:error]; + + [ticket release]; +} + +- (void)connectionDidFinishLoading:(NSURLConnection *)aConnection +{ + OAServiceTicket *ticket = [[OAServiceTicket alloc] initWithRequest:request + response:response + didSucceed:[(NSHTTPURLResponse *)response statusCode] < 400]; + [delegate performSelector:didFinishSelector + withObject:ticket + withObject:responseData]; + + [ticket release]; +} + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/OAConsumer.h b/Classes/ShareKit/Core/Helpers/OAuth/OAConsumer.h new file mode 100755 index 00000000..73bdab65 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/OAConsumer.h @@ -0,0 +1,40 @@ +// +// OAConsumer.h +// OAuthConsumer +// +// Created by Jon Crosby on 10/19/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import + + +@interface OAConsumer : NSObject { +@protected + NSString *key; + NSString *secret; +} +@property(retain) NSString *key; +@property(retain) NSString *secret; + +- (id)initWithKey:(NSString *)aKey secret:(NSString *)aSecret; + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/OAConsumer.m b/Classes/ShareKit/Core/Helpers/OAuth/OAConsumer.m new file mode 100755 index 00000000..0582ad9d --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/OAConsumer.m @@ -0,0 +1,51 @@ +// +// OAConsumer.m +// OAuthConsumer +// +// Created by Jon Crosby on 10/19/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import "OAConsumer.h" + + +@implementation OAConsumer +@synthesize key, secret; + +#pragma mark init + +- (id)initWithKey:(NSString *)aKey secret:(NSString *)aSecret +{ + if (self = [super init]) + { + self.key = aKey; + self.secret = aSecret; + } + return self; +} + +- (void)dealloc +{ + [key release]; + [secret release]; + [super dealloc]; +} + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/OADataFetcher.h b/Classes/ShareKit/Core/Helpers/OAuth/OADataFetcher.h new file mode 100755 index 00000000..1eaea0a7 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/OADataFetcher.h @@ -0,0 +1,44 @@ +// +// OADataFetcher.h +// OAuthConsumer +// +// Created by Jon Crosby on 11/5/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import +#import "OAMutableURLRequest.h" +#import "OAServiceTicket.h" + + +@interface OADataFetcher : NSObject { +@private + OAMutableURLRequest *request; + NSHTTPURLResponse *response; + NSError *error; + NSData *responseData; + id delegate; + SEL didFinishSelector; + SEL didFailSelector; +} + +- (void)fetchDataWithRequest:(OAMutableURLRequest *)aRequest delegate:(id)aDelegate didFinishSelector:(SEL)finishSelector didFailSelector:(SEL)failSelector; + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/OADataFetcher.m b/Classes/ShareKit/Core/Helpers/OAuth/OADataFetcher.m new file mode 100755 index 00000000..f3356512 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/OADataFetcher.m @@ -0,0 +1,65 @@ +// +// OADataFetcher.m +// OAuthConsumer +// +// Created by Jon Crosby on 11/5/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import "OADataFetcher.h" + + +@implementation OADataFetcher + +- (void)fetchDataWithRequest:(OAMutableURLRequest *)aRequest + delegate:(id)aDelegate + didFinishSelector:(SEL)finishSelector + didFailSelector:(SEL)failSelector +{ + request = aRequest; + delegate = aDelegate; + didFinishSelector = finishSelector; + didFailSelector = failSelector; + + [request prepare]; + + responseData = [NSURLConnection sendSynchronousRequest:request + returningResponse:&response + error:&error]; + + if (response == nil || responseData == nil || error != nil) { + OAServiceTicket *ticket= [[[OAServiceTicket alloc] initWithRequest:request + response:response + didSucceed:NO] autorelease]; + [delegate performSelector:didFailSelector + withObject:ticket + withObject:error]; + } else { + OAServiceTicket *ticket = [[[OAServiceTicket alloc] initWithRequest:request + response:response + didSucceed:[(NSHTTPURLResponse *)response statusCode] < 400] autorelease]; + [delegate performSelector:didFinishSelector + withObject:ticket + withObject:responseData]; + } +} + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/OAHMAC_SHA1SignatureProvider.h b/Classes/ShareKit/Core/Helpers/OAuth/OAHMAC_SHA1SignatureProvider.h new file mode 100755 index 00000000..d259c4ea --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/OAHMAC_SHA1SignatureProvider.h @@ -0,0 +1,32 @@ +// +// OAHMAC_SHA1SignatureProvider.h +// OAuthConsumer +// +// Created by Jon Crosby on 10/19/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import +#import "OASignatureProviding.h" + + +@interface OAHMAC_SHA1SignatureProvider : NSObject +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/OAHMAC_SHA1SignatureProvider.m b/Classes/ShareKit/Core/Helpers/OAuth/OAHMAC_SHA1SignatureProvider.m new file mode 100755 index 00000000..432baf7a --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/OAHMAC_SHA1SignatureProvider.m @@ -0,0 +1,58 @@ +// +// OAHMAC_SHA1SignatureProvider.m +// OAuthConsumer +// +// Created by Jon Crosby on 10/19/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import "OAHMAC_SHA1SignatureProvider.h" +#import + +#include "Base64Transcoder.h" + +@implementation OAHMAC_SHA1SignatureProvider + +- (NSString *)name +{ + return @"HMAC-SHA1"; +} + +- (NSString *)signClearText:(NSString *)text withSecret:(NSString *)secret +{ + NSData *secretData = [secret dataUsingEncoding:NSUTF8StringEncoding]; + NSData *clearTextData = [text dataUsingEncoding:NSUTF8StringEncoding]; + unsigned char result[20]; + CCHmac(kCCHmacAlgSHA1, [secretData bytes], [secretData length], [clearTextData bytes], [clearTextData length], result); + + //Base64 Encoding + + char base64Result[32]; + size_t theResultLength = 32; + Base64EncodeData(result, 20, base64Result, &theResultLength); + NSData *theData = [NSData dataWithBytes:base64Result length:theResultLength]; + + NSString *base64EncodedResult = [[NSString alloc] initWithData:theData encoding:NSUTF8StringEncoding]; + + return [base64EncodedResult autorelease]; +} + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/OAMutableURLRequest.h b/Classes/ShareKit/Core/Helpers/OAuth/OAMutableURLRequest.h new file mode 100755 index 00000000..03c6cfac --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/OAMutableURLRequest.h @@ -0,0 +1,69 @@ +// +// OAMutableURLRequest.h +// OAuthConsumer +// +// Created by Jon Crosby on 10/19/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import +#import "OAConsumer.h" +#import "OAToken.h" +#import "OAHMAC_SHA1SignatureProvider.h" +#import "OASignatureProviding.h" +#import "NSMutableURLRequest+Parameters.h" +#import "NSURL+Base.h" + + +@interface OAMutableURLRequest : NSMutableURLRequest { +@protected + OAConsumer *consumer; + OAToken *token; + NSString *realm; + NSString *signature; + id signatureProvider; + NSString *nonce; + NSString *timestamp; + NSMutableDictionary *extraOAuthParameters; + BOOL didPrepare; +} +@property(readonly) NSString *signature; +@property(readonly) NSString *nonce; + +- (id)initWithURL:(NSURL *)aUrl + consumer:(OAConsumer *)aConsumer + token:(OAToken *)aToken + realm:(NSString *)aRealm +signatureProvider:(id)aProvider; + +- (id)initWithURL:(NSURL *)aUrl + consumer:(OAConsumer *)aConsumer + token:(OAToken *)aToken + realm:(NSString *)aRealm +signatureProvider:(id)aProvider + nonce:(NSString *)aNonce + timestamp:(NSString *)aTimestamp; + +- (void)prepare; + +- (void)setOAuthParameterName:(NSString*)parameterName withValue:(NSString*)parameterValue; + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/OAMutableURLRequest.m b/Classes/ShareKit/Core/Helpers/OAuth/OAMutableURLRequest.m new file mode 100755 index 00000000..6de7e07e --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/OAMutableURLRequest.m @@ -0,0 +1,247 @@ +// +// OAMutableURLRequest.m +// OAuthConsumer +// +// Created by Jon Crosby on 10/19/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import "OAMutableURLRequest.h" +#import "SHKConfig.h" + + +@interface OAMutableURLRequest (Private) +- (void)_generateTimestamp; +- (void)_generateNonce; +- (NSString *)_signatureBaseString; +@end + +@implementation OAMutableURLRequest +@synthesize signature, nonce; + +#pragma mark init + +- (id)initWithURL:(NSURL *)aUrl + consumer:(OAConsumer *)aConsumer + token:(OAToken *)aToken + realm:(NSString *)aRealm +signatureProvider:(id)aProvider +{ + if (self = [super initWithURL:aUrl + cachePolicy:NSURLRequestReloadIgnoringCacheData + timeoutInterval:10.0]) + { + consumer = [aConsumer retain]; + + // empty token for Unauthorized Request Token transaction + if (aToken == nil) + token = [[OAToken alloc] init]; + else + token = [aToken retain]; + + if (aRealm == nil) + realm = [[NSString alloc] initWithString:@""]; + else + realm = [aRealm retain]; + + // default to HMAC-SHA1 + if (aProvider == nil) + signatureProvider = [[OAHMAC_SHA1SignatureProvider alloc] init]; + else + signatureProvider = [aProvider retain]; + + [self _generateTimestamp]; + [self _generateNonce]; + + didPrepare = NO; + } + return self; +} + +// Setting a timestamp and nonce to known +// values can be helpful for testing +- (id)initWithURL:(NSURL *)aUrl + consumer:(OAConsumer *)aConsumer + token:(OAToken *)aToken + realm:(NSString *)aRealm +signatureProvider:(id)aProvider + nonce:(NSString *)aNonce + timestamp:(NSString *)aTimestamp +{ + if (self = [super initWithURL:aUrl + cachePolicy:NSURLRequestReloadIgnoringCacheData + timeoutInterval:10.0]) + { + consumer = [aConsumer retain]; + + // empty token for Unauthorized Request Token transaction + if (aToken == nil) + token = [[OAToken alloc] init]; + else + token = [aToken retain]; + + if (aRealm == nil) + realm = [[NSString alloc] initWithString:@""]; + else + realm = [aRealm retain]; + + // default to HMAC-SHA1 + if (aProvider == nil) + signatureProvider = [[OAHMAC_SHA1SignatureProvider alloc] init]; + else + signatureProvider = [aProvider retain]; + + timestamp = [aTimestamp retain]; + nonce = [aNonce retain]; + + didPrepare = NO; + } + return self; +} + +- (void)dealloc +{ + [consumer release]; + [token release]; + [realm release]; + [signatureProvider release]; + [timestamp release]; + [nonce release]; + [extraOAuthParameters release]; + [super dealloc]; +} + +#pragma mark - +#pragma mark Public + +- (void)setOAuthParameterName:(NSString*)parameterName withValue:(NSString*)parameterValue +{ + assert(parameterName && parameterValue); + + if (extraOAuthParameters == nil) { + extraOAuthParameters = [NSMutableDictionary new]; + } + + [extraOAuthParameters setObject:parameterValue forKey:parameterName]; +} + +- (void)prepare +{ + if (didPrepare) { + return; + } + didPrepare = YES; + // sign + // Secrets must be urlencoded before concatenated with '&' + // TODO: if later RSA-SHA1 support is added then a little code redesign is needed + signature = [signatureProvider signClearText:[self _signatureBaseString] + withSecret:[NSString stringWithFormat:@"%@&%@", + [consumer.secret URLEncodedString], + [token.secret URLEncodedString]]]; + + // set OAuth headers + NSString *oauthToken; + if ([token.key isEqualToString:@""]) + oauthToken = @""; // not used on Request Token transactions + else + oauthToken = [NSString stringWithFormat:@"oauth_token=\"%@\", ", [token.key URLEncodedString]]; + + NSMutableString *extraParameters = [NSMutableString string]; + + // Adding the optional parameters in sorted order isn't required by the OAuth spec, but it makes it possible to hard-code expected values in the unit tests. + for(NSString *parameterName in [[extraOAuthParameters allKeys] sortedArrayUsingSelector:@selector(compare:)]) + { + [extraParameters appendFormat:@", %@=\"%@\"", + [parameterName URLEncodedString], + [[extraOAuthParameters objectForKey:parameterName] URLEncodedString]]; + } + + NSString *oauthHeader = [NSString stringWithFormat:@"OAuth realm=\"%@\", oauth_consumer_key=\"%@\", %@oauth_signature_method=\"%@\", oauth_signature=\"%@\", oauth_timestamp=\"%@\", oauth_nonce=\"%@\", oauth_version=\"1.0\"%@", + [realm URLEncodedString], + [consumer.key URLEncodedString], + oauthToken, + [[signatureProvider name] URLEncodedString], + [signature URLEncodedString], + timestamp, + nonce, + extraParameters]; + + [self setValue:oauthHeader forHTTPHeaderField:@"Authorization"]; +} + +#pragma mark - +#pragma mark Private + +- (void)_generateTimestamp +{ + timestamp = [[NSString stringWithFormat:@"%d", time(NULL)] retain]; +} + +- (void)_generateNonce +{ + CFUUIDRef theUUID = CFUUIDCreate(NULL); + CFStringRef string = CFUUIDCreateString(NULL, theUUID); + CFRelease(theUUID); + nonce = (NSString *)string; +} + +- (NSString *)_signatureBaseString +{ + // OAuth Spec, Section 9.1.1 "Normalize Request Parameters" + // build a sorted array of both request parameters and OAuth header parameters + NSMutableArray *parameterPairs = [NSMutableArray arrayWithCapacity:(6)]; // 6 being the number of OAuth params in the Signature Base String + + [parameterPairs addObject:[[OARequestParameter requestParameterWithName:@"oauth_consumer_key" value:consumer.key] URLEncodedNameValuePair]]; + [parameterPairs addObject:[[OARequestParameter requestParameterWithName:@"oauth_signature_method" value:[signatureProvider name]] URLEncodedNameValuePair]]; + [parameterPairs addObject:[[OARequestParameter requestParameterWithName:@"oauth_timestamp" value:timestamp] URLEncodedNameValuePair]]; + [parameterPairs addObject:[[OARequestParameter requestParameterWithName:@"oauth_nonce" value:nonce] URLEncodedNameValuePair]]; + [parameterPairs addObject:[[OARequestParameter requestParameterWithName:@"oauth_version" value:@"1.0"] URLEncodedNameValuePair]]; + + if (![token.key isEqualToString:@""]) { + [parameterPairs addObject:[[OARequestParameter requestParameterWithName:@"oauth_token" value:token.key] URLEncodedNameValuePair]]; + } + + + for(NSString *parameterName in [[extraOAuthParameters allKeys] sortedArrayUsingSelector:@selector(compare:)]) { + [parameterPairs addObject:[[OARequestParameter requestParameterWithName:[parameterName URLEncodedString] value: [[extraOAuthParameters objectForKey:parameterName] URLEncodedString]] URLEncodedNameValuePair]]; + } + + if (![[self valueForHTTPHeaderField:@"Content-Type"] hasPrefix:@"multipart/form-data"]) { + for (OARequestParameter *param in [self parameters]) { + [parameterPairs addObject:[param URLEncodedNameValuePair]]; + } + } + + NSArray *sortedPairs = [parameterPairs sortedArrayUsingSelector:@selector(compare:)]; + NSString *normalizedRequestParameters = [sortedPairs componentsJoinedByString:@"&"]; + + // OAuth Spec, Section 9.1.2 "Concatenate Request Elements" + NSString *ret = [NSString stringWithFormat:@"%@&%@&%@", + [self HTTPMethod], + [[[self URL] URLStringWithoutQuery] URLEncodedString], + [normalizedRequestParameters URLEncodedString]]; + + SHKLog(@"OAMutableURLRequest parameters %@", normalizedRequestParameters); + + return ret; +} + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/OAPlaintextSignatureProvider.h b/Classes/ShareKit/Core/Helpers/OAuth/OAPlaintextSignatureProvider.h new file mode 100755 index 00000000..96bb2f28 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/OAPlaintextSignatureProvider.h @@ -0,0 +1,31 @@ +// +// OAPlaintextSignatureProvider.h +// OAuthConsumer +// +// Created by Jon Crosby on 10/19/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import +#import "OASignatureProviding.h" + +@interface OAPlaintextSignatureProvider : NSObject +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/OAPlaintextSignatureProvider.m b/Classes/ShareKit/Core/Helpers/OAuth/OAPlaintextSignatureProvider.m new file mode 100755 index 00000000..6f0c1c3a --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/OAPlaintextSignatureProvider.m @@ -0,0 +1,43 @@ +// +// OAPlaintextSignatureProvider.m +// OAuthConsumer +// +// Created by Jon Crosby on 10/19/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import "OAPlaintextSignatureProvider.h" +#import "NSString+URLEncoding.h" + + +@implementation OAPlaintextSignatureProvider + +- (NSString *)name +{ + return @"PLAINTEXT"; +} + +- (NSString *)signClearText:(NSString *)text withSecret:(NSString *)secret +{ + return secret; +} + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/OARequestParameter.h b/Classes/ShareKit/Core/Helpers/OAuth/OARequestParameter.h new file mode 100755 index 00000000..03eee3e0 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/OARequestParameter.h @@ -0,0 +1,45 @@ +// +// OARequestParameter.h +// OAuthConsumer +// +// Created by Jon Crosby on 10/19/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import +#import "NSString+URLEncoding.h" + + +@interface OARequestParameter : NSObject { +@protected + NSString *name; + NSString *value; +} +@property(retain) NSString *name; +@property(retain) NSString *value; + ++ (id)requestParameterWithName:(NSString *)aName value:(NSString *)aValue; +- (id)initWithName:(NSString *)aName value:(NSString *)aValue; +- (NSString *)URLEncodedName; +- (NSString *)URLEncodedValue; +- (NSString *)URLEncodedNameValuePair; + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/OARequestParameter.m b/Classes/ShareKit/Core/Helpers/OAuth/OARequestParameter.m new file mode 100755 index 00000000..59b6a8a6 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/OARequestParameter.m @@ -0,0 +1,70 @@ +// +// OARequestParameter.m +// OAuthConsumer +// +// Created by Jon Crosby on 10/19/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import "OARequestParameter.h" + + +@implementation OARequestParameter +@synthesize name, value; + ++ (id)requestParameterWithName:(NSString *)aName value:(NSString *)aValue +{ + return [[[OARequestParameter alloc] initWithName:aName value:aValue] autorelease]; +} + +- (id)initWithName:(NSString *)aName value:(NSString *)aValue +{ + if (self = [super init]) + { + self.name = aName; + self.value = aValue; + } + return self; +} + +- (void)dealloc +{ + [name release]; + [value release]; + [super dealloc]; +} + +- (NSString *)URLEncodedName +{ + return [self.name URLEncodedString]; +} + +- (NSString *)URLEncodedValue +{ + return [self.value URLEncodedString]; +} + +- (NSString *)URLEncodedNameValuePair +{ + return [NSString stringWithFormat:@"%@=%@", [self URLEncodedName], [self URLEncodedValue]]; +} + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/OAServiceTicket.h b/Classes/ShareKit/Core/Helpers/OAuth/OAServiceTicket.h new file mode 100755 index 00000000..9a8eb348 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/OAServiceTicket.h @@ -0,0 +1,47 @@ +// +// OAServiceTicket.h +// OAuthConsumer +// +// Created by Jon Crosby on 11/5/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import +#import "OAMutableURLRequest.h" + + +@interface OAServiceTicket : NSObject { +@private + OAMutableURLRequest *request; + NSHTTPURLResponse *response; + NSData *data; + BOOL didSucceed; +} +@property(readonly) OAMutableURLRequest *request; +@property(readonly) NSHTTPURLResponse *response; +@property(readonly) NSData *data; +@property(readonly) BOOL didSucceed; +@property(readonly) NSString *body; + +- (id)initWithRequest:(OAMutableURLRequest *)aRequest response:(NSHTTPURLResponse *)aResponse didSucceed:(BOOL)success; +- (id)initWithRequest:(OAMutableURLRequest *)aRequest response:(NSHTTPURLResponse *)aResponse data:(NSData *)aData didSucceed:(BOOL)success; + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/OAServiceTicket.m b/Classes/ShareKit/Core/Helpers/OAuth/OAServiceTicket.m new file mode 100755 index 00000000..fb6e3b7c --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/OAServiceTicket.m @@ -0,0 +1,56 @@ +// +// OAServiceTicket.m +// OAuthConsumer +// +// Created by Jon Crosby on 11/5/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import "OAServiceTicket.h" + + +@implementation OAServiceTicket +@synthesize request, response, data, didSucceed; + +- (id)initWithRequest:(OAMutableURLRequest *)aRequest response:(NSHTTPURLResponse *)aResponse didSucceed:(BOOL)success +{ + return [self initWithRequest:aRequest response:aResponse data:nil didSucceed:success]; +} + +- (id)initWithRequest:(OAMutableURLRequest *)aRequest response:(NSHTTPURLResponse *)aResponse data:(NSData *)aData didSucceed:(BOOL)success { + [super init]; + request = aRequest; + response = aResponse; + data = aData; + didSucceed = success; + return self; +} + +- (NSString *)body +{ + if (!data) { + return nil; + } + + return [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]; +} + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/OASignatureProviding.h b/Classes/ShareKit/Core/Helpers/OAuth/OASignatureProviding.h new file mode 100755 index 00000000..0c7e4f8c --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/OASignatureProviding.h @@ -0,0 +1,34 @@ +// +// OASignatureProviding.h +// +// Created by Jon Crosby on 10/19/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import + + +@protocol OASignatureProviding + +- (NSString *)name; +- (NSString *)signClearText:(NSString *)text withSecret:(NSString *)secret; + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/OAToken.h b/Classes/ShareKit/Core/Helpers/OAuth/OAToken.h new file mode 100755 index 00000000..e9904d7e --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/OAToken.h @@ -0,0 +1,43 @@ +// +// OAToken.h +// OAuthConsumer +// +// Created by Jon Crosby on 10/19/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +@interface OAToken : NSObject { +@protected + NSString *key; + NSString *secret; + NSString *sessionHandle; +} +@property(retain) NSString *key; +@property(retain) NSString *secret; +@property(retain) NSString *sessionHandle; + +- (id)initWithKey:(NSString *)aKey secret:(NSString *)aSecret; +- (id)initWithUserDefaultsUsingServiceProviderName:(NSString *)provider prefix:(NSString *)prefix; +- (id)initWithHTTPResponseBody:(NSString *)body; +- (int)storeInUserDefaultsWithServiceProviderName:(NSString *)provider prefix:(NSString *)prefix; + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/OAToken.m b/Classes/ShareKit/Core/Helpers/OAuth/OAToken.m new file mode 100755 index 00000000..22c4b9d1 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/OAToken.m @@ -0,0 +1,109 @@ +// +// OAToken.m +// OAuthConsumer +// +// Created by Jon Crosby on 10/19/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import "OAToken.h" + + +@implementation OAToken + +@synthesize key, secret, sessionHandle; + +#pragma mark init + +- (id)init +{ + if (self = [super init]) + { + self.key = @""; + self.secret = @""; + self.sessionHandle = @""; + } + return self; +} + +- (id)initWithKey:(NSString *)aKey secret:(NSString *)aSecret +{ + if (self = [super init]) + { + self.key = aKey; + self.secret = aSecret; + } + return self; +} + +- (id)initWithHTTPResponseBody:(NSString *)body +{ + if (self = [super init]) + { + NSArray *pairs = [body componentsSeparatedByString:@"&"]; + + for (NSString *pair in pairs) { + NSArray *elements = [pair componentsSeparatedByString:@"="]; + if ([[elements objectAtIndex:0] isEqualToString:@"oauth_token"]) { + self.key = [[elements objectAtIndex:1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + } else if ([[elements objectAtIndex:0] isEqualToString:@"oauth_token_secret"]) { + self.secret = [[elements objectAtIndex:1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + } else if ([[elements objectAtIndex:0] isEqualToString:@"oauth_session_handle"]) { + self.sessionHandle = [[elements objectAtIndex:1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + } + } + } + return self; +} + +- (id)initWithUserDefaultsUsingServiceProviderName:(NSString *)provider prefix:(NSString *)prefix +{ + if (self = [super init]) + { + NSString *theKey = [[NSUserDefaults standardUserDefaults] stringForKey:[NSString stringWithFormat:@"OAUTH_%@_%@_KEY", prefix, provider]]; + NSString *theSecret = [[NSUserDefaults standardUserDefaults] stringForKey:[NSString stringWithFormat:@"OAUTH_%@_%@_SECRET", prefix, provider]]; + if (theKey == NULL || theSecret == NULL) + return(nil); + self.key = theKey; + self.secret = theSecret; + } + return self; +} + +- (void)dealloc +{ + [key release]; + [secret release]; + [sessionHandle release]; + [super dealloc]; +} + +#pragma mark - + +- (int)storeInUserDefaultsWithServiceProviderName:(NSString *)provider prefix:(NSString *)prefix +{ + [[NSUserDefaults standardUserDefaults] setObject:self.key forKey:[NSString stringWithFormat:@"OAUTH_%@_%@_KEY", prefix, provider]]; + [[NSUserDefaults standardUserDefaults] setObject:self.secret forKey:[NSString stringWithFormat:@"OAUTH_%@_%@_SECRET", prefix, provider]]; + [[NSUserDefaults standardUserDefaults] synchronize]; + return(0); +} + +@end diff --git a/Classes/ShareKit/Core/Helpers/OAuth/OAuthConsumer.h b/Classes/ShareKit/Core/Helpers/OAuth/OAuthConsumer.h new file mode 100755 index 00000000..1ac26b20 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/OAuth/OAuthConsumer.h @@ -0,0 +1,39 @@ +// +// OAuthConsumer.h +// OAuthConsumer +// +// Created by Jon Crosby on 10/19/07. +// Copyright 2007 Kaboomerang LLC. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import +#import "OAToken.h" +#import "OAConsumer.h" +#import "OAMutableURLRequest.h" +#import "NSString+URLEncoding.h" +#import "NSMutableURLRequest+Parameters.h" +#import "NSURL+Base.h" +#import "OASignatureProviding.h" +#import "OAHMAC_SHA1SignatureProvider.h" +#import "OAPlaintextSignatureProvider.h" +#import "OARequestParameter.h" +#import "OAServiceTicket.h" +#import "OADataFetcher.h" +#import "OAAsynchronousDataFetcher.h" \ No newline at end of file diff --git a/Classes/ShareKit/Core/Helpers/SHKRequest.h b/Classes/ShareKit/Core/Helpers/SHKRequest.h new file mode 100644 index 00000000..8fd8f452 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/SHKRequest.h @@ -0,0 +1,74 @@ +// +// SHKRequest.h +// ShareKit +// +// Created by Nathan Weiner on 6/9/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import + + +@interface SHKRequest : NSObject +{ + NSURL *url; + NSString *params; + NSString *method; + NSDictionary *headerFields; + + id delegate; + SEL isFinishedSelector; + + NSURLConnection *connection; + + NSHTTPURLResponse *response; + NSDictionary *headers; + + NSMutableData *data; + NSString *result; + BOOL success; +} + +@property (retain) NSURL *url; +@property (retain) NSString *params; +@property (retain) NSString *method; +@property (retain) NSDictionary *headerFields; + +@property (assign) id delegate; +@property (assign) SEL isFinishedSelector; + +@property (retain) NSURLConnection *connection; + +@property (retain) NSHTTPURLResponse *response; +@property (retain) NSDictionary *headers; + +@property (retain) NSMutableData *data; +@property (nonatomic, retain, getter=getResult) NSString *result; +@property (nonatomic) BOOL success; + +- (id)initWithURL:(NSURL *)u params:(NSString *)p delegate:(id)d isFinishedSelector:(SEL)s method:(NSString *)m autostart:(BOOL)autostart; + +- (void)start; +- (void)finish; + + +@end diff --git a/Classes/ShareKit/Core/Helpers/SHKRequest.m b/Classes/ShareKit/Core/Helpers/SHKRequest.m new file mode 100644 index 00000000..4603d2e5 --- /dev/null +++ b/Classes/ShareKit/Core/Helpers/SHKRequest.m @@ -0,0 +1,149 @@ +// +// SHKRequest.m +// ShareKit +// +// Created by Nathan Weiner on 6/9/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKRequest.h" +#import "SHKConfig.h" + +#define SHK_TIMEOUT 90 + +@implementation SHKRequest + +@synthesize url, params, method, headerFields; +@synthesize delegate, isFinishedSelector; +@synthesize data, result, headers, response, connection; +@synthesize success; + +- (void)dealloc +{ + [url release]; + [params release]; + [method release]; + [headerFields release]; + [connection release]; + [data release]; + [result release]; + [response release]; + [super dealloc]; +} + +- (id)initWithURL:(NSURL *)u params:(NSString *)p delegate:(id)d isFinishedSelector:(SEL)s method:(NSString *)m autostart:(BOOL)autostart +{ + if (self = [super init]) + { + self.url = u; + self.params = p; + self.method = m; + + self.delegate = d; + self.isFinishedSelector = s; + + if (autostart) + [self start]; + } + + return self; +} + + +#pragma mark - + +- (void)start +{ + self.data = [[NSMutableData alloc] initWithLength:0]; + [data release]; + + NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:url + cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData + timeoutInterval:SHK_TIMEOUT]; + + // overwrite header fields (generally for cookies) + if (headerFields != nil) + [request setAllHTTPHeaderFields:headerFields]; + + // Setup Request Data/Params + if (params != nil) + { + NSData *paramsData = [ NSData dataWithBytes:[params UTF8String] length:[params length] ]; + + // Fill Request + [request setHTTPMethod:method]; + [request setHTTPBody:paramsData]; + } + + // Start Connection + SHKLog(@"Start SHKRequest:\nURL: %@\nparams: %@", url, params); + self.connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES]; + [request release]; + [connection release]; +} + + +#pragma mark - + +- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSHTTPURLResponse *)theResponse +{ + self.response = theResponse; + self.headers = [[response allHeaderFields] mutableCopy]; + [headers release]; + + [data setLength:0]; +} + +- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)d +{ + [data appendData:d]; +} + +- (void)connectionDidFinishLoading:(NSURLConnection *)connection +{ + [self finish]; +} + +- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error +{ + [self finish]; +} + +#pragma mark - + +- (void)finish +{ + self.success = (response.statusCode == 200 || response.statusCode == 201); + + if ([delegate respondsToSelector:isFinishedSelector]) + [delegate performSelector:isFinishedSelector withObject:self]; +} + +- (NSString *)getResult +{ + if (result == nil) + self.result = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]; + return result; +} + + +@end diff --git a/Classes/ShareKit/Core/SHK.h b/Classes/ShareKit/Core/SHK.h new file mode 100644 index 00000000..aa08794f --- /dev/null +++ b/Classes/ShareKit/Core/SHK.h @@ -0,0 +1,130 @@ +// +// SHK.h +// ShareKit +// +// Created by Nathan Weiner on 6/10/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#define SHK_VERSION @"0.2.1" + +#import +#import "SHKConfig.h" +#import "SHKItem.h" +#import "SHKActionSheet.h" +#import "SHKRequest.h" +#import "SHKActivityIndicator.h" +#import "SHKFormFieldSettings.h" +#import "UIWebView+SHK.h" + + +@class SHKActionSheet; +@class SHKViewControllerWrapper; + + +@interface SHK : NSObject +{ + UIViewController *rootViewController, *currentRootViewController; + UIViewController *currentView; + UIViewController *pendingView; + BOOL isDismissingView; + + NSOperationQueue *offlineQueue; +} + +@property (nonatomic, assign) UIViewController *rootViewController, *currentRootViewController; +@property (nonatomic, retain) UIViewController *currentView; +@property (nonatomic, retain) UIViewController *pendingView; +@property BOOL isDismissingView; + +@property (nonatomic, retain) NSOperationQueue *offlineQueue; + + + +#pragma mark - + ++ (SHK *)currentHelper; + ++ (NSDictionary *)sharersDictionary; + + +#pragma mark - +#pragma mark View Management + ++ (void)setRootViewController:(UIViewController *)vc; +- (void)showViewController:(UIViewController *)vc; +- (void)hideCurrentViewControllerAnimated:(BOOL)animated; +- (void)viewWasDismissed; +- (UIViewController *)getTopViewController; + ++ (UIBarStyle)barStyle; ++ (UIModalPresentationStyle)modalPresentationStyle; ++ (UIModalTransitionStyle)modalTransitionStyle; + +#pragma mark - +#pragma mark Favorites + ++ (NSArray *)favoriteSharersForType:(SHKShareType)type; ++ (void)pushOnFavorites:(NSString *)className forType:(SHKShareType)type; ++ (void)setFavorites:(NSArray *)favs forType:(SHKShareType)type; + ++ (NSDictionary *)getUserExclusions; ++ (void)setUserExclusions:(NSDictionary *)exclusions; + + +#pragma mark - +#pragma mark Credentials + ++ (NSString *)getAuthValueForKey:(NSString *)key forSharer:(NSString *)sharerId; ++ (void)setAuthValue:(NSString *)value forKey:(NSString *)key forSharer:(NSString *)sharerId; ++ (void)removeAuthValueForKey:(NSString *)key forSharer:(NSString *)sharerId; + ++ (void)logoutOfAll; ++ (void)logoutOfService:(NSString *)sharerId; + +#pragma mark - +#pragma mark Offline Support + ++ (NSString *)offlineQueuePath; ++ (NSString *)offlineQueueListPath; ++ (NSMutableArray *)getOfflineQueueList; ++ (void)saveOfflineQueueList:(NSMutableArray *)queueList; ++ (BOOL)addToOfflineQueue:(SHKItem *)item forSharer:(NSString *)sharerId; ++ (void)flushOfflineQueue; + +#pragma mark - + ++ (NSError *)error:(NSString *)description, ...; + +#pragma mark - +#pragma mark Network + ++ (BOOL)connected; + +@end + + +NSString * SHKStringOrBlank(NSString * value); +NSString * SHKEncode(NSString * value); +NSString * SHKEncodeURL(NSURL * value); +NSString* SHKLocalizedString(NSString* key, ...); +void SHKSwizzle(Class c, SEL orig, SEL newClassName); diff --git a/Classes/ShareKit/Core/SHK.m b/Classes/ShareKit/Core/SHK.m new file mode 100644 index 00000000..ea16bd78 --- /dev/null +++ b/Classes/ShareKit/Core/SHK.m @@ -0,0 +1,617 @@ +// +// SHK.m +// ShareKit +// +// Created by Nathan Weiner on 6/10/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHK.h" +#import "SHKActivityIndicator.h" +#import "SHKViewControllerWrapper.h" +#import "SHKActionSheet.h" +#import "SHKOfflineSharer.h" +#import "SFHFKeychainUtils.h" +#import "Reachability.h" +#import +#import +#import + + +@implementation SHK + +@synthesize currentView, pendingView, isDismissingView; +@synthesize rootViewController, currentRootViewController; +@synthesize offlineQueue; + +static SHK *currentHelper = nil; +BOOL SHKinit; + + ++ (SHK *)currentHelper +{ + if (currentHelper == nil) + currentHelper = [[SHK alloc] init]; + + return currentHelper; +} + ++ (void)initialize +{ + [super initialize]; + + if (!SHKinit) + { + SHKSwizzle([MFMailComposeViewController class], @selector(viewDidDisappear:), @selector(SHKviewDidDisappear:)); + + if (NSClassFromString(@"MFMessageComposeViewController") != nil) + SHKSwizzle([MFMessageComposeViewController class], @selector(viewDidDisappear:), @selector(SHKviewDidDisappear:)); + + SHKinit = YES; + } +} + +- (void)dealloc +{ + [currentView release]; + [pendingView release]; + [offlineQueue release]; + [super dealloc]; +} + + + +#pragma mark - +#pragma mark View Management + ++ (void)setRootViewController:(UIViewController *)vc +{ + SHK *helper = [self currentHelper]; + [helper setRootViewController:vc]; +} + +- (void)showViewController:(UIViewController *)vc +{ + if (rootViewController) + { + // If developer provieded a root view controler, use it + self.currentRootViewController = rootViewController; + } + else + { + // Try to find the root view controller programmically + + // Find the top window (that is not an alert view or other window) + UIWindow *topWindow = [[UIApplication sharedApplication] keyWindow]; + if (topWindow.windowLevel != UIWindowLevelNormal) + { + NSArray *windows = [[UIApplication sharedApplication] windows]; + for(topWindow in windows) + { + if (topWindow.windowLevel == UIWindowLevelNormal) + break; + } + } + + UIView *rootView = [[topWindow subviews] objectAtIndex:0]; + id nextResponder = [rootView nextResponder]; + + if ([nextResponder isKindOfClass:[UIViewController class]]) + self.currentRootViewController = nextResponder; + + else + NSAssert(NO, @"ShareKit: Could not find a root view controller. You can assign one manually by calling [[SHK currentHelper] setRootViewController:YOURROOTVIEWCONTROLLER]."); + } + + // Find the top most view controller being displayed (so we can add the modal view to it and not one that is hidden) + UIViewController *topViewController = [self getTopViewController]; + if (topViewController == nil) + NSAssert(NO, @"ShareKit: There is no view controller to display from"); + + + // If a view is already being shown, hide it, and then try again + if (currentView != nil) + { + self.pendingView = vc; + [[currentView parentViewController] dismissModalViewControllerAnimated:YES]; + return; + } + + // Wrap the view in a nav controller if not already + if (![vc respondsToSelector:@selector(pushViewController:animated:)]) + { + UINavigationController *nav = [[[UINavigationController alloc] initWithRootViewController:vc] autorelease]; + + if ([nav respondsToSelector:@selector(modalPresentationStyle)]) + nav.modalPresentationStyle = [SHK modalPresentationStyle]; + + if ([nav respondsToSelector:@selector(modalTransitionStyle)]) + nav.modalTransitionStyle = [SHK modalTransitionStyle]; + + nav.navigationBar.barStyle = nav.toolbar.barStyle = [SHK barStyle]; + + [topViewController presentModalViewController:nav animated:YES]; + self.currentView = nav; + } + + // Show the nav controller + else + { + if ([vc respondsToSelector:@selector(modalPresentationStyle)]) + vc.modalPresentationStyle = [SHK modalPresentationStyle]; + + if ([vc respondsToSelector:@selector(modalTransitionStyle)]) + vc.modalTransitionStyle = [SHK modalTransitionStyle]; + + [topViewController presentModalViewController:vc animated:YES]; + [(UINavigationController *)vc navigationBar].barStyle = + [(UINavigationController *)vc toolbar].barStyle = [SHK barStyle]; + self.currentView = vc; + } + + self.pendingView = nil; +} + +- (void)hideCurrentViewController +{ + [self hideCurrentViewControllerAnimated:YES]; +} + +- (void)hideCurrentViewControllerAnimated:(BOOL)animated +{ + if (isDismissingView) + return; + + if (currentView != nil) + { + // Dismiss the modal view + if ([currentView parentViewController] != nil) + { + self.isDismissingView = YES; + [[currentView parentViewController] dismissModalViewControllerAnimated:animated]; + } + + else + self.currentView = nil; + } +} + +- (void)showPendingView +{ + if (pendingView) + [self showViewController:pendingView]; +} + + +- (void)viewWasDismissed +{ + self.isDismissingView = NO; + + if (currentView != nil) + currentView = nil; + + if (currentRootViewController != nil) + currentRootViewController = nil; + + if (pendingView) + { + // This is an ugly way to do it, but it works. + // There seems to be an issue chaining modal views otherwise + // See: http://github.com/ideashower/ShareKit/issues#issue/24 + [self performSelector:@selector(showPendingView) withObject:nil afterDelay:0.02]; + return; + } +} + +- (UIViewController *)getTopViewController +{ + UIViewController *topViewController = currentRootViewController; + while (topViewController.modalViewController != nil) + topViewController = topViewController.modalViewController; + return topViewController; +} + ++ (UIBarStyle)barStyle +{ + if ([SHKBarStyle isEqualToString:@"UIBarStyleBlack"]) + return UIBarStyleBlack; + + else if ([SHKBarStyle isEqualToString:@"UIBarStyleBlackOpaque"]) + return UIBarStyleBlackOpaque; + + else if ([SHKBarStyle isEqualToString:@"UIBarStyleBlackTranslucent"]) + return UIBarStyleBlackTranslucent; + + return UIBarStyleDefault; +} + ++ (UIModalPresentationStyle)modalPresentationStyle +{ + if ([SHKModalPresentationStyle isEqualToString:@"UIModalPresentationFullScreen"]) + return UIModalPresentationFullScreen; + + else if ([SHKModalPresentationStyle isEqualToString:@"UIModalPresentationPageSheet"]) + return UIModalPresentationPageSheet; + + else if ([SHKModalPresentationStyle isEqualToString:@"UIModalPresentationFormSheet"]) + return UIModalPresentationFormSheet; + + return UIModalPresentationCurrentContext; +} + ++ (UIModalTransitionStyle)modalTransitionStyle +{ + if ([SHKModalTransitionStyle isEqualToString:@"UIModalTransitionStyleFlipHorizontal"]) + return UIModalTransitionStyleFlipHorizontal; + + else if ([SHKModalTransitionStyle isEqualToString:@"UIModalTransitionStyleCrossDissolve"]) + return UIModalTransitionStyleCrossDissolve; + + else if ([SHKModalTransitionStyle isEqualToString:@"UIModalTransitionStylePartialCurl"]) + return UIModalTransitionStylePartialCurl; + + return UIModalTransitionStyleCoverVertical; +} + + +#pragma mark - +#pragma mark Favorites + + ++ (NSArray *)favoriteSharersForType:(SHKShareType)type +{ + NSArray *favoriteSharers = [[NSUserDefaults standardUserDefaults] objectForKey:[NSString stringWithFormat:@"%@%i", SHK_FAVS_PREFIX_KEY, type]]; + + // set defaults + if (favoriteSharers == nil) + { + switch (type) + { + case SHKShareTypeURL: + favoriteSharers = [NSArray arrayWithObjects:@"SHKTwitter",@"SHKFacebook",@"SHKReadItLater",nil]; + break; + + case SHKShareTypeImage: + favoriteSharers = [NSArray arrayWithObjects:@"SHKMail",@"SHKFacebook",@"SHKCopy",nil]; + break; + + case SHKShareTypeText: + favoriteSharers = [NSArray arrayWithObjects:@"SHKMail",@"SHKTwitter",@"SHKFacebook",nil]; + break; + + case SHKShareTypeFile: + favoriteSharers = [NSArray arrayWithObjects:@"SHKMail",@"SHKEvernote",nil]; + break; + + default: + favoriteSharers = [NSArray array]; + } + + // Save defaults to prefs + [self setFavorites:favoriteSharers forType:type]; + } + + // Make sure the favorites are not using any exclusions, remove them if they are. + NSArray *exclusions = [[NSUserDefaults standardUserDefaults] objectForKey:@"SHKExcluded"]; + if (exclusions != nil) + { + NSMutableArray *newFavs = [favoriteSharers mutableCopy]; + for(NSString *sharerId in exclusions) + { + [newFavs removeObject:sharerId]; + } + + // Update + favoriteSharers = [NSArray arrayWithArray:newFavs]; + [self setFavorites:favoriteSharers forType:type]; + + [newFavs release]; + } + + return favoriteSharers; +} + ++ (void)pushOnFavorites:(NSString *)className forType:(SHKShareType)type +{ + NSMutableArray *favs = [[self favoriteSharersForType:type] mutableCopy]; + + [favs removeObject:className]; + [favs insertObject:className atIndex:0]; + + while (favs.count > SHK_MAX_FAV_COUNT) + [favs removeLastObject]; + + [self setFavorites:favs forType:type]; + + [favs release]; +} + ++ (void)setFavorites:(NSArray *)favs forType:(SHKShareType)type +{ + [[NSUserDefaults standardUserDefaults] setObject:favs forKey:[NSString stringWithFormat:@"%@%i", SHK_FAVS_PREFIX_KEY, type]]; +} + +#pragma mark - + ++ (NSDictionary *)getUserExclusions +{ + return [[NSUserDefaults standardUserDefaults] objectForKey:[NSString stringWithFormat:@"%@Exclusions", SHK_FAVS_PREFIX_KEY]]; +} + ++ (void)setUserExclusions:(NSDictionary *)exclusions +{ + return [[NSUserDefaults standardUserDefaults] setObject:exclusions forKey:[NSString stringWithFormat:@"%@Exclusions", SHK_FAVS_PREFIX_KEY]]; +} + + + +#pragma mark - +#pragma mark Credentials + +// TODO someone with more keychain experience may want to clean this up. The use of SFHFKeychainUtils may be unnecessary? + ++ (NSString *)getAuthValueForKey:(NSString *)key forSharer:(NSString *)sharerId +{ +#if TARGET_IPHONE_SIMULATOR + // Using NSUserDefaults for storage is very insecure, but because Keychain only exists on a device + // we use NSUserDefaults when running on the simulator to store objects. This allows you to still test + // in the simulator. You should NOT modify in a way that does not use keychain when actually deployed to a device. + return [[NSUserDefaults standardUserDefaults] objectForKey:[NSString stringWithFormat:@"%@%@%@",SHK_AUTH_PREFIX,sharerId,key]]; +#else + return [SFHFKeychainUtils getPasswordForUsername:key andServiceName:[NSString stringWithFormat:@"%@%@",SHK_AUTH_PREFIX,sharerId] error:nil]; +#endif +} + ++ (void)setAuthValue:(NSString *)value forKey:(NSString *)key forSharer:(NSString *)sharerId +{ +#if TARGET_IPHONE_SIMULATOR + // Using NSUserDefaults for storage is very insecure, but because Keychain only exists on a device + // we use NSUserDefaults when running on the simulator to store objects. This allows you to still test + // in the simulator. You should NOT modify in a way that does not use keychain when actually deployed to a device. + [[NSUserDefaults standardUserDefaults] setObject:value forKey:[NSString stringWithFormat:@"%@%@%@",SHK_AUTH_PREFIX,sharerId,key]]; +#else + [SFHFKeychainUtils storeUsername:key andPassword:value forServiceName:[NSString stringWithFormat:@"%@%@",SHK_AUTH_PREFIX,sharerId] updateExisting:YES error:nil]; +#endif +} + ++ (void)removeAuthValueForKey:(NSString *)key forSharer:(NSString *)sharerId +{ +#if TARGET_IPHONE_SIMULATOR + // Using NSUserDefaults for storage is very insecure, but because Keychain only exists on a device + // we use NSUserDefaults when running on the simulator to store objects. This allows you to still test + // in the simulator. You should NOT modify in a way that does not use keychain when actually deployed to a device. + [[NSUserDefaults standardUserDefaults] removeObjectForKey:[NSString stringWithFormat:@"%@%@%@",SHK_AUTH_PREFIX,sharerId,key]]; +#else + [SFHFKeychainUtils deleteItemForUsername:key andServiceName:[NSString stringWithFormat:@"%@%@",SHK_AUTH_PREFIX,sharerId] error:nil]; +#endif +} + ++ (void)logoutOfAll +{ + NSArray *sharers = [[SHK sharersDictionary] objectForKey:@"services"]; + for (NSString *sharerId in sharers) + [self logoutOfService:sharerId]; +} + ++ (void)logoutOfService:(NSString *)sharerId +{ + [NSClassFromString(sharerId) logout]; +} + + +#pragma mark - + +static NSDictionary *sharersDictionary = nil; + ++ (NSDictionary *)sharersDictionary +{ + if (sharersDictionary == nil) + sharersDictionary = [[NSDictionary dictionaryWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"SHKSharers.plist"]] retain]; + + return sharersDictionary; +} + + +#pragma mark - +#pragma mark Offline Support + ++ (NSString *)offlineQueuePath +{ + NSFileManager *fileManager = [NSFileManager defaultManager]; + NSArray *paths = NSSearchPathForDirectoriesInDomains( NSCachesDirectory, NSUserDomainMask, YES); + NSString *cache = [paths objectAtIndex:0]; + NSString *SHKPath = [cache stringByAppendingPathComponent:@"SHK"]; + + // Check if the path exists, otherwise create it + if (![fileManager fileExistsAtPath:SHKPath]) + [fileManager createDirectoryAtPath:SHKPath withIntermediateDirectories:YES attributes:nil error:nil]; + + return SHKPath; +} + ++ (NSString *)offlineQueueListPath +{ + return [[self offlineQueuePath] stringByAppendingPathComponent:@"SHKOfflineQueue.plist"]; +} + ++ (NSMutableArray *)getOfflineQueueList +{ + return [[[NSArray arrayWithContentsOfFile:[self offlineQueueListPath]] mutableCopy] autorelease]; +} + ++ (void)saveOfflineQueueList:(NSMutableArray *)queueList +{ + [queueList writeToFile:[self offlineQueueListPath] atomically:YES]; // TODO - should do this off of the main thread +} + ++ (BOOL)addToOfflineQueue:(SHKItem *)item forSharer:(NSString *)sharerId +{ + // Generate a unique id for the share to use when saving associated files + NSString *uid = [NSString stringWithFormat:@"%@-%i-%i-%i", sharerId, item.shareType, [[NSDate date] timeIntervalSince1970], arc4random()]; + + + // store image in cache + if (item.shareType == SHKShareTypeImage && item.image) + [UIImageJPEGRepresentation(item.image, 1) writeToFile:[[self offlineQueuePath] stringByAppendingPathComponent:uid] atomically:YES]; + + // store file in cache + else if (item.shareType == SHKShareTypeFile) + [item.data writeToFile:[[self offlineQueuePath] stringByAppendingPathComponent:uid] atomically:YES]; + + // Open queue list + NSMutableArray *queueList = [self getOfflineQueueList]; + if (queueList == nil) + queueList = [NSMutableArray arrayWithCapacity:0]; + + // Add to queue list + [queueList addObject:[NSDictionary dictionaryWithObjectsAndKeys: + [item dictionaryRepresentation],@"item", + sharerId,@"sharer", + uid,@"uid", + nil]]; + + [self saveOfflineQueueList:queueList]; + + return YES; +} + ++ (void)flushOfflineQueue +{ + // TODO - if an item fails, after all items are shared, it should present a summary view and allow them to see which items failed/succeeded + + // Check for a connection + if (![self connected]) + return; + + // Open list + NSMutableArray *queueList = [self getOfflineQueueList]; + + // Run through each item in the quietly in the background + // TODO - Is this the best behavior? Instead, should the user confirm sending these again? Maybe only if it has been X days since they were saved? + // - want to avoid a user being suprised by a post to Twitter if that happens long after they forgot they even shared it. + if (queueList != nil) + { + SHK *helper = [self currentHelper]; + + if (helper.offlineQueue == nil) + helper.offlineQueue = [[NSOperationQueue alloc] init]; + + SHKItem *item; + NSString *sharerId, *uid; + + for (NSDictionary *entry in queueList) + { + item = [SHKItem itemFromDictionary:[entry objectForKey:@"item"]]; + sharerId = [entry objectForKey:@"sharer"]; + uid = [entry objectForKey:@"uid"]; + + if (item != nil && sharerId != nil) + [helper.offlineQueue addOperation:[[[SHKOfflineSharer alloc] initWithItem:item forSharer:sharerId uid:uid] autorelease]]; + } + + // Remove offline queue - TODO: only do this if everything was successful? + [[NSFileManager defaultManager] removeItemAtPath:[self offlineQueueListPath] error:nil]; + + } +} + +#pragma mark - + ++ (NSError *)error:(NSString *)description, ... +{ + va_list args; + va_start(args, description); + NSString *string = [[[NSString alloc] initWithFormat:description arguments:args] autorelease]; + va_end(args); + + return [NSError errorWithDomain:@"sharekit" code:1 userInfo:[NSDictionary dictionaryWithObject:string forKey:NSLocalizedDescriptionKey]]; +} + +#pragma mark - +#pragma mark Network + ++ (BOOL)connected +{ + //return NO; // force for offline testing + Reachability *hostReach = [Reachability reachabilityForInternetConnection]; + NetworkStatus netStatus = [hostReach currentReachabilityStatus]; + return !(netStatus == NotReachable); +} + +@end + + +NSString * SHKStringOrBlank(NSString * value) +{ + return value == nil ? @"" : value; +} + +NSString * SHKEncode(NSString * value) +{ + if (value == nil) + return @""; + + NSString *string = value; + + string = [string stringByReplacingOccurrencesOfString:@"&" withString:@"&"]; + string = [string stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + string = [string stringByReplacingOccurrencesOfString:@"&" withString:@"%26"]; + + return string; +} + +NSString * SHKEncodeURL(NSURL * value) +{ + if (value == nil) + return @""; + + NSString *result = (NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, + (CFStringRef)value.absoluteString, + NULL, + CFSTR("!*'();:@&=+$,/?%#[]"), + kCFStringEncodingUTF8); + [result autorelease]; + return result; +} + +void SHKSwizzle(Class c, SEL orig, SEL newClassName) +{ + Method origMethod = class_getInstanceMethod(c, orig); + Method newMethod = class_getInstanceMethod(c, newClassName); + if(class_addMethod(c, orig, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) + class_replaceMethod(c, newClassName, method_getImplementation(origMethod), method_getTypeEncoding(origMethod)); + else + method_exchangeImplementations(origMethod, newMethod); +} + +NSString* SHKLocalizedString(NSString* key, ...) +{ + // Localize the format + NSString *localizedStringFormat = NSLocalizedString(key, key); + + va_list args; + va_start(args, key); + NSString *string = [[[NSString alloc] initWithFormat:localizedStringFormat arguments:args] autorelease]; + va_end(args); + + return string; +} diff --git a/Classes/ShareKit/Core/SHKItem.h b/Classes/ShareKit/Core/SHKItem.h new file mode 100644 index 00000000..19064a41 --- /dev/null +++ b/Classes/ShareKit/Core/SHKItem.h @@ -0,0 +1,86 @@ +// +// SHKItem.h +// ShareKit +// +// Created by Nathan Weiner on 6/18/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import + +typedef enum +{ + SHKShareTypeUndefined, + SHKShareTypeURL, + SHKShareTypeText, + SHKShareTypeImage, + SHKShareTypeFile +} SHKShareType; + + +@interface SHKItem : NSObject +{ + SHKShareType shareType; + + NSURL *URL; + + UIImage *image; + + NSString *title; + NSString *text; + NSString *tags; + + NSData *data; + NSString *mimeType; + NSString *filename; + + @private + NSMutableDictionary *custom; +} + +@property (nonatomic) SHKShareType shareType; + +@property (nonatomic, retain) NSURL *URL; + +@property (nonatomic, retain) UIImage *image; + +@property (nonatomic, retain) NSString *title; +@property (nonatomic, retain) NSString *text; +@property (nonatomic, retain) NSString *tags; + +@property (nonatomic, retain) NSData *data; +@property (nonatomic, retain) NSString *mimeType; +@property (nonatomic, retain) NSString *filename; + ++ (SHKItem *)URL:(NSURL *)url title:(NSString *)title; ++ (SHKItem *)image:(UIImage *)image title:(NSString *)title; ++ (SHKItem *)text:(NSString *)text; ++ (SHKItem *)file:(NSData *)data filename:(NSString *)filename mimeType:(NSString *)mimeType title:(NSString *)title; + +- (void)setCustomValue:(NSString *)value forKey:(NSString *)key; +- (NSString *)customValueForKey:(NSString *)key; +- (BOOL)customBoolForSwitchKey:(NSString *)key; + +- (NSDictionary *)dictionaryRepresentation; ++ (SHKItem *)itemFromDictionary:(NSDictionary *)dictionary; + +@end diff --git a/Classes/ShareKit/Core/SHKItem.m b/Classes/ShareKit/Core/SHKItem.m new file mode 100644 index 00000000..76a44613 --- /dev/null +++ b/Classes/ShareKit/Core/SHKItem.m @@ -0,0 +1,185 @@ +// +// SHKItem.m +// ShareKit +// +// Created by Nathan Weiner on 6/18/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKItem.h" +#import "SHK.h" + + +@interface SHKItem() +@property (nonatomic, retain) NSMutableDictionary *custom; +@end + + +@implementation SHKItem + +@synthesize shareType; +@synthesize URL, image, title, text, tags, data, mimeType, filename; +@synthesize custom; + +- (void)dealloc +{ + [URL release]; + + [image release]; + + [title release]; + [text release]; + [tags release]; + + [data release]; + [mimeType release]; + [filename release]; + + [custom release]; + + [super dealloc]; +} + + ++ (SHKItem *)URL:(NSURL *)url +{ + return [self URL:url title:nil]; +} + ++ (SHKItem *)URL:(NSURL *)url title:(NSString *)title +{ + SHKItem *item = [[SHKItem alloc] init]; + item.shareType = SHKShareTypeURL; + item.URL = url; + item.title = title; + + return [item autorelease]; +} + ++ (SHKItem *)image:(UIImage *)image +{ + return [SHKItem image:image title:nil]; +} + ++ (SHKItem *)image:(UIImage *)image title:(NSString *)title +{ + SHKItem *item = [[SHKItem alloc] init]; + item.shareType = SHKShareTypeImage; + item.image = image; + item.title = title; + + return [item autorelease]; +} + ++ (SHKItem *)text:(NSString *)text +{ + SHKItem *item = [[SHKItem alloc] init]; + item.shareType = SHKShareTypeText; + item.text = text; + + return [item autorelease]; +} + ++ (SHKItem *)file:(NSData *)data filename:(NSString *)filename mimeType:(NSString *)mimeType title:(NSString *)title +{ + SHKItem *item = [[SHKItem alloc] init]; + item.shareType = SHKShareTypeFile; + item.data = data; + item.filename = filename; + item.mimeType = mimeType; + item.title = title; + + return [item autorelease]; +} + +#pragma mark - + +- (void)setCustomValue:(NSString *)value forKey:(NSString *)key +{ + if (custom == nil) + self.custom = [NSMutableDictionary dictionaryWithCapacity:0]; + + if (value == nil) + [custom removeObjectForKey:key]; + + else + [custom setObject:value forKey:key]; +} + +- (NSString *)customValueForKey:(NSString *)key +{ + return [custom objectForKey:key]; +} + +- (BOOL)customBoolForSwitchKey:(NSString *)key +{ + return [[custom objectForKey:key] isEqualToString:SHKFormFieldSwitchOn]; +} + + +#pragma mark - + ++ (SHKItem *)itemFromDictionary:(NSDictionary *)dictionary +{ + SHKItem *item = [[SHKItem alloc] init]; + item.shareType = [[dictionary objectForKey:@"shareType"] intValue]; + + if ([dictionary objectForKey:@"URL"] != nil) + item.URL = [NSURL URLWithString:[dictionary objectForKey:@"URL"]]; + + item.title = [dictionary objectForKey:@"title"]; + item.text = [dictionary objectForKey:@"text"]; + item.tags = [dictionary objectForKey:@"tags"]; + + if ([dictionary objectForKey:@"custom"] != nil) + item.custom = [[[dictionary objectForKey:@"custom"] mutableCopy] autorelease]; + + return [item autorelease]; +} + +- (NSDictionary *)dictionaryRepresentation +{ + NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithCapacity:0]; + + [dictionary setObject:[NSNumber numberWithInt:shareType] forKey:@"shareType"]; + + if (custom != nil) + [dictionary setObject:custom forKey:@"custom"]; + + if (URL != nil) + [dictionary setObject:[URL.absoluteString stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding] forKey:@"URL"]; + + if (title != nil) + [dictionary setObject:title forKey:@"title"]; + + if (text != nil) + [dictionary setObject:text forKey:@"text"]; + + if (tags != nil) + [dictionary setObject:tags forKey:@"tags"]; + + // If you add anymore, make sure to add a method for retrieving them to the itemWithDictionary function too + + return dictionary; +} + +@end diff --git a/Classes/ShareKit/Core/SHKOfflineSharer.h b/Classes/ShareKit/Core/SHKOfflineSharer.h new file mode 100644 index 00000000..c2b74a14 --- /dev/null +++ b/Classes/ShareKit/Core/SHKOfflineSharer.h @@ -0,0 +1,56 @@ +// +// SHKOfflineSharer.h +// ShareKit +// +// Created by Nathan Weiner on 6/22/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import +#import "SHK.h" +#import "SHKSharer.h" + +@interface SHKOfflineSharer : NSOperation +{ + SHKItem *item; + NSString *sharerId; + NSString *uid; + BOOL readyToFinish; + NSThread *runLoopThread; + SHKSharer *sharer; +} + +@property (nonatomic, retain) SHKItem *item; +@property (nonatomic, retain) NSString *sharerId; +@property (nonatomic, retain) NSString *uid; +@property BOOL readyToFinish; +@property (nonatomic, retain) NSThread *runLoopThread; +@property (nonatomic, retain) SHKSharer *sharer; + +- (id)initWithItem:(SHKItem *)i forSharer:(NSString *)s uid:(NSString *)u; + +- (void)share; +- (BOOL)shouldRun; +- (void)finish; +- (void)lastSpin; + +@end diff --git a/Classes/ShareKit/Core/SHKOfflineSharer.m b/Classes/ShareKit/Core/SHKOfflineSharer.m new file mode 100644 index 00000000..0c9ce9d8 --- /dev/null +++ b/Classes/ShareKit/Core/SHKOfflineSharer.m @@ -0,0 +1,156 @@ +// +// SHKOfflineSharer.m +// ShareKit +// +// Created by Nathan Weiner on 6/22/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKOfflineSharer.h" +#import "SHKSharer.h" + +@implementation SHKOfflineSharer + +@synthesize item, sharerId, uid; +@synthesize readyToFinish; +@synthesize runLoopThread; +@synthesize sharer; + +- (void)dealloc +{ + [item release]; + [sharerId release]; + [uid release]; + [runLoopThread release]; + [sharer release]; + [super dealloc]; +} + +- (id)initWithItem:(SHKItem *)i forSharer:(NSString *)s uid:(NSString *)u +{ + if (self = [super init]) + { + self.item = i; + self.sharerId = s; + self.uid = u; + } + return self; +} + +- (void)main +{ + // Make sure it hasn't been cancelled + if (![self shouldRun]) + return; + + // Save the thread so we can spin up the run loop later + self.runLoopThread = [NSThread currentThread]; + + // Run actual sharing on the main thread to avoid thread issues + [self performSelectorOnMainThread:@selector(share) withObject:nil waitUntilDone:YES]; + + // Keep the operation alive while we perform the send async + // This way only one will run at a time + while([self shouldRun]) + [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]; +} + +- (void)share +{ + // create sharer + self.sharer = [[NSClassFromString(sharerId) alloc] init]; + sharer.item = item; + sharer.quiet = YES; + sharer.shareDelegate = self; + + if (![sharer isAuthorized]) + { + [self finish]; + return; + } + + // reload image from disk and remove the file + NSString *path; + if (item.shareType == SHKShareTypeImage) + { + path = [[SHK offlineQueuePath] stringByAppendingPathComponent:uid]; + sharer.item.image = [UIImage imageWithContentsOfFile:path]; + [[NSFileManager defaultManager] removeItemAtPath:path error:nil]; + + } + + // reload file from disk and remove the file + else if (item.shareType == SHKShareTypeFile) + { + path = [[SHK offlineQueueListPath] stringByAppendingPathComponent:uid]; + sharer.item.data = [NSData dataWithContentsOfFile:[[SHK offlineQueuePath] stringByAppendingPathComponent:uid]]; + [[NSFileManager defaultManager] removeItemAtPath:path error:nil]; + + } + + [sharer tryToSend]; + [sharer release]; +} + +- (BOOL)shouldRun +{ + return ![self isCancelled] && ![self isFinished] && !readyToFinish; +} + +- (void)finish +{ + self.readyToFinish = YES; + [self performSelector:@selector(lastSpin) onThread:runLoopThread withObject:nil waitUntilDone:NO]; +} + +- (void)lastSpin +{ + // Just used to make the run loop spin +} + +#pragma mark - +#pragma mark SHKSharerDelegate + +- (void)sharerStartedSending:(SHKSharer *)aSharer +{ + +} + +- (void)sharerFinishedSending:(SHKSharer *)aSharer +{ + sharer.shareDelegate = nil; + [self finish]; +} + +- (void)sharer:(SHKSharer *)aSharer failedWithError:(NSError *)error shouldRelogin:(BOOL)shouldRelogin +{ + sharer.shareDelegate = nil; + [self finish]; +} + +- (void)sharerCancelledSending:(SHKSharer *)aSharer +{ + sharer.shareDelegate = nil; + [self finish]; +} + +@end diff --git a/Classes/ShareKit/Core/SHKSharers.plist b/Classes/ShareKit/Core/SHKSharers.plist new file mode 100644 index 00000000..db686302 --- /dev/null +++ b/Classes/ShareKit/Core/SHKSharers.plist @@ -0,0 +1,26 @@ + + + + + actions + + SHKPhotoAlbum + SHKCopy + SHKMail + SHKSafari + SHKTextMessage + + services + + SHKEvernote + SHKTwitter + SHKPinboard + SHKDelicious + SHKGoogleReader + SHKFacebook + SHKReadItLater + SHKInstapaper + SHKTumblr + + + diff --git a/Classes/ShareKit/Customize UI/SHKCustomFormController.h b/Classes/ShareKit/Customize UI/SHKCustomFormController.h new file mode 100644 index 00000000..f93e0280 --- /dev/null +++ b/Classes/ShareKit/Customize UI/SHKCustomFormController.h @@ -0,0 +1,35 @@ +// +// SHKCustomFormController.h +// ShareKit +// +// Created by Nathan Weiner on 6/28/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import +#import "SHKFormController.h" + +@interface SHKCustomFormController : SHKFormController { + +} + +@end diff --git a/Classes/ShareKit/Customize UI/SHKCustomFormController.m b/Classes/ShareKit/Customize UI/SHKCustomFormController.m new file mode 100644 index 00000000..a83f0597 --- /dev/null +++ b/Classes/ShareKit/Customize UI/SHKCustomFormController.m @@ -0,0 +1,35 @@ +// +// SHKCustomFormController.m +// ShareKit +// +// Created by Nathan Weiner on 6/28/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKCustomFormController.h" + + +@implementation SHKCustomFormController + +// See http://getsharekit.com/customize/ for additional information on customizing + +@end diff --git a/Classes/ShareKit/Customize UI/SHKCustomFormFieldCell.h b/Classes/ShareKit/Customize UI/SHKCustomFormFieldCell.h new file mode 100644 index 00000000..37c34a97 --- /dev/null +++ b/Classes/ShareKit/Customize UI/SHKCustomFormFieldCell.h @@ -0,0 +1,36 @@ +// +// SHKCustomFormFieldCell.h +// ShareKit +// +// Created by Nathan Weiner on 6/28/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import +#import "SHKFormFieldCell.h" + +@interface SHKCustomFormFieldCell : SHKFormFieldCell +{ + +} + +@end diff --git a/Classes/ShareKit/Customize UI/SHKCustomFormFieldCell.m b/Classes/ShareKit/Customize UI/SHKCustomFormFieldCell.m new file mode 100644 index 00000000..a72d76e3 --- /dev/null +++ b/Classes/ShareKit/Customize UI/SHKCustomFormFieldCell.m @@ -0,0 +1,35 @@ +// +// SHKCustomFormFieldCell.m +// ShareKit +// +// Created by Nathan Weiner on 6/28/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKCustomFormFieldCell.h" + + +@implementation SHKCustomFormFieldCell + +// See http://getsharekit.com/customize/ for additional information on customizing + +@end diff --git a/Classes/ShareKit/Customize UI/SHKCustomShareMenu.h b/Classes/ShareKit/Customize UI/SHKCustomShareMenu.h new file mode 100644 index 00000000..6328077f --- /dev/null +++ b/Classes/ShareKit/Customize UI/SHKCustomShareMenu.h @@ -0,0 +1,40 @@ +// +// SHKCustomShareMenu.h +// RIL +// +// Created by Nathan Weiner on 6/30/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import +#import "SHKShareMenu.h" + + + +@interface SHKCustomShareMenu : SHKShareMenu +{ + // See http://getsharekit.com/customize/ for additional information on customizing +} + + + +@end diff --git a/Classes/ShareKit/Customize UI/SHKCustomShareMenu.m b/Classes/ShareKit/Customize UI/SHKCustomShareMenu.m new file mode 100644 index 00000000..aa6edec0 --- /dev/null +++ b/Classes/ShareKit/Customize UI/SHKCustomShareMenu.m @@ -0,0 +1,36 @@ +// +// SHKCustomShareMenu.m +// RIL +// +// Created by Nathan Weiner on 6/30/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKCustomShareMenu.h" + +@implementation SHKCustomShareMenu + + +// See http://getsharekit.com/customize/ for additional information on customizing + + +@end diff --git a/Classes/ShareKit/Customize UI/SHKCustomShareMenuCell.h b/Classes/ShareKit/Customize UI/SHKCustomShareMenuCell.h new file mode 100644 index 00000000..5b226131 --- /dev/null +++ b/Classes/ShareKit/Customize UI/SHKCustomShareMenuCell.h @@ -0,0 +1,45 @@ +// +// SHKTableViewCell.h +// RIL +// +// Created by Nathan Weiner on 6/30/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import + + +/* + Two ways to customize: + + 1. If you already have a custom UITableViewCell subclass you are using in your app, + simply replace UITableViewCell with your own class. + + 2. Add any customizations by subclassing this (SHKTableViewCell) +*/ + +@interface SHKCustomShareMenuCell : UITableViewCell +{ + // See http://getsharekit.com/customize/ for additional information on customizing +} + +@end diff --git a/Classes/ShareKit/Customize UI/SHKCustomShareMenuCell.m b/Classes/ShareKit/Customize UI/SHKCustomShareMenuCell.m new file mode 100644 index 00000000..cd31fba3 --- /dev/null +++ b/Classes/ShareKit/Customize UI/SHKCustomShareMenuCell.m @@ -0,0 +1,35 @@ +// +// SHKTableViewCell.m +// RIL +// +// Created by Nathan Weiner on 6/30/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKCustomShareMenuCell.h" + + +@implementation SHKCustomShareMenuCell + +// See http://getsharekit.com/customize/ for additional information on customizing + +@end diff --git a/Classes/ShareKit/Localization/de.lproj/Localizable.strings b/Classes/ShareKit/Localization/de.lproj/Localizable.strings new file mode 100644 index 00000000..bb36dab7 --- /dev/null +++ b/Classes/ShareKit/Localization/de.lproj/Localizable.strings @@ -0,0 +1,96 @@ +"Email" = "Email"; +"Username" = "Username"; +"Password" = "Passwort"; +"Follow %@" = "Folge %@"; +"Continue" = "Weiter"; +"Share" = "Teile"; +"More..." = "Mehr..."; +"Cancel" = "Abbrechen"; +"Slug" = "Slug"; +"Private" = "Privat"; +"Public" = "Öffentlich"; +"Caption" = "Kommentar"; +"Title" = "Titel"; +"Tags" = "Tags"; +"Close" = "Schließen"; +"Notes" = "Notizen"; +"Note" = "Notiz"; +"Share" = "Teilen"; +"Shared" = "Geteilt"; +"Edit" = "Editieren"; +"Actions" = "Aktionen"; +"Services" = "Dienste"; +"Send to %@" = "Zu %@ senden"; +"Copy" = "Kopieren"; +"Copied!" = "Kopiert!"; +"Saving to %@" = "Nach %@ speichern"; +"Saved!" = "Gespeichert!"; +"Offline" = "Offline"; +"Error" = "Fehler"; +"Login" = "Login"; +"Logging In..." = "Einloggen..."; +"Login Error" = "Fehler beim Login"; +"Connecting..." = "Verbinde..."; + +"Shortening URL..." = "Verkleinere URL..."; +"Shorten URL Error" = "Fehler beim Verkleinern der URL"; +"We could not shorten the URL." = "URL konnte nicht verkleinert werden."; + +"Create a free account at %@" = "Registrieren Sie einen kostenlosen Account bei %@"; +"Create an account at %@" = "Erstelle einen Account auf %@"; + +"Send to Twitter" = "An Twitter senden"; + +"Message is too long" = "Nachricht zu lang"; +"Twitter posts can only be 140 characters in length." = "Twitter Nachrichten können maximal 140 Zeichen lang sein."; +"Message is empty" = "Nachricht ist leer"; +"You must enter a message in order to post." = "Sie müssen eine Nachricht eingeben um diese absenden zu können"; + +"Enter your message:" = "Nachricht eingeben:"; + +"Invalid email or password." = "Falsche Email oder Passwort."; +"The service encountered an error. Please try again later." = "Der Dienst konnte nicht abgeschlossen werden. Bitte versuchen Sie es später erneut."; +"There was a sending your post to Tumblr." = "Beim Posten auf Tumblr trat ein Fehler auf."; + +"There was an error saving to Pinboard" = "Beim Speichern zu Pinboard trat ein Fehler auf."; + +"Sorry, Instapaper did not accept your credentials. Please try again." = "Instapaper akzeptierte Ihren Login nicht. Bitte versuchen Sie es erneut."; +"Sorry, Instapaper encountered an error. Please try again." = "Instapaper schlug fehl. Bitte versuchen Sie es erneut."; +"There was a problem saving to Instapaper." = "Beim Speichern auf Instapaper trat ein Problem auf."; + +"Incorrect username and password" = "Falscher Username und Passwort"; +"There was an error logging into Google Reader" = "Beim Einloggen zu Google Reader trat ein Fehler auf"; +"There was a problem authenticating your account." = "Beim Authentifizieren Ihres Accounts trat ein Fehler auf."; +"There was a problem saving your note." = "Beim Speichern Ihrer Notiz trat ein Problem auf."; + +"There was a problem saving to Delicious." = "Beim Speichern auf Delicious trat ein Problem auf."; + +"Open in Safari" = "In Safari öffnen"; +"Attached: %@" = "Angehängt: %@"; + +"You must be online to login to %@" = "Sie müssen online sein um sich bei %@ einzuloggen."; + +"Auto Share" = "Auto Share"; +"Enable auto share to skip this step in the future." = "Aktivieren Sie Auto Share um diesen Schritt zu überspringen."; + +"You must be online in order to share with %@" = "Um mit %@ zu teilen müssen Sie online sein."; +"There was an error while sharing" = "Beim Teilen trat ein Fehler auf."; + +"Could not authenticate you. Please relogin." = "Konnte Sie nicht authentifizieren. Bitte neu einloggen."; +"There was a problem requesting authorization from %@" = "Beim Abfragen der Authorisation für %@ trat ein Fehler auf."; +"Request Error" = "Anfragefehler"; +"There was an error while sharing" = "Beim Teilen trat ein Fehler auf."; + +"Authorize Error" = "Authorisierungsfehler"; +"There was an error while authorizing" = "Beim Authorisieren trat ein Fehler auf."; + +"Authenticating..." = "Authentifizieren..."; +"There was a problem requesting access from %@" = "Beim Nachfragen zum Zugang zu %@ trat ein Fehler auf."; + +"Access Error" = "Zugriffsfehler"; + +"Sharing a Link" = "Teile Link"; +"Sharing an Image" = "Teile Bild"; +"Sharing Text" = "Teile Text"; +"Sharing a File" = "Teile Datei"; +"Logout of All Services" = "Aus allen Services ausloggen"; \ No newline at end of file diff --git a/Classes/ShareKit/Localization/en.lproj/Localizable.strings b/Classes/ShareKit/Localization/en.lproj/Localizable.strings new file mode 100644 index 00000000..cf945769 --- /dev/null +++ b/Classes/ShareKit/Localization/en.lproj/Localizable.strings @@ -0,0 +1,91 @@ +"Email" = "Email"; +"Username" = "Username"; +"Password" = "Password"; +"Follow %@" = "Follow %@"; +"Continue" = "Continue"; +"Share" = "Share"; +"More..." = "More..."; +"Cancel" = "Cancel"; +"Slug" = "Slug"; +"Private" = "Private"; +"Public" = "Public"; +"Caption" = "Caption"; +"Title" = "Title"; +"Tags" = "Tags"; +"Close" = "Close"; +"Notes" = "Notes"; +"Note" = "Note"; +"Share" = "Share"; +"Shared" = "Shared"; +"Edit" = "Edit"; +"Actions" = "Actions"; +"Services" = "Services"; +"Send to %@" = "Send to %@"; +"Copy" = "Copy"; +"Copied!" = "Copied!"; +"Saving to %@" = "Saving to %@"; +"Saved!" = "Saved!"; +"Offline" = "Offline"; +"Error" = "Error"; +"Login" = "Login"; +"Logging In..." = "Logging In..."; +"Login Error" = "Login Error"; +"Connecting..." = "Connecting..."; + +"Shortening URL..." = "Shortening URL..."; +"Shorten URL Error" = "Shorten URL Error"; +"We could not shorten the URL." = "We could not shorten the URL."; + +"Create a free account at %@" = "Create a free account at %@"; +"Create an account at %@" = "Create an account at %@"; + +"Send to Twitter" = "Send to Twitter"; + +"Message is too long" = "Message is too long"; +"Twitter posts can only be 140 characters in length." = "Twitter posts can only be 140 characters in length."; +"Message is empty" = "Message is empty"; +"You must enter a message in order to post." = "You must enter a message in order to post."; + +"Enter your message:" = "Enter your message:"; + +"Invalid email or password." = "Invalid email or password."; +"The service encountered an error. Please try again later." = "The service encountered an error. Please try again later."; +"There was a sending your post to Tumblr." = "There was a sending your post to Tumblr."; + +"There was an error saving to Pinboard" = "There was an error saving to Pinboard"; + +"Sorry, Instapaper did not accept your credentials. Please try again." = "Sorry, Instapaper did not accept your credentials. Please try again."; +"Sorry, Instapaper encountered an error. Please try again." = "Sorry, Instapaper encountered an error. Please try again."; +"There was a problem saving to Instapaper." = "There was a problem saving to Instapaper."; + +"Incorrect username and password" = "Incorrect username and password"; +"There was an error logging into Google Reader" = "There was an error logging into Google Reader"; +"There was a problem authenticating your account." = "There was a problem authenticating your account."; +"There was a problem saving your note." = "There was a problem saving your note."; + +"There was a problem saving to Delicious." = "There was a problem saving to Delicious."; + +"Open in Safari" = "Open in Safari"; +"Attached: %@" = "Attached: %@"; + +"You must be online to login to %@" = "You must be online to login to %@"; + +"Auto Share" = "Auto Share"; +"Enable auto share to skip this step in the future." = "Enable auto share to skip this step in the future."; + +"You must be online in order to share with %@" = "You must be online in order to share with %@"; +"There was an error while sharing" = "There was an error while sharing"; + +"Could not authenticate you. Please relogin." = "Could not authenticate you. Please relogin."; +"There was a problem requesting authorization from %@" = "There was a problem requesting authorization from %@"; +"Request Error" = "Request Error"; +"There was an error while sharing" = "There was an error while sharing"; + +"Authorize Error" = "Authorize Error"; +"There was an error while authorizing" = "There was an error while authorizing"; + +"Authenticating..." = "Authenticating..."; +"There was a problem requesting access from %@" = "There was a problem requesting access from %@"; + +"Access Error" = "Access Error"; +"There was an error while sharing" = "There was an error while sharing"; \ No newline at end of file diff --git a/Classes/ShareKit/Localization/eu.lproj/Localizable.strings b/Classes/ShareKit/Localization/eu.lproj/Localizable.strings new file mode 100644 index 00000000..fe54341c --- /dev/null +++ b/Classes/ShareKit/Localization/eu.lproj/Localizable.strings @@ -0,0 +1,91 @@ +"Email" = "Email"; +"Username" = "Erabiltzailea"; +"Password" = "Pasahitza"; +"Follow %@" = "%@ jarraitu"; +"Continue" = "Jarraitu"; +"Share" = "Konpartitu"; +"More..." = "Gehiago..."; +"Cancel" = "Ezeztatu"; +"Slug" = "Slug"; +"Private" = "Pribatua"; +"Public" = "Publikoa"; +"Caption" = "Legenda"; +"Title" = "Izenburua"; +"Tags" = "Etiketa"; +"Close" = "Itxi"; +"Notes" = "Oharrak"; +"Note" = "Oharra"; +"Share" = "Konpartitu"; +"Shared" = "Konpartituta"; +"Edit" = "Aldatu"; +"Actions" = "Ekintzak"; +"Services" = "Zerbitzuak"; +"Send to %@" = "%@ri bidali"; +"Copy" = "Kopiatu"; +"Copied!" = "Kopiatuta!"; +"Saving to %@" = "%@n gorde"; +"Saved!" = "Gordeta!"; +"Offline" = "Offline"; +"Error" = "Errorea"; +"Login" = "Login"; +"Logging In..." = "Sartzen..."; +"Login Error" = "Sarrera errorea"; +"Connecting..." = "Konektatzen..."; + +"Shortening URL..." = "URLa laburtzen..."; +"Shorten URL Error" = "URL laburtzearen Error"; +"We could not shorten the URL." = "Ezin izan da URLa laburtu."; + +"Create a free account at %@" = "%@n dohako kontua eratu"; +"Create an account at %@" = "%@ kontua eratu"; + +"Send to Twitter" = "Twittera bidali"; + +"Message is too long" = "Mezua luzeegia da"; +"Twitter posts can only be 140 characters in length." = "Mezuak Twitterren 140 karaktere baino ezin dute izan."; +"Message is empty" = "Mezua hutsik dago"; +"You must enter a message in order to post." = "Mezua sartu behar duzu bidali ahal izateko."; + +"Enter your message:" = "Sartu zure mezua:"; + +"Invalid email or password." = "Email edo pasahitz okerra."; +"The service encountered an error. Please try again later." = "Zerbitzuak errore bat eman du. Mesedez, saia zaitez berriro beranduago."; +"There was a sending your post to Tumblr." = "Errore bat egon da zure mezua Tumblra bidaltzean."; + +"There was an error saving to Pinboard" = "Errore bat egon da Pinboarden gordetzean"; + +"Sorry, Instapaper did not accept your credentials. Please try again." = "Barkatu, Instapaperrek ez ditu zure agiriak onartu. Mesedez, saia zaitez berriro."; +"Sorry, Instapaper encountered an error. Please try again." = "Barkatu, Instapaperrek errore bat eman du. Mesedez, saia zaitez berriro."; +"There was a problem saving to Instapaper." = "Arazo bat egon da Instapaperren gordetzean."; + +"Incorrect username and password" = "Erabiltzaile eta pasahitz okerrak"; +"There was an error logging into Google Reader" = "Errore bat egon da Google Readerren sartzean"; +"There was a problem authenticating your account." = "Errore bat egon da zure kontua autentikatzean."; +"There was a problem saving your note." = "Arazo bat egon da zure oharra gordetzeanThere was a problem saving your note."; + +"There was a problem saving to Delicious." = "Errore bat egon da Deliciousen gordetzean."; + +"Open in Safari" = "Safarin ireki"; +"Attached: %@" = "Adjuntua: %@"; + +"You must be online to login to %@" = "Online egon behar zara %@n login egiteko"; + +"Auto Share" = "Auto-Konpartitu"; +"Enable auto share to skip this step in the future." = "Auto-konpartitu aktibatu pausu hau saihesteko hurrengoetan."; + +"You must be online in order to share with %@" = "Online egon behar zara %@kin konpatitu ahal izateko"; +"There was an error while sharing" = "Errore bat egon da konpartitzean"; + +"Could not authenticate you. Please relogin." = "Ezin izan zaitugu autentikatu. Mesedez, sar zaitez berriro."; +"There was a problem requesting authorization from %@" = "Errore bat egon da %@tik baimentzean"; +"Request Error" = "Eskaera errorea"; +"There was an error while sharing" = "Errore bat egon da konpartitzean"; + +"Authorize Error" = "Baimen errorea"; +"There was an error while authorizing" = "Errore bat egon da baimentzean"; + +"Authenticating..." = "Baimentzen..."; +"There was a problem requesting access from %@" = "Errore bat egon da %@tik sarrera eskatzean"; + +"Access Error" = "Sartze errorea"; +"There was an error while sharing" = "Errore bat egon da konpartitzean"; \ No newline at end of file diff --git a/Classes/ShareKit/Localization/fr.lproj/Localizable.strings b/Classes/ShareKit/Localization/fr.lproj/Localizable.strings new file mode 100644 index 00000000..a64249b3 --- /dev/null +++ b/Classes/ShareKit/Localization/fr.lproj/Localizable.strings @@ -0,0 +1,97 @@ +"Email" = "E-mail"; +"Username" = "Nom d'utilisateur"; +"Password" = "Mot de passe"; +"Follow %@" = "S'abonner à %@"; +"Continue" = "Continuer"; +"Share" = "Partager"; +"More..." = "+"; +"Cancel" = "Annuler"; +"Slug" = "Description"; +"Private" = "Privé"; +"Public" = "Public"; +"Caption" = "Titre"; +"Title" = "Titre"; +"Tags" = "Tags"; +"Close" = "Fermer"; +"Notes" = "Notes"; +"Note" = "Note"; +"Share" = "Partage"; +"Shared" = "Partagé"; +"Edit" = "Modifier"; +"Actions" = "Actions"; +"Services" = "Services"; +"Send to %@" = "Envoyer à %@"; +"Copy" = "Copier"; +"Copied!" = "Copié!"; +"Saving to %@" = "Sauvegarde en cours sous %@"; +"Saved!" = "Enregistré!"; +"Offline" = "Hors ligne"; +"Error" = "Erreur"; +"Login" = "Connexion"; +"Logging In..." = "En cours de connexion..."; +"Login Error" = "Erreur de connexion"; +"Connecting..." = "En cours de connexion..."; + +"Shortening URL..." = "URL acourtée..."; +"Shorten URL Error" = "Erreur d'URL accourtée"; +"We could not shorten the URL." = "L'URL n'a pu être accourtée."; + +"Create a free account at %@" = "Créer un compte gratuitement sur %@"; +"Create an account at %@" = "Créer un compte sur %@"; + +"Send to Twitter" = "Envoyer sur Twitter"; + +"Message is too long" = "Message trop long"; +"Twitter posts can only be 140 characters in length." = "Les messages Twitter ne peuvent dépasser 140 caractères."; +"Message is empty" = "Message is empty"; +"You must enter a message in order to post." = "Veuillez taper un message afin de l'envoyer."; + +"Enter your message:" = "Tapez votre message:"; + +"Invalid email or password." = "E-mail ou mot de passe incorrect"; +"The service encountered an error. Please try again later." = "Ce service n'est pas disponible actuellement. Veuillez réessayer ultérieurement."; +"There was a sending your post to Tumblr." = "Votre message n'a pas pu être envoyer sur Tumblr."; + +"There was an error saving to Pinboard" = "Une erreur a empêcher la sauvegarde sur Pinboard"; + +"Sorry, Instapaper did not accept your credentials. Please try again." = "Désolé, Instapaper n'a pas accepté vos informations de connexion. Veuillez réessayer ."; +"Sorry, Instapaper encountered an error. Please try again." = "Désolé, une erreur est survenue sur Instapaper. Veuillez réessayer ultérieurement."; +"There was a problem saving to Instapaper." = "Une erreur a empêcher la sauvegarde sur Instapaper."; + +"Incorrect username and password" = "Nom d'utilisateur ou mot de passe incorrect"; +"There was an error logging into Google Reader" = "Une erreur est survenue lors de la connexion à votre compte Google Reader"; +"There was a problem authenticating your account." = "Votre compte n'a pas pu être identifié."; +"There was a problem saving your note." = "Votre note n'a pas pu être sauvegardée."; + +"There was a problem saving to Delicious." = "Une erreur a empêcher la sauvegarde sur Delicious."; + +"Open in Safari" = "Ouvrir sous Safari"; +"Attached: %@" = "Pièce jointe: %@"; + +"You must be online to login to %@" = "Vous devez être connecter à internet pour vous connecter sur %@"; + +"Auto Share" = "Partage Auto"; +"Enable auto share to skip this step in the future." = "Habiliter le Partage Auto afin de sauter cette étape la prochaine fois."; + +"You must be online in order to share with %@" = "Vous devez être connecter à internet pour partager with %@"; +"There was an error while sharing" = "There was an error while sharing"; + +"Could not authenticate you. Please relogin." = "Votre compte n'a pas pu être identifié."; +"There was a problem requesting authorization from %@" = "Un problème a surgi lors de la demande d'autorisation sur %@"; +"Request Error" = "Request Error"; +"There was an error while sharing" = "Une erreur est survenue lors du partage"; + +"Authorize Error" = "Erreur d'autorisation"; +"There was an error while authorizing" = "Une erreur est survenue lors de l'autorisation."; + +"Authenticating..." = "Authenticating..."; +"There was a problem requesting access from %@" = "Une erreur est survenue lors de la demande d'accès sur %@"; + +"Access Error" = "Erreur d'accès"; +"There was an error while sharing" = "Une erreur est survenue lors du partage"; + +"Sharing a Link" = "Partager un lien"; +"Sharing an Image" = "Partager une image"; +"Sharing Text" = "Partager un texte"; +"Sharing a File" = "Partager un fichier"; +"Logout of All Services" = "Déconnexion de tous les services"; \ No newline at end of file diff --git a/Classes/ShareKit/Localization/ja.lproj/Localizable.strings b/Classes/ShareKit/Localization/ja.lproj/Localizable.strings new file mode 100644 index 00000000..74cebe72 --- /dev/null +++ b/Classes/ShareKit/Localization/ja.lproj/Localizable.strings @@ -0,0 +1,91 @@ +"Email" = "メール"; +"Username" = "ユーザー名"; +"Password" = "パスワード"; +"Follow %@" = "@%@をフォローする"; +"Continue" = "続ける"; +"Share" = "共有"; +"More..." = "その他"; +"Cancel" = "キャンセル"; +"Slug" = "Slug"; +"Private" = "プライベート"; +"Public" = "パブリック"; +"Caption" = "キャプション"; +"Title" = "タイトル"; +"Tags" = "タグ"; +"Close" = "閉じる"; +"Notes" = "ノート"; +"Note" = "ノート"; +"Share" = "共有"; +"Shared" = "共有"; +"Edit" = "編集"; +"Actions" = "アクション"; +"Services" = "サービス"; +"Send to %@" = "%@に送る"; +"Copy" = "コピー"; +"Copied!" = "コピーしました!"; +"Saving to %@" = "%@に保存中"; +"Saved!" = "保存しました!"; +"Offline" = "オフライン"; +"Error" = "エラー"; +"Login" = "ログイン"; +"Logging In..." = "ログイン中"; +"Login Error" = "ログイン失敗"; +"Connecting..." = "接続中"; + +"Shortening URL..." = "URLを短縮中"; +"Shorten URL Error" = "URLの短縮に失敗しました"; +"We could not shorten the URL." = "URLを短縮できませんでした"; + +"Create a free account at %@" = "%@で無料の新規アカウントを作成"; +"Create an account at %@" = "%@で新規アカウントを作成"; + +"Send to Twitter" = "ツイッターでつぶやく"; + +"Message is too long" = "メッセージが長すぎます"; +"Twitter posts can only be 140 characters in length." = "ツイッターは140文字までしか送れません"; +"Message is empty" = "メッセージが入力されていません"; +"You must enter a message in order to post." = "投稿するためにはメッセージを入力する必要があります"; + +"Enter your message:" = "メッセージを入力:"; + +"Invalid email or password." = "メールアドレスかパスワードが間違えています"; +"The service encountered an error. Please try again later." = "只今サービスが利用できません。しばらくして再試行してください"; +"There was a sending your post to Tumblr." = "Tumblrに未送信の投稿があります"; + +"There was an error saving to Pinboard" = "Pinboardの保存にエラーが起きました"; + +"Sorry, Instapaper did not accept your credentials. Please try again." = "Instapaperが認証情報を受理できませんでした。再試行してください"; +"Sorry, Instapaper encountered an error. Please try again." = "Instapaperエラーが発生しました。再試行してください"; +"There was a problem saving to Instapaper." = "Instapaperに保存中にエラーが発生しました。"; + +"Incorrect username and password" = "ユーザー名かパスワードが間違えています"; +"There was an error logging into Google Reader" = "Googleリーダーにログイン失敗しました"; +"There was a problem authenticating your account." = "ユーザー認証に問題が発生しました"; +"There was a problem saving your note." = "ノートを保存中に問題が発生しました"; + +"There was a problem saving to Delicious." = "TDeliciousに保存中に問題が発生しました"; + +"Open in Safari" = "Safariで開く"; +"Attached: %@" = "添付済: %@"; + +"You must be online to login to %@" = "%@にログインするにはオンラインである必要があります"; + +"Auto Share" = "自動共有"; +"Enable auto share to skip this step in the future." = "今後、この手順をスキップして、自動的に共有する"; + +"You must be online in order to share with %@" = "%@に共有するためにはオンラインである必要があります"; +"There was an error while sharing" = "共有にエラーが発生しました"; + +"Could not authenticate you. Please relogin." = "認証できませんでした。再度ログインしてください。"; +"There was a problem requesting authorization from %@" = "%@への認証要求に問題が発生しました"; +"Request Error" = "通信エラー"; +"There was an error while sharing" = "共有にエラーが発生しました"; + +"Authorize Error" = "認証エラー"; +"There was an error while authorizing" = "認証にエラーが発生しました"; + +"Authenticating..." = "認証中..."; +"There was a problem requesting access from %@" = "%@へのアクセスに問題が発生しました"; + +"Access Error" = "アクセスエラー"; +"There was an error while sharing" = "共有にエラーが発生しました"; \ No newline at end of file diff --git a/Classes/ShareKit/Localization/ko.lproj/Localizable.strings b/Classes/ShareKit/Localization/ko.lproj/Localizable.strings new file mode 100644 index 00000000..c565c797 --- /dev/null +++ b/Classes/ShareKit/Localization/ko.lproj/Localizable.strings @@ -0,0 +1,91 @@ +"Email" = "Email"; +"Username" = "아이디"; +"Password" = "비밀번호"; +"Follow %@" = "Follow %@"; +"Continue" = "계속"; +"Share" = "공유"; +"More..." = "기타..."; +"Cancel" = "취소"; +"Slug" = "Slug"; +"Private" = "비공개"; +"Public" = "공개"; +"Caption" = "캡션"; +"Title" = "제목"; +"Tags" = "태그"; +"Close" = "닫기"; +"Notes" = "메모"; +"Note" = "메모"; +"Share" = "공유"; +"Shared" = "공유"; +"Edit" = "편집"; +"Actions" = "Actions"; +"Services" = "Services"; +"Send to %@" = "%@로 보내기"; +"Copy" = "복사"; +"Copied!" = "복사 됨!"; +"Saving to %@" = "%@에 저장 중"; +"Saved!" = "저장 됨!"; +"Offline" = "오프라인"; +"Error" = "오류"; +"Login" = "로그인"; +"Logging In..." = "로그인 중..."; +"Login Error" = "로그인 오류"; +"Connecting..." = "접속 중..."; + +"Shortening URL..." = "URL 줄이는 중..."; +"Shorten URL Error" = "단축 URL 오류"; +"We could not shorten the URL." = "URL을 줄이지 못했습니다."; + +"Create a free account at %@" = "%@ 무료 계정 만들기"; +"Create an account at %@" = "%@ 계정 만들기"; + +"Send to Twitter" = "Twitter로 보내기"; + +"Message is too long" = "메시지가 너무 깁니다"; +"Twitter posts can only be 140 characters in length." = "Twitter 메시지는 140자를 넘을 수 없습니다."; +"Message is empty" = "보낼 메시지가 없습니다"; +"You must enter a message in order to post." = "보낼 메시지를 입력하세요."; + +"Enter your message:" = "메시지 입력:"; + +"Invalid email or password." = "잘못된 email이나 비밀번호."; +"The service encountered an error. Please try again later." = "서비스에 오류가 발생했습니다. 나중에 다시 시도해 주세요."; +"There was a sending your post to Tumblr." = "There was a sending your post to Tumblr."; + +"There was an error saving to Pinboard" = "Pinboard로 저장 중에 오류가 발생했습니다"; + +"Sorry, Instapaper did not accept your credentials. Please try again." = "Instapaper 인증에 실패했습니다. 다시 시도해 주세요."; +"Sorry, Instapaper encountered an error. Please try again." = "Instapaper 오류가 발생했습니다. 다시 시도해 주세요."; +"There was a problem saving to Instapaper." = "Instapaper로 저장 중에 문제가 발생했습니다."; + +"Incorrect username and password" = "잘못된 아이디나 비밀번호"; +"There was an error logging into Google Reader" = "Google Reader 로그인 중 오류가 발생했습니다"; +"There was a problem authenticating your account." = "게정 인증에 실패했습니다."; +"There was a problem saving your note." = "메모 저장에 실패했습니다."; + +"There was a problem saving to Delicious." = "Delicious로 저장 중에 문제가 발생했습니다."; + +"Open in Safari" = "Safari로 열기"; +"Attached: %@" = "첨부: %@"; + +"You must be online to login to %@" = "%@에 로그인 하려면 온라인 상태여야 합니다"; + +"Auto Share" = "자동 공유"; +"Enable auto share to skip this step in the future." = "나중에 이 단계를 건너뛰려면 자동 공유를 활성화하세요."; + +"You must be online in order to share with %@" = "%@(으)로 공유하려면 온라인 상태여야 합니다"; +"There was an error while sharing" = "공유 중에 오류가 발생했습니다"; + +"Could not authenticate you. Please relogin." = "인증할 수 없습니다. 다시 로그인 하세요."; +"There was a problem requesting authorization from %@" = "%@ 인증 요청에 문제가 발생했습니다"; +"Request Error" = "요청 오류"; +"There was an error while sharing" = "공유 중에 오류가 발생했습니다"; + +"Authorize Error" = "인증 오류"; +"There was an error while authorizing" = "인증 중에 오류가 발생했습니다"; + +"Authenticating..." = "인증 중..."; +"There was a problem requesting access from %@" = "%@ 접근 권한을 얻는데 실패했습니다"; + +"Access Error" = "접근 오류"; +"There was an error while sharing" = "공유 중에 오류가 발생했습니다"; \ No newline at end of file diff --git a/Classes/ShareKit/Localization/nl.lproj/Localizable.strings b/Classes/ShareKit/Localization/nl.lproj/Localizable.strings new file mode 100644 index 00000000..e93eb30b --- /dev/null +++ b/Classes/ShareKit/Localization/nl.lproj/Localizable.strings @@ -0,0 +1,91 @@ +"Email" = "Email"; +"Username" = "Gebruikersnaam"; +"Password" = "Wachtwoord"; +"Follow %@" = "Volg %@"; +"Continue" = "Doorgaan"; +"Share" = "Delen"; +"More..." = "Meer..."; +"Cancel" = "Annuleer"; +"Slug" = "Slug"; +"Private" = "Privaat"; +"Public" = "Publiek"; +"Caption" = "Onderschrift"; +"Title" = "Titel"; +"Tags" = "Tags"; +"Close" = "Sluiten"; +"Notes" = "Notities"; +"Note" = "Notitie"; +"Share" = "Delen"; +"Shared" = "Gedeeld"; +"Edit" = "Bewerken"; +"Actions" = "Acties"; +"Services" = "Diensten"; +"Send to %@" = "Verzenden naar %@"; +"Copy" = "Kopieer"; +"Copied!" = "Gekopieerd!"; +"Saving to %@" = "Bewaard naar %@"; +"Saved!" = "Bewaard!"; +"Offline" = "Offline"; +"Error" = "Fout"; +"Login" = "Inloggen"; +"Logging In..." = "Inloggen in..."; +"Login Error" = "Inlog Error"; +"Connecting..." = "Verbinden..."; + +"Shortening URL..." = "URL Verkorten..."; +"Shorten URL Error" = "URL Verkorten Error"; +"We could not shorten the URL." = "We konden de URL niet verkorten."; + +"Create a free account at %@" = "Maak een gratis account op %@"; +"Create an account at %@" = "Maak een account op %@"; + +"Send to Twitter" = "Verzend naar Twitter"; + +"Message is too long" = "Bericht is te lang"; +"Twitter posts can only be 140 characters in length." = "Twitter bericht mag maar 140 karakters bevatten."; +"Message is empty" = "Bericht is leeg"; +"You must enter a message in order to post." = "Je moet een bericht invullen om te kunnen verzenden."; + +"Enter your message:" = "Maak je bericht:"; + +"Invalid email or password." = "Fout email of password."; +"The service encountered an error. Please try again later." = "De dienst gaf een fout. Probeer het later opnieuw."; +"There was a sending your post to Tumblr." = "Er trad een fout op bij het versturen naar Tumblr."; + +"There was an error saving to Pinboard" = "Pinboard gaf een fout bij het bewaren."; + +"Sorry, Instapaper did not accept your credentials. Please try again." = "Instapaper accepteert de login gegevens niet. Probeer het nogmaals."; +"Sorry, Instapaper encountered an error. Please try again." = "Instapaper gaf een fout. Probeer het nogmaals."; +"There was a problem saving to Instapaper." = "Er was een probleem bij het bewaren naar Instapaper."; + +"Incorrect username and password" = "Gebruikersnaam en wachtwoord niet goed"; +"There was an error logging into Google Reader" = "Er trad een fout op bij het inloggen bij Google Reader"; +"There was a problem authenticating your account." = "Er was een probleem bij het verifiëren van het account."; +"There was a problem saving your note." = "Er was een probleem bij het bewaren van de notitie."; + +"There was a problem saving to Delicious." = "Er was een probleem bij het bewaren op Delicious."; + +"Open in Safari" = "Open in Safari"; +"Attached: %@" = "Bijlage: %@"; + +"You must be online to login to %@" = "Je moet onlinge zijn om in te loggen %@"; + +"Auto Share" = "Automatisch delen"; +"Enable auto share to skip this step in the future." = "Zet automatisch delen aan om deze stap over te slaan in de toekomst."; + +"You must be online in order to share with %@" = "Je moet online zijn om te kunnen delen via %@"; +"There was an error while sharing" = "Er trad een fout op bij het delen"; + +"Could not authenticate you. Please relogin." = "Kon niet autoriseren. Log opnieuw in."; +"There was a problem requesting authorization from %@" = "Er trad een probleem op bij het autoriseren bij %@"; +"Request Error" = "Aanvraag Fout"; +"There was an error while sharing" = "Er trad een fout op bij het delen"; + +"Authorize Error" = "Autoriseer Error"; +"There was an error while authorizing" = "Er trad een probleem op bij het autoriseren"; + +"Authenticating..." = "Autoriseren..."; +"There was a problem requesting access from %@" = "Er was een probleem bij de aanvraag van %@"; + +"Access Error" = "Toegangs Error"; +"There was an error while sharing" = "Er trad een fout op bij het delen"; \ No newline at end of file diff --git a/Classes/ShareKit/Localization/vi.lproj/Localizable.strings b/Classes/ShareKit/Localization/vi.lproj/Localizable.strings new file mode 100644 index 00000000..0b9d66d6 Binary files /dev/null and b/Classes/ShareKit/Localization/vi.lproj/Localizable.strings differ diff --git a/Classes/ShareKit/Localization/zh_CN.lproj/Localizable.strings b/Classes/ShareKit/Localization/zh_CN.lproj/Localizable.strings new file mode 100644 index 00000000..b3b6eb56 --- /dev/null +++ b/Classes/ShareKit/Localization/zh_CN.lproj/Localizable.strings @@ -0,0 +1,94 @@ +"Email" = "电子邮件"; +"Username" = "用户名"; +"Password" = "密码"; +"Follow %@" = "关注%@"; +"Continue" = "继续"; +"Share" = "分享"; +"More..." = "更多…"; +"Cancel" = "取消"; +"Slug" = "Slug"; +"Private" = "私有"; +"Public" = "公开"; +"Caption" = "标题"; +"Title" = "标题"; +"Tags" = "标签"; +"Close" = "关闭"; +"Notes" = "笔记"; +"Note" = "笔记"; +"Share" = "分享"; +"Shared" = "已分享"; +"Edit" = "编辑"; +"Actions" = "动作"; +"Services" = "服务"; +"Send to %@" = "发送到 %@"; +"Copy" = "复制"; +"Copied!" = "已复制!"; +"Saving to %@" = "保存至%@"; +"Saved!" = "已保存!"; +"Offline" = "离线"; +"Error" = "错误"; +"Login" = "登录"; +"Logging In..." = "登录中…"; +"Login Error" = "登录出错"; +"Connecting..." = "连接中…"; + + +"Shortening URL..." = "缩短网址…"; +"Shorten URL Error" = "缩短网址出错"; +"We could not shorten the URL." = "我们无法缩短网址。"; + +"Create a free account at %@" = "在 %@ 上创建一个免费账户"; +"Create an account at %@" = "在 %@ 上创建一个账户"; + +"Send to Twitter" = "发送到 Twitter"; + +"Message is too long" = "消息太长了"; +"Twitter posts can only be 140 characters in length." = "Twitter 消息不能超过 140 个字符。"; +"Message is empty" = "消息为空"; +"You must enter a message in order to post." = "你必须先输入一条消息。"; + +"Enter your message:" = "输入你的消息:"; + +"Invalid email or password." = "Email 或密码不正确。"; +"The service encountered an error. Please try again later." = "此服务碰到了一点错误,请稍后重试。"; +"There was an error sending your post to Tumblr." = "发送至 Tumblr 的过程中出错。"; + +"There was an error saving to Pinboard" = "保存到 Pinboard 的过程中出错"; + +"Sorry, Instapaper did not accept your credentials. Please try again." = "抱歉,Instapaper 无法验证您的账号,请重试。"; +"Sorry, Instapaper encountered an error. Please try again." = "抱歉,Instapaper 碰到了一个问题,请重试。"; +"There was a problem saving to Instapaper." = "保存到 Instapaper 的过程中出错。"; + +"Incorrect username and password" = "用户名或密码不正确"; +"There was an error logging into Google Reader" = "登录到 Google Reader 的过程中出错"; +"There was a problem authenticating your account." = "验证您账户的过程中出错。"; +"There was a problem saving your note." = "保存您笔记的过程中出错。"; + +"There was a problem saving to Delicious." = "保存到 Delicious 的过程中出错。"; + +"Open in Safari" = "在 Safari 中打开"; +"Attached: %@" = "附件: %@"; + +"You must be online to login to %@" = "要登录到 %@ 上您必须在线"; + +"Auto Share" = "自动分享"; +"Enable auto share to skip this step in the future." = "启动自动分享,在以后可以跳过此步。"; + +"You must be online in order to share with %@" = "要分享 %@ 的话您必须在线。"; +"There was an error while sharing" = "分享过程中出错"; + +"Could not authenticate you. Please relogin." = "无法验证,请重新登录。"; +"There was a problem requesting authorization from %@" = "在向 %@ 请求验证的过程中出错"; +"Request Error" = "请求错误"; +"There was an error while sharing" = "分享过程中出错"; + +"Authorize Error" = "验证错误"; +"There was an error while authorizing" = "验证的过程中出错"; + +"Authenticating..." = "验证中…"; +"There was a problem requesting access from %@" = "从 %@ 获取口令出错"; + +"Access Error" = "访问错误"; +"There was an error while sharing" = "在分享的过程中出错"; + +"Save to Photo Album" = "保存到相簿"; \ No newline at end of file diff --git a/Classes/ShareKit/Reachability/Reachability.h b/Classes/ShareKit/Reachability/Reachability.h new file mode 100644 index 00000000..1f72d45a --- /dev/null +++ b/Classes/ShareKit/Reachability/Reachability.h @@ -0,0 +1,88 @@ +/* + + File: Reachability.h + Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs. + + Version: 2.1 + + Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. + ("Apple") in consideration of your agreement to the following terms, and your + use, installation, modification or redistribution of this Apple software + constitutes acceptance of these terms. If you do not agree with these terms, + please do not use, install, modify or redistribute this Apple software. + + In consideration of your agreement to abide by the following terms, and subject + to these terms, Apple grants you a personal, non-exclusive license, under + Apple's copyrights in this original Apple software (the "Apple Software"), to + use, reproduce, modify and redistribute the Apple Software, with or without + modifications, in source and/or binary forms; provided that if you redistribute + the Apple Software in its entirety and without modifications, you must retain + this notice and the following text and disclaimers in all such redistributions + of the Apple Software. + Neither the name, trademarks, service marks or logos of Apple Inc. may be used + to endorse or promote products derived from the Apple Software without specific + prior written permission from Apple. Except as expressly stated in this notice, + no other rights or licenses, express or implied, are granted by Apple herein, + including but not limited to any patent rights that may be infringed by your + derivative works or by other works in which the Apple Software may be + incorporated. + + The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO + WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED + WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN + COMBINATION WITH YOUR PRODUCTS. + + IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR + DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF + CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF + APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Copyright (C) 2010 Apple Inc. All Rights Reserved. + +*/ + + +#import +#import + +typedef enum { + NotReachable = 0, + ReachableViaWiFi, + ReachableViaWWAN +} NetworkStatus; +#define kReachabilityChangedNotification @"kNetworkReachabilityChangedNotification" + +@interface Reachability: NSObject +{ + BOOL localWiFiRef; + SCNetworkReachabilityRef reachabilityRef; +} + +//reachabilityWithHostName- Use to check the reachability of a particular host name. ++ (Reachability*) reachabilityWithHostName: (NSString*) hostName; + +//reachabilityWithAddress- Use to check the reachability of a particular IP address. ++ (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress; + +//reachabilityForInternetConnection- checks whether the default route is available. +// Should be used by applications that do not connect to a particular host ++ (Reachability*) reachabilityForInternetConnection; + +//reachabilityForLocalWiFi- checks whether a local wifi connection is available. ++ (Reachability*) reachabilityForLocalWiFi; + +//Start listening for reachability notifications on the current run loop +- (BOOL) startNotifier; +- (void) stopNotifier; + +- (NetworkStatus) currentReachabilityStatus; +//WWAN may be available, but not active until a connection has been established. +//WiFi may require a connection for VPN on Demand. +- (BOOL) connectionRequired; +@end + + diff --git a/Classes/ShareKit/Reachability/Reachability.m b/Classes/ShareKit/Reachability/Reachability.m new file mode 100644 index 00000000..a7f69abd --- /dev/null +++ b/Classes/ShareKit/Reachability/Reachability.m @@ -0,0 +1,273 @@ +/* + + File: Reachability.m + Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs. + + Version: 2.1 + + Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. + ("Apple") in consideration of your agreement to the following terms, and your + use, installation, modification or redistribution of this Apple software + constitutes acceptance of these terms. If you do not agree with these terms, + please do not use, install, modify or redistribute this Apple software. + + In consideration of your agreement to abide by the following terms, and subject + to these terms, Apple grants you a personal, non-exclusive license, under + Apple's copyrights in this original Apple software (the "Apple Software"), to + use, reproduce, modify and redistribute the Apple Software, with or without + modifications, in source and/or binary forms; provided that if you redistribute + the Apple Software in its entirety and without modifications, you must retain + this notice and the following text and disclaimers in all such redistributions + of the Apple Software. + Neither the name, trademarks, service marks or logos of Apple Inc. may be used + to endorse or promote products derived from the Apple Software without specific + prior written permission from Apple. Except as expressly stated in this notice, + no other rights or licenses, express or implied, are granted by Apple herein, + including but not limited to any patent rights that may be infringed by your + derivative works or by other works in which the Apple Software may be + incorporated. + + The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO + WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED + WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN + COMBINATION WITH YOUR PRODUCTS. + + IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR + DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF + CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF + APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Copyright (C) 2010 Apple Inc. All Rights Reserved. + +*/ + +#import +#import +#import +#import +#import +#import + +#import + +#import "Reachability.h" + +#define kShouldPrintReachabilityFlags 0 + +static void PrintReachabilityFlags(SCNetworkReachabilityFlags flags, const char* comment) +{ +#if kShouldPrintReachabilityFlags + + NSLog(@"Reachability Flag Status: %c%c %c%c%c%c%c%c%c %s\n", + (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-', + (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-', + + (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-', + (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-', + (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-', + (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-', + (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-', + (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-', + (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-', + comment + ); +#endif +} + + +@implementation Reachability +static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info) +{ + #pragma unused (target, flags) + NSCAssert(info != NULL, @"info was NULL in ReachabilityCallback"); + NSCAssert([(NSObject*) info isKindOfClass: [Reachability class]], @"info was wrong class in ReachabilityCallback"); + + //We're on the main RunLoop, so an NSAutoreleasePool is not necessary, but is added defensively + // in case someon uses the Reachablity object in a different thread. + NSAutoreleasePool* myPool = [[NSAutoreleasePool alloc] init]; + + Reachability* noteObject = (Reachability*) info; + // Post a notification to notify the client that the network reachability changed. + [[NSNotificationCenter defaultCenter] postNotificationName: kReachabilityChangedNotification object: noteObject]; + + [myPool release]; +} + +- (BOOL) startNotifier +{ + BOOL retVal = NO; + SCNetworkReachabilityContext context = {0, self, NULL, NULL, NULL}; + if(SCNetworkReachabilitySetCallback(reachabilityRef, ReachabilityCallback, &context)) + { + if(SCNetworkReachabilityScheduleWithRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)) + { + retVal = YES; + } + } + return retVal; +} + +- (void) stopNotifier +{ + if(reachabilityRef!= NULL) + { + SCNetworkReachabilityUnscheduleFromRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); + } +} + +- (void) dealloc +{ + [self stopNotifier]; + if(reachabilityRef!= NULL) + { + CFRelease(reachabilityRef); + } + [super dealloc]; +} + ++ (Reachability*) reachabilityWithHostName: (NSString*) hostName; +{ + Reachability* retVal = NULL; + SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, [hostName UTF8String]); + if(reachability!= NULL) + { + retVal= [[[self alloc] init] autorelease]; + if(retVal!= NULL) + { + retVal->reachabilityRef = reachability; + retVal->localWiFiRef = NO; + } + } + return retVal; +} + ++ (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress; +{ + SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress); + Reachability* retVal = NULL; + if(reachability!= NULL) + { + retVal= [[[self alloc] init] autorelease]; + if(retVal!= NULL) + { + retVal->reachabilityRef = reachability; + retVal->localWiFiRef = NO; + } + } + return retVal; +} + ++ (Reachability*) reachabilityForInternetConnection; +{ + struct sockaddr_in zeroAddress; + bzero(&zeroAddress, sizeof(zeroAddress)); + zeroAddress.sin_len = sizeof(zeroAddress); + zeroAddress.sin_family = AF_INET; + return [self reachabilityWithAddress: &zeroAddress]; +} + ++ (Reachability*) reachabilityForLocalWiFi; +{ + struct sockaddr_in localWifiAddress; + bzero(&localWifiAddress, sizeof(localWifiAddress)); + localWifiAddress.sin_len = sizeof(localWifiAddress); + localWifiAddress.sin_family = AF_INET; + // IN_LINKLOCALNETNUM is defined in as 169.254.0.0 + localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM); + Reachability* retVal = [self reachabilityWithAddress: &localWifiAddress]; + if(retVal!= NULL) + { + retVal->localWiFiRef = YES; + } + return retVal; +} + +#pragma mark Network Flag Handling + +- (NetworkStatus) localWiFiStatusForFlags: (SCNetworkReachabilityFlags) flags +{ + PrintReachabilityFlags(flags, "localWiFiStatusForFlags"); + + BOOL retVal = NotReachable; + if((flags & kSCNetworkReachabilityFlagsReachable) && (flags & kSCNetworkReachabilityFlagsIsDirect)) + { + retVal = ReachableViaWiFi; + } + return retVal; +} + +- (NetworkStatus) networkStatusForFlags: (SCNetworkReachabilityFlags) flags +{ + PrintReachabilityFlags(flags, "networkStatusForFlags"); + if ((flags & kSCNetworkReachabilityFlagsReachable) == 0) + { + // if target host is not reachable + return NotReachable; + } + + BOOL retVal = NotReachable; + + if ((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0) + { + // if target host is reachable and no connection is required + // then we'll assume (for now) that your on Wi-Fi + retVal = ReachableViaWiFi; + } + + + if ((((flags & kSCNetworkReachabilityFlagsConnectionOnDemand ) != 0) || + (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0)) + { + // ... and the connection is on-demand (or on-traffic) if the + // calling application is using the CFSocketStream or higher APIs + + if ((flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0) + { + // ... and no [user] intervention is needed + retVal = ReachableViaWiFi; + } + } + + if ((flags & kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN) + { + // ... but WWAN connections are OK if the calling application + // is using the CFNetwork (CFSocketStream?) APIs. + retVal = ReachableViaWWAN; + } + return retVal; +} + +- (BOOL) connectionRequired; +{ + NSAssert(reachabilityRef != NULL, @"connectionRequired called with NULL reachabilityRef"); + SCNetworkReachabilityFlags flags; + if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) + { + return (flags & kSCNetworkReachabilityFlagsConnectionRequired); + } + return NO; +} + +- (NetworkStatus) currentReachabilityStatus +{ + NSAssert(reachabilityRef != NULL, @"currentNetworkStatus called with NULL reachabilityRef"); + NetworkStatus retVal = NotReachable; + SCNetworkReachabilityFlags flags; + if (SCNetworkReachabilityGetFlags(reachabilityRef, &flags)) + { + if(localWiFiRef) + { + retVal = [self localWiFiStatusForFlags: flags]; + } + else + { + retVal = [self networkStatusForFlags: flags]; + } + } + return retVal; +} +@end diff --git a/Classes/ShareKit/SHKConfig.h b/Classes/ShareKit/SHKConfig.h new file mode 100644 index 00000000..2f7ac7b8 --- /dev/null +++ b/Classes/ShareKit/SHKConfig.h @@ -0,0 +1,179 @@ + + + + +// PLEASE SEE INSTALL/CONFIG INSTRUCTIONS: +// http://getsharekit.com/install + + + + + + +// App Description +// These values are used by any service that shows 'shared from XYZ' + +#define SHKMyAppName @"My App Name" +#define SHKMyAppURL @"http://example.com" + + + +/* +API Keys +-------- +This is the longest step to getting set up, it involves filling in API keys for the supported services. +It should be pretty painless though and should hopefully take no more than a few minutes. + +Each key below as a link to a page where you can generate an api key. Fill in the key for each service below. + +A note on services you don't need: +If, for example, your app only shares URLs then you probably won't need image services like Flickr. +In these cases it is safe to leave an API key blank. + +However, it is STRONGLY recommended that you do your best to support all services for the types of sharing you support. +The core principle behind ShareKit is to leave the service choices up to the user. Thus, you should not remove any services, +leaving that decision up to the user. +*/ + + +// Delicious - https://developer.apps.yahoo.com/projects +#define SHKDeliciousConsumerKey @"dj0yJmk9bHJJQTN4ajFOVkU4JmQ9WVdrOWVqSjJiMng1TjJVbWNHbzlNamc1T1RnM05qWXkmcz1jb25zdW1lcnNlY3JldCZ4PTgx" +#define SHKDeliciousSecretKey @"5a2be05d7508f3be9ba4f7b67b95ec9dd4feb2e9" + + +// Evernote - http://www.evernote.com/about/developer/api/ +#define SHKEvernoteConsumerKey @"readitlater" +#define SHKEvernoteSecretKey @"c4faf84d7c4b958c" +#define SHKEvernoteUserStoreURL @"https://sandbox.evernote.com/edam/user" +#define SHKEvernoteNetStoreURLBase @"http://sandbox.evernote.com/edam/note/" +// If your Consumer Key is activated by Evernote support, change these constants following: +//#define SHKEvernoteUserStoreURL @"https://www.evernote.com/edam/user" +//#define SHKEvernoteNetStoreURLBase @"http://www.evernote.com/edam/note/" + + +// Facebook - http://www.facebook.com/developers +// If SHKFacebookUseSessionProxy is enabled then SHKFacebookSecret is ignored and should be left blank + +#define SHKFacebookUseSessionProxy NO +#define SHKFacebookKey @"865df42c04f42f95ba8b6775d9aba67a" +#define SHKFacebookSecret @"ff527ecdb5c2f3081b04824cce991c11" +#define SHKFacebookSessionProxyURL @"" + + +// Read It Later - http://readitlaterlist.com/api/ +#define SHKReadItLaterKey @"0Z0A5y05deD94k74d6p4960N9eT1BF6a" // (optional) : Recommended, apps using keys are featured in the RIL app directory and can track usage. + + +// Twitter - http://dev.twitter.com/apps/new +/* + Important Twitter settings to get right: + + Differences between OAuth and xAuth + -- + There are two types of authentication provided for Twitter, OAuth and xAuth. OAuth is the default and will + present a web view to log the user in. xAuth presents a native entry form but requires Twitter to add xAuth to your app (you have to request it from them). + If your app has been approved for xAuth, set SHKTwitterUseXAuth to 1. + + Callback URL (important to get right for OAuth users) + -- + 1. Open your application settings at http://dev.twitter.com/apps/ + 2. 'Application Type' should be set to BROWSER (not client) + 3. 'Callback URL' should match whatever you enter in SHKTwitterCallbackUrl. The callback url doesn't have to be an actual existing url. The user will never get to it because ShareKit intercepts it before the user is redirected. It just needs to match. +*/ +#define SHKTwitterConsumerKey @"Q3EvVAsxIj6cXymHJeTZNw" +#define SHKTwitterSecret @"6JvXlx92AI07kcgqQzrWN7hOhubHrvWEYUuhcs7DE" +#define SHKTwitterCallbackUrl @"http://readitlaterlist.com/oauthcallback" // HOW-TO: In your Twitter application settings, use the "Callback URL" field. If you do not have this field in the settings, set your application type to 'Browser'. +#define SHKTwitterUseXAuth 0 // To use xAuth, set to 1 +#define SHKTwitterUsername @"ReadItLater" // Enter your app's twitter account if you'd like to ask the user to follow it when logging in. (Only for xAuth) + + +// Bit.ly (for shortening URLs on Twitter) - http://bit.ly/account/register - after signup: http://bit.ly/a/your_api_key +#define SHKBitLyLogin @"readitlater" +#define SHKBitLyKey @"R_01ef88f67ae36d11f80119810a65ddb9" + + + + + +/* + Translations +*/ +#warning Read this important note on included translations +// Read http://getsharekit.com/translations and then you can remove this warning + + + +/* + UI Configuration : Basic + ------ + These provide controls for basic UI settings. For more advanced configuration see below. +*/ + +// Toolbars +#define SHKBarStyle @"UIBarStyleDefault" // See: http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIKitDataTypesReference/Reference/reference.html#//apple_ref/c/econst/UIBarStyleDefault +#define SHKBarTintColorRed -1 // Value between 0-255, set all to -1 for default +#define SHKBarTintColorGreen -1 // Value between 0-255, set all to -1 for default +#define SHKBarTintColorBlue -1 // Value between 0-255, set all to -1 for default + +// Forms +#define SHKFormFontColorRed -1 // Value between 0-255, set all to -1 for default +#define SHKFormFontColorGreen -1 // Value between 0-255, set all to -1 for default +#define SHKFormFontColorBlue -1 // Value between 0-255, set all to -1 for default + +#define SHKFormBgColorRed -1 // Value between 0-255, set all to -1 for default +#define SHKFormBgColorGreen -1 // Value between 0-255, set all to -1 for default +#define SHKFormBgColorBlue -1 // Value between 0-255, set all to -1 for default + +// iPad views +#define SHKModalPresentationStyle @"UIModalPresentationFormSheet" // See: http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalPresentationStyle +#define SHKModalTransitionStyle @"UIModalTransitionStyleCoverVertical" // See: http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIViewController_Class/Reference/Reference.html#//apple_ref/occ/instp/UIViewController/modalTransitionStyle + +// ShareMenu Ordering +#define SHKShareMenuAlphabeticalOrder 1 // Setting this to 1 will show list in Alphabetical Order, setting to 0 will follow the order in SHKShares.plist + +// Append 'Shared With 'Signature to Email (and related forms) +#define SHKSharedWithSignature 1 + + +/* + UI Configuration : Advanced + ------ + If you'd like to do more advanced customization of the ShareKit UI, like background images and more, + check out http://getsharekit.com/customize +*/ + + + + +/* + Debugging + ------ + To show debug output in the console: + 1. uncomment section A below + 2. comment out section B below + + To hide debug output in the console: + 1. uncomment section B below + 2. comment out section A below +*/ + +// A : show debug output +#define SHKDebugShowLogs 1 +#define SHKLog( s, ... ) NSLog( @"<%p %@:(%d)> %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] ) + +// B : hide debug output +//#define SHKDebugShowLogs 0 +//#define SHKLog( s, ... ) + + + +/* +Advanced Configuration + ------ +These settings can be left as is. +*/ + +#define SHK_MAX_FAV_COUNT 3 +#define SHK_FAVS_PREFIX_KEY @"SHK_FAVS_" +#define SHK_AUTH_PREFIX @"SHK_AUTH_" + diff --git a/Classes/ShareKit/Sharers/Actions/Copy/SHKCopy.h b/Classes/ShareKit/Sharers/Actions/Copy/SHKCopy.h new file mode 100644 index 00000000..857f5810 --- /dev/null +++ b/Classes/ShareKit/Sharers/Actions/Copy/SHKCopy.h @@ -0,0 +1,36 @@ +// +// SHKCopy.h +// ShareKit +// +// Created by Nathan Weiner on 6/20/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import +#import "SHKSharer.h" + +@interface SHKCopy : SHKSharer +{ + +} + +@end diff --git a/Classes/ShareKit/Sharers/Actions/Copy/SHKCopy.m b/Classes/ShareKit/Sharers/Actions/Copy/SHKCopy.m new file mode 100644 index 00000000..910dc04c --- /dev/null +++ b/Classes/ShareKit/Sharers/Actions/Copy/SHKCopy.m @@ -0,0 +1,92 @@ +// +// SHKCopy.m +// ShareKit +// +// Created by Nathan Weiner on 6/20/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKCopy.h" + + +@implementation SHKCopy + +#pragma mark - +#pragma mark Configuration : Service Defination + ++ (NSString *)sharerTitle +{ + return SHKLocalizedString(@"Copy"); +} + ++ (BOOL)canShareURL +{ + return YES; +} + ++ (BOOL)canShareImage +{ + return YES; +} + ++ (BOOL)shareRequiresInternetConnection +{ + return NO; +} + ++ (BOOL)requiresAuthentication +{ + return NO; +} + + +#pragma mark - +#pragma mark Configuration : Dynamic Enable + +- (BOOL)shouldAutoShare +{ + return YES; +} + + +#pragma mark - +#pragma mark Share API Methods + +- (BOOL)send +{ + if (item.shareType == SHKShareTypeURL) + [[UIPasteboard generalPasteboard] setString:item.URL.absoluteString]; + + else + [[UIPasteboard generalPasteboard] setImage:item.image]; + + // Notify user + [[SHKActivityIndicator currentIndicator] displayCompleted:SHKLocalizedString(@"Copied!")]; + + // Notify delegate, but quietly + self.quiet = YES; + [self sendDidFinish]; + + return YES; +} + +@end diff --git a/Classes/ShareKit/Sharers/Actions/Email/SHKMail.h b/Classes/ShareKit/Sharers/Actions/Email/SHKMail.h new file mode 100644 index 00000000..6cc3c78a --- /dev/null +++ b/Classes/ShareKit/Sharers/Actions/Email/SHKMail.h @@ -0,0 +1,45 @@ +// +// SHKMail.h +// ShareKit +// +// Created by Nathan Weiner on 6/17/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import +#import "SHKSharer.h" +#import + + +@interface MFMailComposeViewController (SHK) +- (void)SHKviewDidDisappear:(BOOL)animated; +@end + + +@interface SHKMail : SHKSharer +{ + +} + +- (BOOL)sendMail; + +@end diff --git a/Classes/ShareKit/Sharers/Actions/Email/SHKMail.m b/Classes/ShareKit/Sharers/Actions/Email/SHKMail.m new file mode 100644 index 00000000..25373909 --- /dev/null +++ b/Classes/ShareKit/Sharers/Actions/Email/SHKMail.m @@ -0,0 +1,206 @@ +// +// SHKMail.m +// ShareKit +// +// Created by Nathan Weiner on 6/17/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKMail.h" + + +@implementation MFMailComposeViewController (SHK) + +- (void)SHKviewDidDisappear:(BOOL)animated +{ + [super viewDidDisappear:animated]; + + // Remove the SHK view wrapper from the window (but only if the view doesn't have another modal over it) + if (self.modalViewController == nil) + [[SHK currentHelper] viewWasDismissed]; +} + +@end + + + +@implementation SHKMail + +#pragma mark - +#pragma mark Configuration : Service Defination + ++ (NSString *)sharerTitle +{ + return SHKLocalizedString(@"Email"); +} + ++ (BOOL)canShareText +{ + return YES; +} + ++ (BOOL)canShareURL +{ + return YES; +} + ++ (BOOL)canShareImage +{ + return YES; +} + ++ (BOOL)canShareFile +{ + return YES; +} + ++ (BOOL)shareRequiresInternetConnection +{ + return NO; +} + ++ (BOOL)requiresAuthentication +{ + return NO; +} + + +#pragma mark - +#pragma mark Configuration : Dynamic Enable + ++ (BOOL)canShare +{ + return [MFMailComposeViewController canSendMail]; +} + +- (BOOL)shouldAutoShare +{ + return YES; +} + + + +#pragma mark - +#pragma mark Share API Methods + +- (BOOL)send +{ + self.quiet = YES; + + if (![self validateItem]) + return NO; + + return [self sendMail]; // Put the actual sending action in another method to make subclassing SHKMail easier +} + +- (BOOL)sendMail +{ + MFMailComposeViewController *mailController = [[[MFMailComposeViewController alloc] init] autorelease]; + if (!mailController) { + // e.g. no mail account registered (will show alert) + [[SHK currentHelper] hideCurrentViewControllerAnimated:YES]; + return YES; + } + + mailController.mailComposeDelegate = self; + + NSString *body = [item customValueForKey:@"body"]; + + if (body == nil) + { + if (item.text != nil) + body = item.text; + + if (item.URL != nil) + { + NSString *urlStr = [item.URL.absoluteString stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + + if (body != nil) + body = [body stringByAppendingFormat:@"

%@", urlStr]; + + else + body = urlStr; + } + + if (item.data) + { + NSString *attachedStr = SHKLocalizedString(@"Attached: %@", item.title ? item.title : item.filename); + + if (body != nil) + body = [body stringByAppendingFormat:@"

%@", attachedStr]; + + else + body = attachedStr; + } + + // fallback + if (body == nil) + body = @""; + + // sig + if (SHKSharedWithSignature) + { + body = [body stringByAppendingString:@"

"]; + body = [body stringByAppendingString:SHKLocalizedString(@"Sent from %@", SHKMyAppName)]; + } + + // save changes to body + [item setCustomValue:body forKey:@"body"]; + } + + if (item.data) + [mailController addAttachmentData:item.data mimeType:item.mimeType fileName:item.filename]; + + if (item.image) + [mailController addAttachmentData:UIImageJPEGRepresentation(item.image, 1) mimeType:@"image/jpeg" fileName:@"Image.jpg"]; + + [mailController setSubject:item.title]; + [mailController setMessageBody:body isHTML:YES]; + + [[SHK currentHelper] showViewController:mailController]; + + return YES; +} + +- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error +{ + [[SHK currentHelper] hideCurrentViewControllerAnimated:YES]; + + switch (result) + { + case MFMailComposeResultSent: + [self sendDidFinish]; + break; + case MFMailComposeResultSaved: + [self sendDidFinish]; + break; + case MFMailComposeResultCancelled: + [self sendDidCancel]; + break; + case MFMailComposeResultFailed: + [self sendDidFailWithError:nil]; + break; + } +} + + +@end diff --git a/Classes/ShareKit/Sharers/Actions/Open in Safari/SHKSafari.h b/Classes/ShareKit/Sharers/Actions/Open in Safari/SHKSafari.h new file mode 100644 index 00000000..96cd16fd --- /dev/null +++ b/Classes/ShareKit/Sharers/Actions/Open in Safari/SHKSafari.h @@ -0,0 +1,36 @@ +// +// SHKSafari.h +// ShareKit +// +// Created by Nathan Weiner on 6/20/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import +#import "SHKSharer.h" + +@interface SHKSafari : SHKSharer +{ + +} + +@end diff --git a/Classes/ShareKit/Sharers/Actions/Open in Safari/SHKSafari.m b/Classes/ShareKit/Sharers/Actions/Open in Safari/SHKSafari.m new file mode 100644 index 00000000..489520f6 --- /dev/null +++ b/Classes/ShareKit/Sharers/Actions/Open in Safari/SHKSafari.m @@ -0,0 +1,83 @@ +// +// SHKSafari.m +// ShareKit +// +// Created by Nathan Weiner on 6/20/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKSafari.h" + + +@implementation SHKSafari + + + +#pragma mark - +#pragma mark Configuration : Service Defination + ++ (NSString *)sharerTitle +{ + return SHKLocalizedString(@"Open in Safari"); +} + ++ (BOOL)canShareURL +{ + return YES; +} + ++ (BOOL)shareRequiresInternetConnection +{ + return NO; +} + ++ (BOOL)requiresAuthentication +{ + return NO; +} + + + +#pragma mark - +#pragma mark Configuration : Dynamic Enable + +- (BOOL)shouldAutoShare +{ + return YES; +} + + +#pragma mark - +#pragma mark Share API Methods + +- (BOOL)send +{ + self.quiet = YES; + + [[UIApplication sharedApplication] openURL:item.URL]; + + [self sendDidFinish]; + + return YES; +} + +@end diff --git a/Classes/ShareKit/Sharers/Actions/Save to Album/SHKPhotoAlbum.h b/Classes/ShareKit/Sharers/Actions/Save to Album/SHKPhotoAlbum.h new file mode 100644 index 00000000..caf00757 --- /dev/null +++ b/Classes/ShareKit/Sharers/Actions/Save to Album/SHKPhotoAlbum.h @@ -0,0 +1,36 @@ +// +// SHKPhotoAlbum.h +// ShareKit +// +// Created by Richard Johnson on 7/22/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import +#import "SHKSharer.h" + +@interface SHKPhotoAlbum : SHKSharer +{ + +} + +@end diff --git a/Classes/ShareKit/Sharers/Actions/Save to Album/SHKPhotoAlbum.m b/Classes/ShareKit/Sharers/Actions/Save to Album/SHKPhotoAlbum.m new file mode 100644 index 00000000..5e5bc50d --- /dev/null +++ b/Classes/ShareKit/Sharers/Actions/Save to Album/SHKPhotoAlbum.m @@ -0,0 +1,84 @@ +// +// SHKPhotoAlbum.m +// ShareKit +// +// Created by Richard Johnson on 7/22/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKPhotoAlbum.h" + + +@implementation SHKPhotoAlbum + +#pragma mark - +#pragma mark Configuration : Service Definition + ++ (NSString *)sharerTitle +{ + return SHKLocalizedString(@"Save to Photo Album"); +} + ++ (BOOL)canShareImage +{ + return YES; +} + ++ (BOOL)shareRequiresInternetConnection +{ + return NO; +} + ++ (BOOL)requiresAuthentication +{ + return NO; +} + + +#pragma mark - +#pragma mark Configuration : Dynamic Enable + +- (BOOL)shouldAutoShare +{ + return YES; +} + + +#pragma mark - +#pragma mark Share API Methods + +- (BOOL)send +{ + if (item.shareType == SHKShareTypeImage) + UIImageWriteToSavedPhotosAlbum(item.image, nil, nil, nil); + + // Notify user + [[SHKActivityIndicator currentIndicator] displayCompleted:SHKLocalizedString(@"Copied!")]; + + // Notify delegate, but quietly + self.quiet = YES; + [self sendDidFinish]; + + return YES; +} + +@end diff --git a/Classes/ShareKit/Sharers/Actions/Text Message/SHKTextMessage.h b/Classes/ShareKit/Sharers/Actions/Text Message/SHKTextMessage.h new file mode 100644 index 00000000..5a720879 --- /dev/null +++ b/Classes/ShareKit/Sharers/Actions/Text Message/SHKTextMessage.h @@ -0,0 +1,39 @@ +// +// SHKTextMessage.h +// ShareKit +// +// Created by Jeremy Lyman on 9/21/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import +#import +#import "SHKSharer.h" + +@interface SHKTextMessage : SHKSharer +{ + +} + +- (BOOL)sendText; + +@end diff --git a/Classes/ShareKit/Sharers/Actions/Text Message/SHKTextMessage.m b/Classes/ShareKit/Sharers/Actions/Text Message/SHKTextMessage.m new file mode 100644 index 00000000..f66e1f34 --- /dev/null +++ b/Classes/ShareKit/Sharers/Actions/Text Message/SHKTextMessage.m @@ -0,0 +1,174 @@ +// +// SHKTextMessage.m +// ShareKit +// +// Created by Jeremy Lyman on 9/21/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKTextMessage.h" + + +@implementation MFMessageComposeViewController (SHK) + +- (void)SHKviewDidDisappear:(BOOL)animated +{ + [super viewDidDisappear:animated]; + + // Remove the SHK view wrapper from the window (but only if the view doesn't have another modal over it) + if (self.modalViewController == nil) + [[SHK currentHelper] viewWasDismissed]; +} + +@end + + + +@implementation SHKTextMessage + +#pragma mark - +#pragma mark Configuration : Service Defination + ++ (NSString *)sharerTitle +{ + return @"SMS"; +} + ++ (BOOL)canShareText +{ + return YES; +} + ++ (BOOL)canShareURL +{ + return YES; +} + ++ (BOOL)canShareImage +{ + return NO; +} + ++ (BOOL)canShareFile +{ + return NO; +} + ++ (BOOL)shareRequiresInternetConnection +{ + return NO; +} + ++ (BOOL)requiresAuthentication +{ + return NO; +} + + +#pragma mark - +#pragma mark Configuration : Dynamic Enable + ++ (BOOL)canShare +{ + return [MFMessageComposeViewController canSendText]; +} + +- (BOOL)shouldAutoShare +{ + return YES; +} + + + +#pragma mark - +#pragma mark Share API Methods + +- (BOOL)send +{ + self.quiet = YES; + + if (![self validateItem]) + return NO; + + return [self sendText]; // Put the actual sending action in another method to make subclassing SHKTextMessage easier +} + +- (BOOL)sendText +{ + MFMessageComposeViewController *composeView = [[[MFMessageComposeViewController alloc] init] autorelease]; + composeView.messageComposeDelegate = self; + + NSString * body = [item customValueForKey:@"body"]; + + if (!body) { + if (item.text != nil) + body = item.text; + + if (item.URL != nil) + { + NSString *urlStr = [item.URL.absoluteString stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + + if (body != nil) + body = [body stringByAppendingFormat:@"

%@", urlStr]; + + else + body = urlStr; + } + + // fallback + if (body == nil) + body = @""; + + // save changes to body + [item setCustomValue:body forKey:@"body"]; + } + + [composeView setBody:body]; + [[SHK currentHelper] showViewController:composeView]; + + return YES; +} + +- (void)messageComposeViewController:(MFMessageComposeViewController *)controller + didFinishWithResult:(MessageComposeResult)result +{ + + [[SHK currentHelper] hideCurrentViewControllerAnimated:YES]; + + switch (result) + { + case MessageComposeResultCancelled: + [self sendDidCancel]; + break; + case MessageComposeResultSent: + [self sendDidFinish]; + break; + case MessageComposeResultFailed: + [self sendDidFailWithError:nil]; + break; + default: + break; + } +} + + +@end \ No newline at end of file diff --git a/Classes/ShareKit/Sharers/Services/Delicious/SHKDelicious.h b/Classes/ShareKit/Sharers/Services/Delicious/SHKDelicious.h new file mode 100644 index 00000000..9d71d47c --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Delicious/SHKDelicious.h @@ -0,0 +1,41 @@ +// +// SHKDelicious.h +// ShareKit +// +// Created by Nathan Weiner on 6/21/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import +#import "SHKOAuthSharer.h" + +@interface SHKDelicious : SHKOAuthSharer +{ + +} + +- (BOOL)handleResponse:(SHKRequest *)aRequest; + +- (void)sendTicket:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data; +- (void)sendTicket:(OAServiceTicket *)ticket didFailWithError:(NSError*)error; + +@end diff --git a/Classes/ShareKit/Sharers/Services/Delicious/SHKDelicious.m b/Classes/ShareKit/Sharers/Services/Delicious/SHKDelicious.m new file mode 100644 index 00000000..17096086 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Delicious/SHKDelicious.m @@ -0,0 +1,224 @@ +// +// SHKDelicious.m +// ShareKit +// +// Created by Nathan Weiner on 6/21/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKDelicious.h" +#import "OAuthConsumer.h" + + +// You can leave this be. The user will actually never see this url. ShareKit just looks for +// when delicious redirects to this url and intercepts it. It can be any url. +#define SHKDeliciousCallbackUrl @"http://getsharekit.com/oauthcallback" + + +// http://github.com/jdg/oauthconsumer/blob/master/OATokenManager.m + +@implementation SHKDelicious + + +- (id)init +{ + if (self = [super init]) + { + self.consumerKey = SHKDeliciousConsumerKey; + self.secretKey = SHKDeliciousSecretKey; + self.authorizeCallbackURL = [NSURL URLWithString:SHKDeliciousCallbackUrl];// HOW-TO: In your Twitter application settings, use the "Callback URL" field. If you do not have this field in the settings, set your application type to 'Browser'. + + + // -- // + + + // You do not need to edit these, they are the same for everyone + self.authorizeURL = [NSURL URLWithString:@"https://api.login.yahoo.com/oauth/v2/request_auth"]; + self.requestURL = [NSURL URLWithString:@"https://api.login.yahoo.com/oauth/v2/get_request_token"]; + self.accessURL = [NSURL URLWithString:@"https://api.login.yahoo.com/oauth/v2/get_token"]; + + self.signatureProvider = [[[OAPlaintextSignatureProvider alloc] init] autorelease]; + } + return self; +} + + +#pragma mark - +#pragma mark Configuration : Service Defination + ++ (NSString *)sharerTitle +{ + return @"Delicious"; +} + ++ (BOOL)canShareURL +{ + return YES; +} + + +#pragma mark - +#pragma mark Authentication + +- (void)tokenRequestModifyRequest:(OAMutableURLRequest *)oRequest +{ + [oRequest setOAuthParameterName:@"oauth_callback" withValue:authorizeCallbackURL.absoluteString]; +} + +- (void)tokenAccessModifyRequest:(OAMutableURLRequest *)oRequest +{ + if (pendingAction == SHKPendingRefreshToken) + { + if (accessToken.sessionHandle != nil) + [oRequest setOAuthParameterName:@"oauth_session_handle" withValue:accessToken.sessionHandle]; + } + + else + [oRequest setOAuthParameterName:@"oauth_verifier" withValue:[authorizeResponseQueryVars objectForKey:@"oauth_verifier"]]; +} + +- (BOOL)handleResponse:(SHKRequest *)aRequest +{ + NSString *response = [aRequest getResult]; + + if ([response isEqualToString:@"401 Forbidden"]) + { + [self sendDidFailShouldRelogin]; + return NO; + } + + return YES; +} + + +#pragma mark - +#pragma mark Share Form + +- (NSArray *)shareFormFieldsForType:(SHKShareType)type +{ + if (type == SHKShareTypeURL) + return [NSArray arrayWithObjects: + [SHKFormFieldSettings label:SHKLocalizedString(@"Title") key:@"title" type:SHKFormFieldTypeText start:item.title], + [SHKFormFieldSettings label:SHKLocalizedString(@"Tags") key:@"tags" type:SHKFormFieldTypeText start:item.tags], + [SHKFormFieldSettings label:SHKLocalizedString(@"Notes") key:@"text" type:SHKFormFieldTypeText start:item.text], + [SHKFormFieldSettings label:SHKLocalizedString(@"Shared") key:@"shared" type:SHKFormFieldTypeSwitch start:SHKFormFieldSwitchOff], + nil]; + + return nil; +} + + + +#pragma mark - +#pragma mark Share API Methods + +- (BOOL)send +{ + if ([self validateItem]) + { + OAMutableURLRequest *oRequest = [[OAMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://api.del.icio.us/v2/posts/add"] + consumer:consumer + token:accessToken + realm:nil + signatureProvider:nil]; + + [oRequest setHTTPMethod:@"GET"]; + + + OARequestParameter *urlParam = [OARequestParameter requestParameterWithName:@"url" + value:[item.URL.absoluteString stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; + + OARequestParameter *descParam = [OARequestParameter requestParameterWithName:@"description" + value:SHKStringOrBlank(item.title)]; + + OARequestParameter *tagsParam = [OARequestParameter requestParameterWithName:@"tags" + value:SHKStringOrBlank(item.tags)]; + + OARequestParameter *extendedParam = [OARequestParameter requestParameterWithName:@"extended" + value:SHKStringOrBlank(item.text)]; + + OARequestParameter *sharedParam = [OARequestParameter requestParameterWithName:@"shared" + value:[item customBoolForSwitchKey:@"shared"]?@"yes":@"no"]; + + + [oRequest setParameters:[NSArray arrayWithObjects:descParam, extendedParam, sharedParam, tagsParam, urlParam, nil]]; + + OAAsynchronousDataFetcher *fetcher = [OAAsynchronousDataFetcher asynchronousFetcherWithRequest:oRequest + delegate:self + didFinishSelector:@selector(sendTicket:didFinishWithData:) + didFailSelector:@selector(sendTicket:didFailWithError:)]; + + [fetcher start]; + [oRequest release]; + + // Notify delegate + [self sendDidStart]; + + return YES; + } + + return NO; +} + + +- (void)sendTicket:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data +{ + if (ticket.didSucceed && [ticket.body rangeOfString:@"\"done\""].location != NSNotFound) + { + // Do anything? + } + + else + { + if (SHKDebugShowLogs) // check so we don't have to alloc the string with the data if we aren't logging + SHKLog(@"SHKDelicious sendTicket Response Body: %@", [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]); + + // Look for oauth problems + // TODO - I'd prefer to use regex for this but that would require OS4 or adding a regex library + NSError *error; + NSString *body = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]; + + // Expired token + if ([body rangeOfString:@"token_expired"].location != NSNotFound) + { + [self refreshToken]; + return; + } + + else + error = [SHK error:SHKLocalizedString(@"There was a problem saving to Delicious.")]; + + [self sendTicket:ticket didFailWithError:error]; + } + + // Notify delegate + [self sendDidFinish]; +} + +- (void)sendTicket:(OAServiceTicket *)ticket didFailWithError:(NSError*)error +{ + [self sendDidFailWithError:error]; +} + + + +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/EDAMLimits.h b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/EDAMLimits.h new file mode 100644 index 00000000..82f21dd7 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/EDAMLimits.h @@ -0,0 +1,101 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ + +#import + +#import "TProtocol.h" +#import "TApplicationException.h" +#import "TProtocolUtil.h" +#import "TProcessor.h" + + +@interface EDAMLimitsConstants : NSObject { +} ++ (int32_t) EDAM_ATTRIBUTE_LEN_MIN; ++ (int32_t) EDAM_ATTRIBUTE_LEN_MAX; ++ (NSString *) EDAM_ATTRIBUTE_REGEX; ++ (int32_t) EDAM_ATTRIBUTE_LIST_MAX; ++ (int32_t) EDAM_GUID_LEN_MIN; ++ (int32_t) EDAM_GUID_LEN_MAX; ++ (NSString *) EDAM_GUID_REGEX; ++ (int32_t) EDAM_EMAIL_LEN_MIN; ++ (int32_t) EDAM_EMAIL_LEN_MAX; ++ (NSString *) EDAM_EMAIL_LOCAL_REGEX; ++ (NSString *) EDAM_EMAIL_DOMAIN_REGEX; ++ (NSString *) EDAM_EMAIL_REGEX; ++ (int32_t) EDAM_TIMEZONE_LEN_MIN; ++ (int32_t) EDAM_TIMEZONE_LEN_MAX; ++ (NSString *) EDAM_TIMEZONE_REGEX; ++ (int32_t) EDAM_MIME_LEN_MIN; ++ (int32_t) EDAM_MIME_LEN_MAX; ++ (NSString *) EDAM_MIME_REGEX; ++ (NSString *) EDAM_MIME_TYPE_GIF; ++ (NSString *) EDAM_MIME_TYPE_JPEG; ++ (NSString *) EDAM_MIME_TYPE_PNG; ++ (NSString *) EDAM_MIME_TYPE_WAV; ++ (NSString *) EDAM_MIME_TYPE_MP3; ++ (NSString *) EDAM_MIME_TYPE_AMR; ++ (NSString *) EDAM_MIME_TYPE_INK; ++ (NSString *) EDAM_MIME_TYPE_PDF; ++ (NSString *) EDAM_MIME_TYPE_DEFAULT; ++ (NSSet *) EDAM_MIME_TYPES; ++ (NSString *) EDAM_COMMERCE_SERVICE_GOOGLE; ++ (NSString *) EDAM_COMMERCE_SERVICE_PAYPAL; ++ (NSString *) EDAM_COMMERCE_SERVICE_GIFT; ++ (NSString *) EDAM_COMMERCE_SERVICE_TRIALPAY; ++ (int32_t) EDAM_SEARCH_QUERY_LEN_MIN; ++ (int32_t) EDAM_SEARCH_QUERY_LEN_MAX; ++ (NSString *) EDAM_SEARCH_QUERY_REGEX; ++ (int32_t) EDAM_HASH_LEN; ++ (int32_t) EDAM_USER_USERNAME_LEN_MIN; ++ (int32_t) EDAM_USER_USERNAME_LEN_MAX; ++ (NSString *) EDAM_USER_USERNAME_REGEX; ++ (int32_t) EDAM_USER_NAME_LEN_MIN; ++ (int32_t) EDAM_USER_NAME_LEN_MAX; ++ (NSString *) EDAM_USER_NAME_REGEX; ++ (int32_t) EDAM_TAG_NAME_LEN_MIN; ++ (int32_t) EDAM_TAG_NAME_LEN_MAX; ++ (NSString *) EDAM_TAG_NAME_REGEX; ++ (int32_t) EDAM_NOTE_TITLE_LEN_MIN; ++ (int32_t) EDAM_NOTE_TITLE_LEN_MAX; ++ (NSString *) EDAM_NOTE_TITLE_REGEX; ++ (int32_t) EDAM_NOTE_CONTENT_LEN_MIN; ++ (int32_t) EDAM_NOTE_CONTENT_LEN_MAX; ++ (int32_t) EDAM_NOTEBOOK_NAME_LEN_MIN; ++ (int32_t) EDAM_NOTEBOOK_NAME_LEN_MAX; ++ (NSString *) EDAM_NOTEBOOK_NAME_REGEX; ++ (int32_t) EDAM_NOTEBOOK_STACK_LEN_MIN; ++ (int32_t) EDAM_NOTEBOOK_STACK_LEN_MAX; ++ (NSString *) EDAM_NOTEBOOK_STACK_REGEX; ++ (int32_t) EDAM_PUBLISHING_URI_LEN_MIN; ++ (int32_t) EDAM_PUBLISHING_URI_LEN_MAX; ++ (NSString *) EDAM_PUBLISHING_URI_REGEX; ++ (NSSet *) EDAM_PUBLISHING_URI_PROHIBITED; ++ (int32_t) EDAM_PUBLISHING_DESCRIPTION_LEN_MIN; ++ (int32_t) EDAM_PUBLISHING_DESCRIPTION_LEN_MAX; ++ (NSString *) EDAM_PUBLISHING_DESCRIPTION_REGEX; ++ (int32_t) EDAM_SAVED_SEARCH_NAME_LEN_MIN; ++ (int32_t) EDAM_SAVED_SEARCH_NAME_LEN_MAX; ++ (NSString *) EDAM_SAVED_SEARCH_NAME_REGEX; ++ (int32_t) EDAM_USER_PASSWORD_LEN_MIN; ++ (int32_t) EDAM_USER_PASSWORD_LEN_MAX; ++ (NSString *) EDAM_USER_PASSWORD_REGEX; ++ (int32_t) EDAM_NOTE_TAGS_MAX; ++ (int32_t) EDAM_NOTE_RESOURCES_MAX; ++ (int32_t) EDAM_USER_TAGS_MAX; ++ (int32_t) EDAM_USER_SAVED_SEARCHES_MAX; ++ (int32_t) EDAM_USER_NOTES_MAX; ++ (int32_t) EDAM_USER_NOTEBOOKS_MAX; ++ (int32_t) EDAM_USER_RECENT_MAILED_ADDRESSES_MAX; ++ (int32_t) EDAM_USER_MAIL_LIMIT_DAILY_FREE; ++ (int32_t) EDAM_USER_MAIL_LIMIT_DAILY_PREMIUM; ++ (int32_t) EDAM_NOTE_SIZE_MAX_FREE; ++ (int32_t) EDAM_NOTE_SIZE_MAX_PREMIUM; ++ (int32_t) EDAM_RESOURCE_SIZE_MAX_FREE; ++ (int32_t) EDAM_RESOURCE_SIZE_MAX_PREMIUM; ++ (int32_t) EDAM_USER_LINKED_NOTEBOOK_MAX; ++ (int32_t) EDAM_NOTEBOOK_SHARED_NOTEBOOK_MAX; +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/EDAMLimits.m b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/EDAMLimits.m new file mode 100644 index 00000000..1a68f28d --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/EDAMLimits.m @@ -0,0 +1,360 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ + +#import + +#import "TProtocol.h" +#import "TApplicationException.h" +#import "TProtocolUtil.h" +#import "TProcessor.h" + + +#import "EDAMLimits.h" + +static int32_t EDAMEDAM_ATTRIBUTE_LEN_MIN = 1; +static int32_t EDAMEDAM_ATTRIBUTE_LEN_MAX = 4096; +static NSString * EDAMEDAM_ATTRIBUTE_REGEX = @"^[^\\p{Cc}\\p{Zl}\\p{Zp}]{1,4096}$"; +static int32_t EDAMEDAM_ATTRIBUTE_LIST_MAX = 100; +static int32_t EDAMEDAM_GUID_LEN_MIN = 36; +static int32_t EDAMEDAM_GUID_LEN_MAX = 36; +static NSString * EDAMEDAM_GUID_REGEX = @"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"; +static int32_t EDAMEDAM_EMAIL_LEN_MIN = 6; +static int32_t EDAMEDAM_EMAIL_LEN_MAX = 255; +static NSString * EDAMEDAM_EMAIL_LOCAL_REGEX = @"^[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(\\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*$"; +static NSString * EDAMEDAM_EMAIL_DOMAIN_REGEX = @"^[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*\\.([A-Za-z]{2,})$"; +static NSString * EDAMEDAM_EMAIL_REGEX = @"^[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(\\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9-]+)*\\.([A-Za-z]{2,})$"; +static int32_t EDAMEDAM_TIMEZONE_LEN_MIN = 1; +static int32_t EDAMEDAM_TIMEZONE_LEN_MAX = 32; +static NSString * EDAMEDAM_TIMEZONE_REGEX = @"^([A-Za-z_-]+(/[A-Za-z_-]+)*)|(GMT(-|\\+)[0-9]{1,2}(:[0-9]{2})?)$"; +static int32_t EDAMEDAM_MIME_LEN_MIN = 3; +static int32_t EDAMEDAM_MIME_LEN_MAX = 255; +static NSString * EDAMEDAM_MIME_REGEX = @"^[A-Za-z]+/[A-Za-z0-9._+-]+$"; +static NSString * EDAMEDAM_MIME_TYPE_GIF = @"image/gif"; +static NSString * EDAMEDAM_MIME_TYPE_JPEG = @"image/jpeg"; +static NSString * EDAMEDAM_MIME_TYPE_PNG = @"image/png"; +static NSString * EDAMEDAM_MIME_TYPE_WAV = @"audio/wav"; +static NSString * EDAMEDAM_MIME_TYPE_MP3 = @"audio/mpeg"; +static NSString * EDAMEDAM_MIME_TYPE_AMR = @"audio/amr"; +static NSString * EDAMEDAM_MIME_TYPE_INK = @"application/vnd.evernote.ink"; +static NSString * EDAMEDAM_MIME_TYPE_PDF = @"application/pdf"; +static NSString * EDAMEDAM_MIME_TYPE_DEFAULT = @"application/octet-stream"; +static NSSet * EDAMEDAM_MIME_TYPES; +static NSString * EDAMEDAM_COMMERCE_SERVICE_GOOGLE = @"Google"; +static NSString * EDAMEDAM_COMMERCE_SERVICE_PAYPAL = @"Paypal"; +static NSString * EDAMEDAM_COMMERCE_SERVICE_GIFT = @"Gift"; +static NSString * EDAMEDAM_COMMERCE_SERVICE_TRIALPAY = @"TrialPay"; +static int32_t EDAMEDAM_SEARCH_QUERY_LEN_MIN = 0; +static int32_t EDAMEDAM_SEARCH_QUERY_LEN_MAX = 1024; +static NSString * EDAMEDAM_SEARCH_QUERY_REGEX = @"^[^\\p{Cc}\\p{Zl}\\p{Zp}]{0,1024}$"; +static int32_t EDAMEDAM_HASH_LEN = 16; +static int32_t EDAMEDAM_USER_USERNAME_LEN_MIN = 1; +static int32_t EDAMEDAM_USER_USERNAME_LEN_MAX = 64; +static NSString * EDAMEDAM_USER_USERNAME_REGEX = @"^[a-z0-9]([a-z0-9_-]{0,62}[a-z0-9])?$"; +static int32_t EDAMEDAM_USER_NAME_LEN_MIN = 1; +static int32_t EDAMEDAM_USER_NAME_LEN_MAX = 255; +static NSString * EDAMEDAM_USER_NAME_REGEX = @"^[^\\p{Cc}\\p{Zl}\\p{Zp}]{1,255}$"; +static int32_t EDAMEDAM_TAG_NAME_LEN_MIN = 1; +static int32_t EDAMEDAM_TAG_NAME_LEN_MAX = 100; +static NSString * EDAMEDAM_TAG_NAME_REGEX = @"^[^,\\p{Cc}\\p{Z}]([^,\\p{Cc}\\p{Zl}\\p{Zp}]{0,98}[^,\\p{Cc}\\p{Z}])?$"; +static int32_t EDAMEDAM_NOTE_TITLE_LEN_MIN = 1; +static int32_t EDAMEDAM_NOTE_TITLE_LEN_MAX = 255; +static NSString * EDAMEDAM_NOTE_TITLE_REGEX = @"^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,253}[^\\p{Cc}\\p{Z}])?$"; +static int32_t EDAMEDAM_NOTE_CONTENT_LEN_MIN = 0; +static int32_t EDAMEDAM_NOTE_CONTENT_LEN_MAX = 5242880; +static int32_t EDAMEDAM_NOTEBOOK_NAME_LEN_MIN = 1; +static int32_t EDAMEDAM_NOTEBOOK_NAME_LEN_MAX = 100; +static NSString * EDAMEDAM_NOTEBOOK_NAME_REGEX = @"^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,98}[^\\p{Cc}\\p{Z}])?$"; +static int32_t EDAMEDAM_NOTEBOOK_STACK_LEN_MIN = 1; +static int32_t EDAMEDAM_NOTEBOOK_STACK_LEN_MAX = 100; +static NSString * EDAMEDAM_NOTEBOOK_STACK_REGEX = @"^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,98}[^\\p{Cc}\\p{Z}])?$"; +static int32_t EDAMEDAM_PUBLISHING_URI_LEN_MIN = 1; +static int32_t EDAMEDAM_PUBLISHING_URI_LEN_MAX = 255; +static NSString * EDAMEDAM_PUBLISHING_URI_REGEX = @"^[a-zA-Z0-9.~_+-]{1,255}$"; +static NSSet * EDAMEDAM_PUBLISHING_URI_PROHIBITED; +static int32_t EDAMEDAM_PUBLISHING_DESCRIPTION_LEN_MIN = 1; +static int32_t EDAMEDAM_PUBLISHING_DESCRIPTION_LEN_MAX = 200; +static NSString * EDAMEDAM_PUBLISHING_DESCRIPTION_REGEX = @"^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,198}[^\\p{Cc}\\p{Z}])?$"; +static int32_t EDAMEDAM_SAVED_SEARCH_NAME_LEN_MIN = 1; +static int32_t EDAMEDAM_SAVED_SEARCH_NAME_LEN_MAX = 100; +static NSString * EDAMEDAM_SAVED_SEARCH_NAME_REGEX = @"^[^\\p{Cc}\\p{Z}]([^\\p{Cc}\\p{Zl}\\p{Zp}]{0,98}[^\\p{Cc}\\p{Z}])?$"; +static int32_t EDAMEDAM_USER_PASSWORD_LEN_MIN = 6; +static int32_t EDAMEDAM_USER_PASSWORD_LEN_MAX = 64; +static NSString * EDAMEDAM_USER_PASSWORD_REGEX = @"^[A-Za-z0-9!#$%&'()*+,./:;<=>?@^_`{|}~\\[\\]\\\\-]{6,64}$"; +static int32_t EDAMEDAM_NOTE_TAGS_MAX = 100; +static int32_t EDAMEDAM_NOTE_RESOURCES_MAX = 1000; +static int32_t EDAMEDAM_USER_TAGS_MAX = 100000; +static int32_t EDAMEDAM_USER_SAVED_SEARCHES_MAX = 100; +static int32_t EDAMEDAM_USER_NOTES_MAX = 100000; +static int32_t EDAMEDAM_USER_NOTEBOOKS_MAX = 100; +static int32_t EDAMEDAM_USER_RECENT_MAILED_ADDRESSES_MAX = 10; +static int32_t EDAMEDAM_USER_MAIL_LIMIT_DAILY_FREE = 50; +static int32_t EDAMEDAM_USER_MAIL_LIMIT_DAILY_PREMIUM = 200; +static int32_t EDAMEDAM_NOTE_SIZE_MAX_FREE = 26214400; +static int32_t EDAMEDAM_NOTE_SIZE_MAX_PREMIUM = 52428800; +static int32_t EDAMEDAM_RESOURCE_SIZE_MAX_FREE = 26214400; +static int32_t EDAMEDAM_RESOURCE_SIZE_MAX_PREMIUM = 52428800; +static int32_t EDAMEDAM_USER_LINKED_NOTEBOOK_MAX = 100; +static int32_t EDAMEDAM_NOTEBOOK_SHARED_NOTEBOOK_MAX = 100; + +@implementation EDAMLimitsConstants ++ (void) initialize { + EDAMEDAM_MIME_TYPES = [[NSSet alloc] initWithObjects: @"image/gif", @"image/jpeg", @"image/png", @"audio/wav", @"audio/mpeg", @"audio/amr", @"application/vnd.evernote.ink", @"application/pdf", nil]; + EDAMEDAM_PUBLISHING_URI_PROHIBITED = [[NSSet alloc] initWithObjects: @"..", nil]; +} ++ (int32_t) EDAM_ATTRIBUTE_LEN_MIN{ + return EDAMEDAM_ATTRIBUTE_LEN_MIN; +} ++ (int32_t) EDAM_ATTRIBUTE_LEN_MAX{ + return EDAMEDAM_ATTRIBUTE_LEN_MAX; +} ++ (NSString *) EDAM_ATTRIBUTE_REGEX{ + return EDAMEDAM_ATTRIBUTE_REGEX; +} ++ (int32_t) EDAM_ATTRIBUTE_LIST_MAX{ + return EDAMEDAM_ATTRIBUTE_LIST_MAX; +} ++ (int32_t) EDAM_GUID_LEN_MIN{ + return EDAMEDAM_GUID_LEN_MIN; +} ++ (int32_t) EDAM_GUID_LEN_MAX{ + return EDAMEDAM_GUID_LEN_MAX; +} ++ (NSString *) EDAM_GUID_REGEX{ + return EDAMEDAM_GUID_REGEX; +} ++ (int32_t) EDAM_EMAIL_LEN_MIN{ + return EDAMEDAM_EMAIL_LEN_MIN; +} ++ (int32_t) EDAM_EMAIL_LEN_MAX{ + return EDAMEDAM_EMAIL_LEN_MAX; +} ++ (NSString *) EDAM_EMAIL_LOCAL_REGEX{ + return EDAMEDAM_EMAIL_LOCAL_REGEX; +} ++ (NSString *) EDAM_EMAIL_DOMAIN_REGEX{ + return EDAMEDAM_EMAIL_DOMAIN_REGEX; +} ++ (NSString *) EDAM_EMAIL_REGEX{ + return EDAMEDAM_EMAIL_REGEX; +} ++ (int32_t) EDAM_TIMEZONE_LEN_MIN{ + return EDAMEDAM_TIMEZONE_LEN_MIN; +} ++ (int32_t) EDAM_TIMEZONE_LEN_MAX{ + return EDAMEDAM_TIMEZONE_LEN_MAX; +} ++ (NSString *) EDAM_TIMEZONE_REGEX{ + return EDAMEDAM_TIMEZONE_REGEX; +} ++ (int32_t) EDAM_MIME_LEN_MIN{ + return EDAMEDAM_MIME_LEN_MIN; +} ++ (int32_t) EDAM_MIME_LEN_MAX{ + return EDAMEDAM_MIME_LEN_MAX; +} ++ (NSString *) EDAM_MIME_REGEX{ + return EDAMEDAM_MIME_REGEX; +} ++ (NSString *) EDAM_MIME_TYPE_GIF{ + return EDAMEDAM_MIME_TYPE_GIF; +} ++ (NSString *) EDAM_MIME_TYPE_JPEG{ + return EDAMEDAM_MIME_TYPE_JPEG; +} ++ (NSString *) EDAM_MIME_TYPE_PNG{ + return EDAMEDAM_MIME_TYPE_PNG; +} ++ (NSString *) EDAM_MIME_TYPE_WAV{ + return EDAMEDAM_MIME_TYPE_WAV; +} ++ (NSString *) EDAM_MIME_TYPE_MP3{ + return EDAMEDAM_MIME_TYPE_MP3; +} ++ (NSString *) EDAM_MIME_TYPE_AMR{ + return EDAMEDAM_MIME_TYPE_AMR; +} ++ (NSString *) EDAM_MIME_TYPE_INK{ + return EDAMEDAM_MIME_TYPE_INK; +} ++ (NSString *) EDAM_MIME_TYPE_PDF{ + return EDAMEDAM_MIME_TYPE_PDF; +} ++ (NSString *) EDAM_MIME_TYPE_DEFAULT{ + return EDAMEDAM_MIME_TYPE_DEFAULT; +} ++ (NSSet *) EDAM_MIME_TYPES{ + return EDAMEDAM_MIME_TYPES; +} ++ (NSString *) EDAM_COMMERCE_SERVICE_GOOGLE{ + return EDAMEDAM_COMMERCE_SERVICE_GOOGLE; +} ++ (NSString *) EDAM_COMMERCE_SERVICE_PAYPAL{ + return EDAMEDAM_COMMERCE_SERVICE_PAYPAL; +} ++ (NSString *) EDAM_COMMERCE_SERVICE_GIFT{ + return EDAMEDAM_COMMERCE_SERVICE_GIFT; +} ++ (NSString *) EDAM_COMMERCE_SERVICE_TRIALPAY{ + return EDAMEDAM_COMMERCE_SERVICE_TRIALPAY; +} ++ (int32_t) EDAM_SEARCH_QUERY_LEN_MIN{ + return EDAMEDAM_SEARCH_QUERY_LEN_MIN; +} ++ (int32_t) EDAM_SEARCH_QUERY_LEN_MAX{ + return EDAMEDAM_SEARCH_QUERY_LEN_MAX; +} ++ (NSString *) EDAM_SEARCH_QUERY_REGEX{ + return EDAMEDAM_SEARCH_QUERY_REGEX; +} ++ (int32_t) EDAM_HASH_LEN{ + return EDAMEDAM_HASH_LEN; +} ++ (int32_t) EDAM_USER_USERNAME_LEN_MIN{ + return EDAMEDAM_USER_USERNAME_LEN_MIN; +} ++ (int32_t) EDAM_USER_USERNAME_LEN_MAX{ + return EDAMEDAM_USER_USERNAME_LEN_MAX; +} ++ (NSString *) EDAM_USER_USERNAME_REGEX{ + return EDAMEDAM_USER_USERNAME_REGEX; +} ++ (int32_t) EDAM_USER_NAME_LEN_MIN{ + return EDAMEDAM_USER_NAME_LEN_MIN; +} ++ (int32_t) EDAM_USER_NAME_LEN_MAX{ + return EDAMEDAM_USER_NAME_LEN_MAX; +} ++ (NSString *) EDAM_USER_NAME_REGEX{ + return EDAMEDAM_USER_NAME_REGEX; +} ++ (int32_t) EDAM_TAG_NAME_LEN_MIN{ + return EDAMEDAM_TAG_NAME_LEN_MIN; +} ++ (int32_t) EDAM_TAG_NAME_LEN_MAX{ + return EDAMEDAM_TAG_NAME_LEN_MAX; +} ++ (NSString *) EDAM_TAG_NAME_REGEX{ + return EDAMEDAM_TAG_NAME_REGEX; +} ++ (int32_t) EDAM_NOTE_TITLE_LEN_MIN{ + return EDAMEDAM_NOTE_TITLE_LEN_MIN; +} ++ (int32_t) EDAM_NOTE_TITLE_LEN_MAX{ + return EDAMEDAM_NOTE_TITLE_LEN_MAX; +} ++ (NSString *) EDAM_NOTE_TITLE_REGEX{ + return EDAMEDAM_NOTE_TITLE_REGEX; +} ++ (int32_t) EDAM_NOTE_CONTENT_LEN_MIN{ + return EDAMEDAM_NOTE_CONTENT_LEN_MIN; +} ++ (int32_t) EDAM_NOTE_CONTENT_LEN_MAX{ + return EDAMEDAM_NOTE_CONTENT_LEN_MAX; +} ++ (int32_t) EDAM_NOTEBOOK_NAME_LEN_MIN{ + return EDAMEDAM_NOTEBOOK_NAME_LEN_MIN; +} ++ (int32_t) EDAM_NOTEBOOK_NAME_LEN_MAX{ + return EDAMEDAM_NOTEBOOK_NAME_LEN_MAX; +} ++ (NSString *) EDAM_NOTEBOOK_NAME_REGEX{ + return EDAMEDAM_NOTEBOOK_NAME_REGEX; +} ++ (int32_t) EDAM_NOTEBOOK_STACK_LEN_MIN{ + return EDAMEDAM_NOTEBOOK_STACK_LEN_MIN; +} ++ (int32_t) EDAM_NOTEBOOK_STACK_LEN_MAX{ + return EDAMEDAM_NOTEBOOK_STACK_LEN_MAX; +} ++ (NSString *) EDAM_NOTEBOOK_STACK_REGEX{ + return EDAMEDAM_NOTEBOOK_STACK_REGEX; +} ++ (int32_t) EDAM_PUBLISHING_URI_LEN_MIN{ + return EDAMEDAM_PUBLISHING_URI_LEN_MIN; +} ++ (int32_t) EDAM_PUBLISHING_URI_LEN_MAX{ + return EDAMEDAM_PUBLISHING_URI_LEN_MAX; +} ++ (NSString *) EDAM_PUBLISHING_URI_REGEX{ + return EDAMEDAM_PUBLISHING_URI_REGEX; +} ++ (NSSet *) EDAM_PUBLISHING_URI_PROHIBITED{ + return EDAMEDAM_PUBLISHING_URI_PROHIBITED; +} ++ (int32_t) EDAM_PUBLISHING_DESCRIPTION_LEN_MIN{ + return EDAMEDAM_PUBLISHING_DESCRIPTION_LEN_MIN; +} ++ (int32_t) EDAM_PUBLISHING_DESCRIPTION_LEN_MAX{ + return EDAMEDAM_PUBLISHING_DESCRIPTION_LEN_MAX; +} ++ (NSString *) EDAM_PUBLISHING_DESCRIPTION_REGEX{ + return EDAMEDAM_PUBLISHING_DESCRIPTION_REGEX; +} ++ (int32_t) EDAM_SAVED_SEARCH_NAME_LEN_MIN{ + return EDAMEDAM_SAVED_SEARCH_NAME_LEN_MIN; +} ++ (int32_t) EDAM_SAVED_SEARCH_NAME_LEN_MAX{ + return EDAMEDAM_SAVED_SEARCH_NAME_LEN_MAX; +} ++ (NSString *) EDAM_SAVED_SEARCH_NAME_REGEX{ + return EDAMEDAM_SAVED_SEARCH_NAME_REGEX; +} ++ (int32_t) EDAM_USER_PASSWORD_LEN_MIN{ + return EDAMEDAM_USER_PASSWORD_LEN_MIN; +} ++ (int32_t) EDAM_USER_PASSWORD_LEN_MAX{ + return EDAMEDAM_USER_PASSWORD_LEN_MAX; +} ++ (NSString *) EDAM_USER_PASSWORD_REGEX{ + return EDAMEDAM_USER_PASSWORD_REGEX; +} ++ (int32_t) EDAM_NOTE_TAGS_MAX{ + return EDAMEDAM_NOTE_TAGS_MAX; +} ++ (int32_t) EDAM_NOTE_RESOURCES_MAX{ + return EDAMEDAM_NOTE_RESOURCES_MAX; +} ++ (int32_t) EDAM_USER_TAGS_MAX{ + return EDAMEDAM_USER_TAGS_MAX; +} ++ (int32_t) EDAM_USER_SAVED_SEARCHES_MAX{ + return EDAMEDAM_USER_SAVED_SEARCHES_MAX; +} ++ (int32_t) EDAM_USER_NOTES_MAX{ + return EDAMEDAM_USER_NOTES_MAX; +} ++ (int32_t) EDAM_USER_NOTEBOOKS_MAX{ + return EDAMEDAM_USER_NOTEBOOKS_MAX; +} ++ (int32_t) EDAM_USER_RECENT_MAILED_ADDRESSES_MAX{ + return EDAMEDAM_USER_RECENT_MAILED_ADDRESSES_MAX; +} ++ (int32_t) EDAM_USER_MAIL_LIMIT_DAILY_FREE{ + return EDAMEDAM_USER_MAIL_LIMIT_DAILY_FREE; +} ++ (int32_t) EDAM_USER_MAIL_LIMIT_DAILY_PREMIUM{ + return EDAMEDAM_USER_MAIL_LIMIT_DAILY_PREMIUM; +} ++ (int32_t) EDAM_NOTE_SIZE_MAX_FREE{ + return EDAMEDAM_NOTE_SIZE_MAX_FREE; +} ++ (int32_t) EDAM_NOTE_SIZE_MAX_PREMIUM{ + return EDAMEDAM_NOTE_SIZE_MAX_PREMIUM; +} ++ (int32_t) EDAM_RESOURCE_SIZE_MAX_FREE{ + return EDAMEDAM_RESOURCE_SIZE_MAX_FREE; +} ++ (int32_t) EDAM_RESOURCE_SIZE_MAX_PREMIUM{ + return EDAMEDAM_RESOURCE_SIZE_MAX_PREMIUM; +} ++ (int32_t) EDAM_USER_LINKED_NOTEBOOK_MAX{ + return EDAMEDAM_USER_LINKED_NOTEBOOK_MAX; +} ++ (int32_t) EDAM_NOTEBOOK_SHARED_NOTEBOOK_MAX{ + return EDAMEDAM_NOTEBOOK_SHARED_NOTEBOOK_MAX; +} +@end + diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/Errors.h b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/Errors.h new file mode 100644 index 00000000..12a1d41f --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/Errors.h @@ -0,0 +1,116 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ + +#import + +#import "TProtocol.h" +#import "TApplicationException.h" +#import "TProtocolUtil.h" +#import "TProcessor.h" + + +enum EDAMErrorCode { + EDAMErrorCode_UNKNOWN = 1, + EDAMErrorCode_BAD_DATA_FORMAT = 2, + EDAMErrorCode_PERMISSION_DENIED = 3, + EDAMErrorCode_INTERNAL_ERROR = 4, + EDAMErrorCode_DATA_REQUIRED = 5, + EDAMErrorCode_LIMIT_REACHED = 6, + EDAMErrorCode_QUOTA_REACHED = 7, + EDAMErrorCode_INVALID_AUTH = 8, + EDAMErrorCode_AUTH_EXPIRED = 9, + EDAMErrorCode_DATA_CONFLICT = 10, + EDAMErrorCode_ENML_VALIDATION = 11, + EDAMErrorCode_SHARD_UNAVAILABLE = 12 +}; + +@interface EDAMUserException : NSException { + int __errorCode; + NSString * __parameter; + + BOOL __errorCode_isset; + BOOL __parameter_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=errorCode, setter=setErrorCode:) int errorCode; +@property (nonatomic, retain, getter=parameter, setter=setParameter:) NSString * parameter; +#endif + +- (id) initWithErrorCode: (int) errorCode parameter: (NSString *) parameter; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int) errorCode; +- (void) setErrorCode: (int) errorCode; +- (BOOL) errorCodeIsSet; + +- (NSString *) parameter; +- (void) setParameter: (NSString *) parameter; +- (BOOL) parameterIsSet; + +@end + +@interface EDAMSystemException : NSException { + int __errorCode; + NSString * __message; + + BOOL __errorCode_isset; + BOOL __message_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=errorCode, setter=setErrorCode:) int errorCode; +@property (nonatomic, retain, getter=message, setter=setMessage:) NSString * message; +#endif + +- (id) initWithErrorCode: (int) errorCode message: (NSString *) message; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int) errorCode; +- (void) setErrorCode: (int) errorCode; +- (BOOL) errorCodeIsSet; + +- (NSString *) message; +- (void) setMessage: (NSString *) message; +- (BOOL) messageIsSet; + +@end + +@interface EDAMNotFoundException : NSException { + NSString * __identifier; + NSString * __key; + + BOOL __identifier_isset; + BOOL __key_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=identifier, setter=setIdentifier:) NSString * identifier; +@property (nonatomic, retain, getter=key, setter=setKey:) NSString * key; +#endif + +- (id) initWithIdentifier: (NSString *) identifier key: (NSString *) key; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) identifier; +- (void) setIdentifier: (NSString *) identifier; +- (BOOL) identifierIsSet; + +- (NSString *) key; +- (void) setKey: (NSString *) key; +- (BOOL) keyIsSet; + +@end + +@interface ErrorsConstants : NSObject { +} +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/Errors.m b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/Errors.m new file mode 100644 index 00000000..9c3a40f6 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/Errors.m @@ -0,0 +1,521 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ + +#import + +#import "TProtocol.h" +#import "TApplicationException.h" +#import "TProtocolUtil.h" +#import "TProcessor.h" + + +#import "Errors.h" + + +@implementation ErrorsConstants ++ (void) initialize { +} +@end + +@implementation EDAMUserException + +- (id) init +{ + return [super initWithName: @"EDAMUserException" reason: @"unknown" userInfo: nil]; +} +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic errorCode; +@dynamic parameter; +#endif + +- (id) initWithErrorCode: (int) errorCode parameter: (NSString *) parameter +{ + self = [self init]; + __errorCode = errorCode; + __errorCode_isset = YES; + __parameter = [parameter retain]; + __parameter_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super initWithCoder: decoder]; + if ([decoder containsValueForKey: @"errorCode"]) + { + __errorCode = [decoder decodeIntForKey: @"errorCode"]; + __errorCode_isset = YES; + } + if ([decoder containsValueForKey: @"parameter"]) + { + __parameter = [[decoder decodeObjectForKey: @"parameter"] retain]; + __parameter_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + [super encodeWithCoder: encoder]; + if (__errorCode_isset) + { + [encoder encodeInt: __errorCode forKey: @"errorCode"]; + } + if (__parameter_isset) + { + [encoder encodeObject: __parameter forKey: @"parameter"]; + } +} + +- (void) dealloc +{ + [__parameter release]; + [super dealloc]; +} + +- (int) errorCode { + return __errorCode; +} + +- (void) setErrorCode: (int) errorCode { + __errorCode = errorCode; + __errorCode_isset = YES; +} + +- (BOOL) errorCodeIsSet { + return __errorCode_isset; +} + +- (void) unsetErrorCode { + __errorCode_isset = NO; +} + +- (NSString *) parameter { + return [[__parameter retain] autorelease]; +} + +- (void) setParameter: (NSString *) parameter { + [parameter retain]; + [__parameter release]; + __parameter = parameter; + __parameter_isset = YES; +} + +- (BOOL) parameterIsSet { + return __parameter_isset; +} + +- (void) unsetParameter { + [__parameter release]; + __parameter = nil; + __parameter_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_I32) { + int fieldValue = [inProtocol readI32]; + [self setErrorCode: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setParameter: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"EDAMUserException"]; + if (__errorCode_isset) { + [outProtocol writeFieldBeginWithName: @"errorCode" type: TType_I32 fieldID: 1]; + [outProtocol writeI32: __errorCode]; + [outProtocol writeFieldEnd]; + } + if (__parameter_isset) { + if (__parameter != nil) { + [outProtocol writeFieldBeginWithName: @"parameter" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __parameter]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"EDAMUserException("]; + [ms appendString: @"errorCode:"]; + [ms appendFormat: @"%i", __errorCode]; + [ms appendString: @",parameter:"]; + [ms appendFormat: @"\"%@\"", __parameter]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMSystemException + +- (id) init +{ + return [super initWithName: @"EDAMSystemException" reason: @"unknown" userInfo: nil]; +} +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic errorCode; +@dynamic message; +#endif + +- (id) initWithErrorCode: (int) errorCode message: (NSString *) message +{ + self = [self init]; + __errorCode = errorCode; + __errorCode_isset = YES; + __message = [message retain]; + __message_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super initWithCoder: decoder]; + if ([decoder containsValueForKey: @"errorCode"]) + { + __errorCode = [decoder decodeIntForKey: @"errorCode"]; + __errorCode_isset = YES; + } + if ([decoder containsValueForKey: @"message"]) + { + __message = [[decoder decodeObjectForKey: @"message"] retain]; + __message_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + [super encodeWithCoder: encoder]; + if (__errorCode_isset) + { + [encoder encodeInt: __errorCode forKey: @"errorCode"]; + } + if (__message_isset) + { + [encoder encodeObject: __message forKey: @"message"]; + } +} + +- (void) dealloc +{ + [__message release]; + [super dealloc]; +} + +- (int) errorCode { + return __errorCode; +} + +- (void) setErrorCode: (int) errorCode { + __errorCode = errorCode; + __errorCode_isset = YES; +} + +- (BOOL) errorCodeIsSet { + return __errorCode_isset; +} + +- (void) unsetErrorCode { + __errorCode_isset = NO; +} + +- (NSString *) message { + return [[__message retain] autorelease]; +} + +- (void) setMessage: (NSString *) message { + [message retain]; + [__message release]; + __message = message; + __message_isset = YES; +} + +- (BOOL) messageIsSet { + return __message_isset; +} + +- (void) unsetMessage { + [__message release]; + __message = nil; + __message_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_I32) { + int fieldValue = [inProtocol readI32]; + [self setErrorCode: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setMessage: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"EDAMSystemException"]; + if (__errorCode_isset) { + [outProtocol writeFieldBeginWithName: @"errorCode" type: TType_I32 fieldID: 1]; + [outProtocol writeI32: __errorCode]; + [outProtocol writeFieldEnd]; + } + if (__message_isset) { + if (__message != nil) { + [outProtocol writeFieldBeginWithName: @"message" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __message]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"EDAMSystemException("]; + [ms appendString: @"errorCode:"]; + [ms appendFormat: @"%i", __errorCode]; + [ms appendString: @",message:"]; + [ms appendFormat: @"\"%@\"", __message]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMNotFoundException + +- (id) init +{ + return [super initWithName: @"EDAMNotFoundException" reason: @"unknown" userInfo: nil]; +} +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic identifier; +@dynamic key; +#endif + +- (id) initWithIdentifier: (NSString *) identifier key: (NSString *) key +{ + self = [self init]; + __identifier = [identifier retain]; + __identifier_isset = YES; + __key = [key retain]; + __key_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super initWithCoder: decoder]; + if ([decoder containsValueForKey: @"identifier"]) + { + __identifier = [[decoder decodeObjectForKey: @"identifier"] retain]; + __identifier_isset = YES; + } + if ([decoder containsValueForKey: @"key"]) + { + __key = [[decoder decodeObjectForKey: @"key"] retain]; + __key_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + [super encodeWithCoder: encoder]; + if (__identifier_isset) + { + [encoder encodeObject: __identifier forKey: @"identifier"]; + } + if (__key_isset) + { + [encoder encodeObject: __key forKey: @"key"]; + } +} + +- (void) dealloc +{ + [__identifier release]; + [__key release]; + [super dealloc]; +} + +- (NSString *) identifier { + return [[__identifier retain] autorelease]; +} + +- (void) setIdentifier: (NSString *) identifier { + [identifier retain]; + [__identifier release]; + __identifier = identifier; + __identifier_isset = YES; +} + +- (BOOL) identifierIsSet { + return __identifier_isset; +} + +- (void) unsetIdentifier { + [__identifier release]; + __identifier = nil; + __identifier_isset = NO; +} + +- (NSString *) key { + return [[__key retain] autorelease]; +} + +- (void) setKey: (NSString *) key { + [key retain]; + [__key release]; + __key = key; + __key_isset = YES; +} + +- (BOOL) keyIsSet { + return __key_isset; +} + +- (void) unsetKey { + [__key release]; + __key = nil; + __key_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setIdentifier: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setKey: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"EDAMNotFoundException"]; + if (__identifier_isset) { + if (__identifier != nil) { + [outProtocol writeFieldBeginWithName: @"identifier" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __identifier]; + [outProtocol writeFieldEnd]; + } + } + if (__key_isset) { + if (__key != nil) { + [outProtocol writeFieldBeginWithName: @"key" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __key]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"EDAMNotFoundException("]; + [ms appendString: @"identifier:"]; + [ms appendFormat: @"\"%@\"", __identifier]; + [ms appendString: @",key:"]; + [ms appendFormat: @"\"%@\"", __key]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/NoteStore.h b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/NoteStore.h new file mode 100644 index 00000000..fd494d70 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/NoteStore.h @@ -0,0 +1,558 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ + +#import + +#import "TProtocol.h" +#import "TApplicationException.h" +#import "TProtocolUtil.h" +#import "TProcessor.h" + +#import "UserStore.h" +#import "Types.h" +#import "Errors.h" +#import "Limits.h" + +@interface EDAMSyncState : NSObject { + EDAMTimestamp __currentTime; + EDAMTimestamp __fullSyncBefore; + int32_t __updateCount; + int64_t __uploaded; + + BOOL __currentTime_isset; + BOOL __fullSyncBefore_isset; + BOOL __updateCount_isset; + BOOL __uploaded_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=currentTime, setter=setCurrentTime:) EDAMTimestamp currentTime; +@property (nonatomic, getter=fullSyncBefore, setter=setFullSyncBefore:) EDAMTimestamp fullSyncBefore; +@property (nonatomic, getter=updateCount, setter=setUpdateCount:) int32_t updateCount; +@property (nonatomic, getter=uploaded, setter=setUploaded:) int64_t uploaded; +#endif + +- (id) initWithCurrentTime: (EDAMTimestamp) currentTime fullSyncBefore: (EDAMTimestamp) fullSyncBefore updateCount: (int32_t) updateCount uploaded: (int64_t) uploaded; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMTimestamp) currentTime; +- (void) setCurrentTime: (EDAMTimestamp) currentTime; +- (BOOL) currentTimeIsSet; + +- (EDAMTimestamp) fullSyncBefore; +- (void) setFullSyncBefore: (EDAMTimestamp) fullSyncBefore; +- (BOOL) fullSyncBeforeIsSet; + +- (int32_t) updateCount; +- (void) setUpdateCount: (int32_t) updateCount; +- (BOOL) updateCountIsSet; + +- (int64_t) uploaded; +- (void) setUploaded: (int64_t) uploaded; +- (BOOL) uploadedIsSet; + +@end + +@interface EDAMSyncChunk : NSObject { + EDAMTimestamp __currentTime; + int32_t __chunkHighUSN; + int32_t __updateCount; + NSArray * __notes; + NSArray * __notebooks; + NSArray * __tags; + NSArray * __searches; + NSArray * __resources; + NSArray * __expungedNotes; + NSArray * __expungedNotebooks; + NSArray * __expungedTags; + NSArray * __expungedSearches; + + BOOL __currentTime_isset; + BOOL __chunkHighUSN_isset; + BOOL __updateCount_isset; + BOOL __notes_isset; + BOOL __notebooks_isset; + BOOL __tags_isset; + BOOL __searches_isset; + BOOL __resources_isset; + BOOL __expungedNotes_isset; + BOOL __expungedNotebooks_isset; + BOOL __expungedTags_isset; + BOOL __expungedSearches_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=currentTime, setter=setCurrentTime:) EDAMTimestamp currentTime; +@property (nonatomic, getter=chunkHighUSN, setter=setChunkHighUSN:) int32_t chunkHighUSN; +@property (nonatomic, getter=updateCount, setter=setUpdateCount:) int32_t updateCount; +@property (nonatomic, retain, getter=notes, setter=setNotes:) NSArray * notes; +@property (nonatomic, retain, getter=notebooks, setter=setNotebooks:) NSArray * notebooks; +@property (nonatomic, retain, getter=tags, setter=setTags:) NSArray * tags; +@property (nonatomic, retain, getter=searches, setter=setSearches:) NSArray * searches; +@property (nonatomic, retain, getter=resources, setter=setResources:) NSArray * resources; +@property (nonatomic, retain, getter=expungedNotes, setter=setExpungedNotes:) NSArray * expungedNotes; +@property (nonatomic, retain, getter=expungedNotebooks, setter=setExpungedNotebooks:) NSArray * expungedNotebooks; +@property (nonatomic, retain, getter=expungedTags, setter=setExpungedTags:) NSArray * expungedTags; +@property (nonatomic, retain, getter=expungedSearches, setter=setExpungedSearches:) NSArray * expungedSearches; +#endif + +- (id) initWithCurrentTime: (EDAMTimestamp) currentTime chunkHighUSN: (int32_t) chunkHighUSN updateCount: (int32_t) updateCount notes: (NSArray *) notes notebooks: (NSArray *) notebooks tags: (NSArray *) tags searches: (NSArray *) searches resources: (NSArray *) resources expungedNotes: (NSArray *) expungedNotes expungedNotebooks: (NSArray *) expungedNotebooks expungedTags: (NSArray *) expungedTags expungedSearches: (NSArray *) expungedSearches; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMTimestamp) currentTime; +- (void) setCurrentTime: (EDAMTimestamp) currentTime; +- (BOOL) currentTimeIsSet; + +- (int32_t) chunkHighUSN; +- (void) setChunkHighUSN: (int32_t) chunkHighUSN; +- (BOOL) chunkHighUSNIsSet; + +- (int32_t) updateCount; +- (void) setUpdateCount: (int32_t) updateCount; +- (BOOL) updateCountIsSet; + +- (NSArray *) notes; +- (void) setNotes: (NSArray *) notes; +- (BOOL) notesIsSet; + +- (NSArray *) notebooks; +- (void) setNotebooks: (NSArray *) notebooks; +- (BOOL) notebooksIsSet; + +- (NSArray *) tags; +- (void) setTags: (NSArray *) tags; +- (BOOL) tagsIsSet; + +- (NSArray *) searches; +- (void) setSearches: (NSArray *) searches; +- (BOOL) searchesIsSet; + +- (NSArray *) resources; +- (void) setResources: (NSArray *) resources; +- (BOOL) resourcesIsSet; + +- (NSArray *) expungedNotes; +- (void) setExpungedNotes: (NSArray *) expungedNotes; +- (BOOL) expungedNotesIsSet; + +- (NSArray *) expungedNotebooks; +- (void) setExpungedNotebooks: (NSArray *) expungedNotebooks; +- (BOOL) expungedNotebooksIsSet; + +- (NSArray *) expungedTags; +- (void) setExpungedTags: (NSArray *) expungedTags; +- (BOOL) expungedTagsIsSet; + +- (NSArray *) expungedSearches; +- (void) setExpungedSearches: (NSArray *) expungedSearches; +- (BOOL) expungedSearchesIsSet; + +@end + +@interface EDAMNoteFilter : NSObject { + int32_t __order; + BOOL __ascending; + NSString * __words; + EDAMGuid __notebookGuid; + NSArray * __tagGuids; + NSString * __timeZone; + BOOL __inactive; + + BOOL __order_isset; + BOOL __ascending_isset; + BOOL __words_isset; + BOOL __notebookGuid_isset; + BOOL __tagGuids_isset; + BOOL __timeZone_isset; + BOOL __inactive_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=order, setter=setOrder:) int32_t order; +@property (nonatomic, getter=ascending, setter=setAscending:) BOOL ascending; +@property (nonatomic, retain, getter=words, setter=setWords:) NSString * words; +@property (nonatomic, retain, getter=notebookGuid, setter=setNotebookGuid:) EDAMGuid notebookGuid; +@property (nonatomic, retain, getter=tagGuids, setter=setTagGuids:) NSArray * tagGuids; +@property (nonatomic, retain, getter=timeZone, setter=setTimeZone:) NSString * timeZone; +@property (nonatomic, getter=inactive, setter=setInactive:) BOOL inactive; +#endif + +- (id) initWithOrder: (int32_t) order ascending: (BOOL) ascending words: (NSString *) words notebookGuid: (EDAMGuid) notebookGuid tagGuids: (NSArray *) tagGuids timeZone: (NSString *) timeZone inactive: (BOOL) inactive; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int32_t) order; +- (void) setOrder: (int32_t) order; +- (BOOL) orderIsSet; + +- (BOOL) ascending; +- (void) setAscending: (BOOL) ascending; +- (BOOL) ascendingIsSet; + +- (NSString *) words; +- (void) setWords: (NSString *) words; +- (BOOL) wordsIsSet; + +- (EDAMGuid) notebookGuid; +- (void) setNotebookGuid: (EDAMGuid) notebookGuid; +- (BOOL) notebookGuidIsSet; + +- (NSArray *) tagGuids; +- (void) setTagGuids: (NSArray *) tagGuids; +- (BOOL) tagGuidsIsSet; + +- (NSString *) timeZone; +- (void) setTimeZone: (NSString *) timeZone; +- (BOOL) timeZoneIsSet; + +- (BOOL) inactive; +- (void) setInactive: (BOOL) inactive; +- (BOOL) inactiveIsSet; + +@end + +@interface EDAMNoteList : NSObject { + int32_t __startIndex; + int32_t __totalNotes; + NSArray * __notes; + NSArray * __stoppedWords; + NSArray * __searchedWords; + + BOOL __startIndex_isset; + BOOL __totalNotes_isset; + BOOL __notes_isset; + BOOL __stoppedWords_isset; + BOOL __searchedWords_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=startIndex, setter=setStartIndex:) int32_t startIndex; +@property (nonatomic, getter=totalNotes, setter=setTotalNotes:) int32_t totalNotes; +@property (nonatomic, retain, getter=notes, setter=setNotes:) NSArray * notes; +@property (nonatomic, retain, getter=stoppedWords, setter=setStoppedWords:) NSArray * stoppedWords; +@property (nonatomic, retain, getter=searchedWords, setter=setSearchedWords:) NSArray * searchedWords; +#endif + +- (id) initWithStartIndex: (int32_t) startIndex totalNotes: (int32_t) totalNotes notes: (NSArray *) notes stoppedWords: (NSArray *) stoppedWords searchedWords: (NSArray *) searchedWords; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int32_t) startIndex; +- (void) setStartIndex: (int32_t) startIndex; +- (BOOL) startIndexIsSet; + +- (int32_t) totalNotes; +- (void) setTotalNotes: (int32_t) totalNotes; +- (BOOL) totalNotesIsSet; + +- (NSArray *) notes; +- (void) setNotes: (NSArray *) notes; +- (BOOL) notesIsSet; + +- (NSArray *) stoppedWords; +- (void) setStoppedWords: (NSArray *) stoppedWords; +- (BOOL) stoppedWordsIsSet; + +- (NSArray *) searchedWords; +- (void) setSearchedWords: (NSArray *) searchedWords; +- (BOOL) searchedWordsIsSet; + +@end + +@interface EDAMNoteCollectionCounts : NSObject { + NSDictionary * __notebookCounts; + NSDictionary * __tagCounts; + int32_t __trashCount; + + BOOL __notebookCounts_isset; + BOOL __tagCounts_isset; + BOOL __trashCount_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=notebookCounts, setter=setNotebookCounts:) NSDictionary * notebookCounts; +@property (nonatomic, retain, getter=tagCounts, setter=setTagCounts:) NSDictionary * tagCounts; +@property (nonatomic, getter=trashCount, setter=setTrashCount:) int32_t trashCount; +#endif + +- (id) initWithNotebookCounts: (NSDictionary *) notebookCounts tagCounts: (NSDictionary *) tagCounts trashCount: (int32_t) trashCount; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSDictionary *) notebookCounts; +- (void) setNotebookCounts: (NSDictionary *) notebookCounts; +- (BOOL) notebookCountsIsSet; + +- (NSDictionary *) tagCounts; +- (void) setTagCounts: (NSDictionary *) tagCounts; +- (BOOL) tagCountsIsSet; + +- (int32_t) trashCount; +- (void) setTrashCount: (int32_t) trashCount; +- (BOOL) trashCountIsSet; + +@end + +@interface EDAMAdImpressions : NSObject { + int32_t __adId; + int32_t __impressionCount; + int32_t __impressionTime; + + BOOL __adId_isset; + BOOL __impressionCount_isset; + BOOL __impressionTime_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=adId, setter=setAdId:) int32_t adId; +@property (nonatomic, getter=impressionCount, setter=setImpressionCount:) int32_t impressionCount; +@property (nonatomic, getter=impressionTime, setter=setImpressionTime:) int32_t impressionTime; +#endif + +- (id) initWithAdId: (int32_t) adId impressionCount: (int32_t) impressionCount impressionTime: (int32_t) impressionTime; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int32_t) adId; +- (void) setAdId: (int32_t) adId; +- (BOOL) adIdIsSet; + +- (int32_t) impressionCount; +- (void) setImpressionCount: (int32_t) impressionCount; +- (BOOL) impressionCountIsSet; + +- (int32_t) impressionTime; +- (void) setImpressionTime: (int32_t) impressionTime; +- (BOOL) impressionTimeIsSet; + +@end + +@interface EDAMAdParameters : NSObject { + NSString * __clientLanguage; + NSArray * __impressions; + BOOL __supportHtml; + NSDictionary * __clientProperties; + + BOOL __clientLanguage_isset; + BOOL __impressions_isset; + BOOL __supportHtml_isset; + BOOL __clientProperties_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=clientLanguage, setter=setClientLanguage:) NSString * clientLanguage; +@property (nonatomic, retain, getter=impressions, setter=setImpressions:) NSArray * impressions; +@property (nonatomic, getter=supportHtml, setter=setSupportHtml:) BOOL supportHtml; +@property (nonatomic, retain, getter=clientProperties, setter=setClientProperties:) NSDictionary * clientProperties; +#endif + +- (id) initWithClientLanguage: (NSString *) clientLanguage impressions: (NSArray *) impressions supportHtml: (BOOL) supportHtml clientProperties: (NSDictionary *) clientProperties; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) clientLanguage; +- (void) setClientLanguage: (NSString *) clientLanguage; +- (BOOL) clientLanguageIsSet; + +- (NSArray *) impressions; +- (void) setImpressions: (NSArray *) impressions; +- (BOOL) impressionsIsSet; + +- (BOOL) supportHtml; +- (void) setSupportHtml: (BOOL) supportHtml; +- (BOOL) supportHtmlIsSet; + +- (NSDictionary *) clientProperties; +- (void) setClientProperties: (NSDictionary *) clientProperties; +- (BOOL) clientPropertiesIsSet; + +@end + +@interface EDAMNoteEmailParameters : NSObject { + NSString * __guid; + EDAMNote * __note; + NSArray * __toAddresses; + NSArray * __ccAddresses; + NSString * __subject; + NSString * __message; + + BOOL __guid_isset; + BOOL __note_isset; + BOOL __toAddresses_isset; + BOOL __ccAddresses_isset; + BOOL __subject_isset; + BOOL __message_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=guid, setter=setGuid:) NSString * guid; +@property (nonatomic, retain, getter=note, setter=setNote:) EDAMNote * note; +@property (nonatomic, retain, getter=toAddresses, setter=setToAddresses:) NSArray * toAddresses; +@property (nonatomic, retain, getter=ccAddresses, setter=setCcAddresses:) NSArray * ccAddresses; +@property (nonatomic, retain, getter=subject, setter=setSubject:) NSString * subject; +@property (nonatomic, retain, getter=message, setter=setMessage:) NSString * message; +#endif + +- (id) initWithGuid: (NSString *) guid note: (EDAMNote *) note toAddresses: (NSArray *) toAddresses ccAddresses: (NSArray *) ccAddresses subject: (NSString *) subject message: (NSString *) message; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) guid; +- (void) setGuid: (NSString *) guid; +- (BOOL) guidIsSet; + +- (EDAMNote *) note; +- (void) setNote: (EDAMNote *) note; +- (BOOL) noteIsSet; + +- (NSArray *) toAddresses; +- (void) setToAddresses: (NSArray *) toAddresses; +- (BOOL) toAddressesIsSet; + +- (NSArray *) ccAddresses; +- (void) setCcAddresses: (NSArray *) ccAddresses; +- (BOOL) ccAddressesIsSet; + +- (NSString *) subject; +- (void) setSubject: (NSString *) subject; +- (BOOL) subjectIsSet; + +- (NSString *) message; +- (void) setMessage: (NSString *) message; +- (BOOL) messageIsSet; + +@end + +@interface EDAMNoteVersionId : NSObject { + int32_t __updateSequenceNum; + EDAMTimestamp __updated; + EDAMTimestamp __saved; + NSString * __title; + + BOOL __updateSequenceNum_isset; + BOOL __updated_isset; + BOOL __saved_isset; + BOOL __title_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=updateSequenceNum, setter=setUpdateSequenceNum:) int32_t updateSequenceNum; +@property (nonatomic, getter=updated, setter=setUpdated:) EDAMTimestamp updated; +@property (nonatomic, getter=saved, setter=setSaved:) EDAMTimestamp saved; +@property (nonatomic, retain, getter=title, setter=setTitle:) NSString * title; +#endif + +- (id) initWithUpdateSequenceNum: (int32_t) updateSequenceNum updated: (EDAMTimestamp) updated saved: (EDAMTimestamp) saved title: (NSString *) title; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int32_t) updateSequenceNum; +- (void) setUpdateSequenceNum: (int32_t) updateSequenceNum; +- (BOOL) updateSequenceNumIsSet; + +- (EDAMTimestamp) updated; +- (void) setUpdated: (EDAMTimestamp) updated; +- (BOOL) updatedIsSet; + +- (EDAMTimestamp) saved; +- (void) setSaved: (EDAMTimestamp) saved; +- (BOOL) savedIsSet; + +- (NSString *) title; +- (void) setTitle: (NSString *) title; +- (BOOL) titleIsSet; + +@end + +@protocol EDAMNoteStore +- (EDAMSyncState *) getSyncState: (NSString *) authenticationToken; // throws EDAMUserException *, EDAMSystemException *, TException +- (EDAMSyncChunk *) getSyncChunk: (NSString *) authenticationToken : (int32_t) afterUSN : (int32_t) maxEntries : (BOOL) fullSyncOnly; // throws EDAMUserException *, EDAMSystemException *, TException +- (NSArray *) listNotebooks: (NSString *) authenticationToken; // throws EDAMUserException *, EDAMSystemException *, TException +- (EDAMNotebook *) getNotebook: (NSString *) authenticationToken : (EDAMGuid) guid; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (EDAMNotebook *) getDefaultNotebook: (NSString *) authenticationToken; // throws EDAMUserException *, EDAMSystemException *, TException +- (EDAMNotebook *) createNotebook: (NSString *) authenticationToken : (EDAMNotebook *) notebook; // throws EDAMUserException *, EDAMSystemException *, TException +- (int32_t) updateNotebook: (NSString *) authenticationToken : (EDAMNotebook *) notebook; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (int32_t) expungeNotebook: (NSString *) authenticationToken : (EDAMGuid) guid; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (NSArray *) listTags: (NSString *) authenticationToken; // throws EDAMUserException *, EDAMSystemException *, TException +- (NSArray *) listTagsByNotebook: (NSString *) authenticationToken : (EDAMGuid) notebookGuid; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (EDAMTag *) getTag: (NSString *) authenticationToken : (EDAMGuid) guid; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (EDAMTag *) createTag: (NSString *) authenticationToken : (EDAMTag *) tag; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (int32_t) updateTag: (NSString *) authenticationToken : (EDAMTag *) tag; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (void) untagAll: (NSString *) authenticationToken : (EDAMGuid) guid; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (int32_t) expungeTag: (NSString *) authenticationToken : (EDAMGuid) guid; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (NSArray *) listSearches: (NSString *) authenticationToken; // throws EDAMUserException *, EDAMSystemException *, TException +- (EDAMSavedSearch *) getSearch: (NSString *) authenticationToken : (EDAMGuid) guid; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (EDAMSavedSearch *) createSearch: (NSString *) authenticationToken : (EDAMSavedSearch *) search; // throws EDAMUserException *, EDAMSystemException *, TException +- (int32_t) updateSearch: (NSString *) authenticationToken : (EDAMSavedSearch *) search; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (int32_t) expungeSearch: (NSString *) authenticationToken : (EDAMGuid) guid; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (EDAMNoteList *) findNotes: (NSString *) authenticationToken : (EDAMNoteFilter *) filter : (int32_t) offset : (int32_t) maxNotes; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (EDAMNoteCollectionCounts *) findNoteCounts: (NSString *) authenticationToken : (EDAMNoteFilter *) filter : (BOOL) withTrash; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (EDAMNote *) getNote: (NSString *) authenticationToken : (EDAMGuid) guid : (BOOL) withContent : (BOOL) withResourcesData : (BOOL) withResourcesRecognition : (BOOL) withResourcesAlternateData; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (NSString *) getNoteContent: (NSString *) authenticationToken : (EDAMGuid) guid; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (NSString *) getNoteSearchText: (NSString *) authenticationToken : (EDAMGuid) guid; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (NSArray *) getNoteTagNames: (NSString *) authenticationToken : (EDAMGuid) guid; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (EDAMNote *) createNote: (NSString *) authenticationToken : (EDAMNote *) note; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (EDAMNote *) updateNote: (NSString *) authenticationToken : (EDAMNote *) note; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (int32_t) deleteNote: (NSString *) authenticationToken : (EDAMGuid) guid; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (int32_t) expungeNote: (NSString *) authenticationToken : (EDAMGuid) guid; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (int32_t) expungeNotes: (NSString *) authenticationToken : (NSArray *) noteGuids; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (int32_t) expungeInactiveNotes: (NSString *) authenticationToken; // throws EDAMUserException *, EDAMSystemException *, TException +- (EDAMNote *) copyNote: (NSString *) authenticationToken : (EDAMGuid) noteGuid : (EDAMGuid) toNotebookGuid; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (NSArray *) listNoteVersions: (NSString *) authenticationToken : (EDAMGuid) noteGuid; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (EDAMNote *) getNoteVersion: (NSString *) authenticationToken : (EDAMGuid) noteGuid : (int32_t) updateSequenceNum : (BOOL) withResourcesData : (BOOL) withResourcesRecognition : (BOOL) withResourcesAlternateData; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (EDAMResource *) getResource: (NSString *) authenticationToken : (EDAMGuid) guid : (BOOL) withData : (BOOL) withRecognition : (BOOL) withAttributes : (BOOL) withAlternateData; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (int32_t) updateResource: (NSString *) authenticationToken : (EDAMResource *) resource; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (NSData *) getResourceData: (NSString *) authenticationToken : (EDAMGuid) guid; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (EDAMResource *) getResourceByHash: (NSString *) authenticationToken : (EDAMGuid) noteGuid : (NSData *) contentHash : (BOOL) withData : (BOOL) withRecognition : (BOOL) withAlternateData; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (NSData *) getResourceRecognition: (NSString *) authenticationToken : (EDAMGuid) guid; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (NSData *) getResourceAlternateData: (NSString *) authenticationToken : (EDAMGuid) guid; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (EDAMResourceAttributes *) getResourceAttributes: (NSString *) authenticationToken : (EDAMGuid) guid; // throws EDAMUserException *, EDAMSystemException *, EDAMNotFoundException *, TException +- (int64_t) getAccountSize: (NSString *) authenticationToken; // throws EDAMUserException *, EDAMSystemException *, TException +- (NSArray *) getAds: (NSString *) authenticationToken : (EDAMAdParameters *) adParameters; // throws EDAMUserException *, EDAMSystemException *, TException +- (EDAMAd *) getRandomAd: (NSString *) authenticationToken : (EDAMAdParameters *) adParameters; // throws EDAMUserException *, EDAMSystemException *, TException +- (EDAMNotebook *) getPublicNotebook: (EDAMUserID) userId : (NSString *) publicUri; // throws EDAMSystemException *, EDAMNotFoundException *, TException +- (EDAMSharedNotebook *) createSharedNotebook: (NSString *) authenticationToken : (EDAMSharedNotebook *) sharedNotebook; // throws EDAMUserException *, EDAMNotFoundException *, EDAMSystemException *, TException +- (NSArray *) listSharedNotebooks: (NSString *) authenticationToken; // throws EDAMUserException *, EDAMNotFoundException *, EDAMSystemException *, TException +- (int32_t) expungeSharedNotebooks: (NSString *) authenticationToken : (NSArray *) sharedNotebookIds; // throws EDAMUserException *, EDAMNotFoundException *, EDAMSystemException *, TException +- (EDAMLinkedNotebook *) createLinkedNotebook: (NSString *) authenticationToken : (EDAMLinkedNotebook *) linkedNotebook; // throws EDAMUserException *, EDAMNotFoundException *, EDAMSystemException *, TException +- (EDAMLinkedNotebook *) updateLinkedNotebook: (NSString *) authenticationToken : (EDAMLinkedNotebook *) linkedNotebook; // throws EDAMUserException *, EDAMNotFoundException *, EDAMSystemException *, TException +- (NSArray *) listLinkedNotebooks: (NSString *) authenticationToken; // throws EDAMUserException *, EDAMNotFoundException *, EDAMSystemException *, TException +- (int32_t) expungeLinkedNotebook: (NSString *) authenticationToken : (int64_t) linkedNotebookId; // throws EDAMUserException *, EDAMNotFoundException *, EDAMSystemException *, TException +- (EDAMAuthenticationResult *) authenticateToSharedNotebook: (NSString *) shareKey : (NSString *) authenticationToken; // throws EDAMUserException *, EDAMNotFoundException *, EDAMSystemException *, TException +- (EDAMSharedNotebook *) getSharedNotebookByAuth: (NSString *) authenticationToken; // throws EDAMUserException *, EDAMNotFoundException *, EDAMSystemException *, TException +- (void) emailNote: (NSString *) authenticationToken : (EDAMNoteEmailParameters *) parameters; // throws EDAMUserException *, EDAMNotFoundException *, EDAMSystemException *, TException +@end + +@interface EDAMNoteStoreClient : NSObject { + id inProtocol; + id outProtocol; +} +- (id) initWithProtocol: (id ) protocol; +- (id) initWithInProtocol: (id ) inProtocol outProtocol: (id ) outProtocol; +@end + +@interface EDAMNoteStoreProcessor : NSObject { + id mService; + NSDictionary * mMethodMap; +} +- (id) initWithNoteStore: (id ) service; +- (id) service; +@end + +@interface EDAMNoteStoreConstants : NSObject { +} +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/NoteStore.m b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/NoteStore.m new file mode 100644 index 00000000..a70bfc49 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/NoteStore.m @@ -0,0 +1,36071 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ + +#import + +#import "TProtocol.h" +#import "TApplicationException.h" +#import "TProtocolUtil.h" +#import "TProcessor.h" + +#import "UserStore.h" +#import "Types.h" +#import "Errors.h" +#import "Limits.h" + +#import "NoteStore.h" + + +@implementation EDAMNoteStoreConstants ++ (void) initialize { +} +@end + +@implementation EDAMSyncState + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic currentTime; +@dynamic fullSyncBefore; +@dynamic updateCount; +@dynamic uploaded; +#endif + +- (id) initWithCurrentTime: (EDAMTimestamp) currentTime fullSyncBefore: (EDAMTimestamp) fullSyncBefore updateCount: (int32_t) updateCount uploaded: (int64_t) uploaded +{ + self = [super init]; + __currentTime = currentTime; + __currentTime_isset = YES; + __fullSyncBefore = fullSyncBefore; + __fullSyncBefore_isset = YES; + __updateCount = updateCount; + __updateCount_isset = YES; + __uploaded = uploaded; + __uploaded_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"currentTime"]) + { + __currentTime = [decoder decodeInt64ForKey: @"currentTime"]; + __currentTime_isset = YES; + } + if ([decoder containsValueForKey: @"fullSyncBefore"]) + { + __fullSyncBefore = [decoder decodeInt64ForKey: @"fullSyncBefore"]; + __fullSyncBefore_isset = YES; + } + if ([decoder containsValueForKey: @"updateCount"]) + { + __updateCount = [decoder decodeInt32ForKey: @"updateCount"]; + __updateCount_isset = YES; + } + if ([decoder containsValueForKey: @"uploaded"]) + { + __uploaded = [decoder decodeInt64ForKey: @"uploaded"]; + __uploaded_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__currentTime_isset) + { + [encoder encodeInt64: __currentTime forKey: @"currentTime"]; + } + if (__fullSyncBefore_isset) + { + [encoder encodeInt64: __fullSyncBefore forKey: @"fullSyncBefore"]; + } + if (__updateCount_isset) + { + [encoder encodeInt32: __updateCount forKey: @"updateCount"]; + } + if (__uploaded_isset) + { + [encoder encodeInt64: __uploaded forKey: @"uploaded"]; + } +} + +- (void) dealloc +{ + [super dealloc]; +} + +- (int64_t) currentTime { + return __currentTime; +} + +- (void) setCurrentTime: (int64_t) currentTime { + __currentTime = currentTime; + __currentTime_isset = YES; +} + +- (BOOL) currentTimeIsSet { + return __currentTime_isset; +} + +- (void) unsetCurrentTime { + __currentTime_isset = NO; +} + +- (int64_t) fullSyncBefore { + return __fullSyncBefore; +} + +- (void) setFullSyncBefore: (int64_t) fullSyncBefore { + __fullSyncBefore = fullSyncBefore; + __fullSyncBefore_isset = YES; +} + +- (BOOL) fullSyncBeforeIsSet { + return __fullSyncBefore_isset; +} + +- (void) unsetFullSyncBefore { + __fullSyncBefore_isset = NO; +} + +- (int32_t) updateCount { + return __updateCount; +} + +- (void) setUpdateCount: (int32_t) updateCount { + __updateCount = updateCount; + __updateCount_isset = YES; +} + +- (BOOL) updateCountIsSet { + return __updateCount_isset; +} + +- (void) unsetUpdateCount { + __updateCount_isset = NO; +} + +- (int64_t) uploaded { + return __uploaded; +} + +- (void) setUploaded: (int64_t) uploaded { + __uploaded = uploaded; + __uploaded_isset = YES; +} + +- (BOOL) uploadedIsSet { + return __uploaded_isset; +} + +- (void) unsetUploaded { + __uploaded_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setCurrentTime: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setFullSyncBefore: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setUpdateCount: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setUploaded: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"SyncState"]; + if (__currentTime_isset) { + [outProtocol writeFieldBeginWithName: @"currentTime" type: TType_I64 fieldID: 1]; + [outProtocol writeI64: __currentTime]; + [outProtocol writeFieldEnd]; + } + if (__fullSyncBefore_isset) { + [outProtocol writeFieldBeginWithName: @"fullSyncBefore" type: TType_I64 fieldID: 2]; + [outProtocol writeI64: __fullSyncBefore]; + [outProtocol writeFieldEnd]; + } + if (__updateCount_isset) { + [outProtocol writeFieldBeginWithName: @"updateCount" type: TType_I32 fieldID: 3]; + [outProtocol writeI32: __updateCount]; + [outProtocol writeFieldEnd]; + } + if (__uploaded_isset) { + [outProtocol writeFieldBeginWithName: @"uploaded" type: TType_I64 fieldID: 4]; + [outProtocol writeI64: __uploaded]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"SyncState("]; + [ms appendString: @"currentTime:"]; + [ms appendFormat: @"%qi", __currentTime]; + [ms appendString: @",fullSyncBefore:"]; + [ms appendFormat: @"%qi", __fullSyncBefore]; + [ms appendString: @",updateCount:"]; + [ms appendFormat: @"%i", __updateCount]; + [ms appendString: @",uploaded:"]; + [ms appendFormat: @"%qi", __uploaded]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMSyncChunk + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic currentTime; +@dynamic chunkHighUSN; +@dynamic updateCount; +@dynamic notes; +@dynamic notebooks; +@dynamic tags; +@dynamic searches; +@dynamic resources; +@dynamic expungedNotes; +@dynamic expungedNotebooks; +@dynamic expungedTags; +@dynamic expungedSearches; +#endif + +- (id) initWithCurrentTime: (EDAMTimestamp) currentTime chunkHighUSN: (int32_t) chunkHighUSN updateCount: (int32_t) updateCount notes: (NSArray *) notes notebooks: (NSArray *) notebooks tags: (NSArray *) tags searches: (NSArray *) searches resources: (NSArray *) resources expungedNotes: (NSArray *) expungedNotes expungedNotebooks: (NSArray *) expungedNotebooks expungedTags: (NSArray *) expungedTags expungedSearches: (NSArray *) expungedSearches +{ + self = [super init]; + __currentTime = currentTime; + __currentTime_isset = YES; + __chunkHighUSN = chunkHighUSN; + __chunkHighUSN_isset = YES; + __updateCount = updateCount; + __updateCount_isset = YES; + __notes = [notes retain]; + __notes_isset = YES; + __notebooks = [notebooks retain]; + __notebooks_isset = YES; + __tags = [tags retain]; + __tags_isset = YES; + __searches = [searches retain]; + __searches_isset = YES; + __resources = [resources retain]; + __resources_isset = YES; + __expungedNotes = [expungedNotes retain]; + __expungedNotes_isset = YES; + __expungedNotebooks = [expungedNotebooks retain]; + __expungedNotebooks_isset = YES; + __expungedTags = [expungedTags retain]; + __expungedTags_isset = YES; + __expungedSearches = [expungedSearches retain]; + __expungedSearches_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"currentTime"]) + { + __currentTime = [decoder decodeInt64ForKey: @"currentTime"]; + __currentTime_isset = YES; + } + if ([decoder containsValueForKey: @"chunkHighUSN"]) + { + __chunkHighUSN = [decoder decodeInt32ForKey: @"chunkHighUSN"]; + __chunkHighUSN_isset = YES; + } + if ([decoder containsValueForKey: @"updateCount"]) + { + __updateCount = [decoder decodeInt32ForKey: @"updateCount"]; + __updateCount_isset = YES; + } + if ([decoder containsValueForKey: @"notes"]) + { + __notes = [[decoder decodeObjectForKey: @"notes"] retain]; + __notes_isset = YES; + } + if ([decoder containsValueForKey: @"notebooks"]) + { + __notebooks = [[decoder decodeObjectForKey: @"notebooks"] retain]; + __notebooks_isset = YES; + } + if ([decoder containsValueForKey: @"tags"]) + { + __tags = [[decoder decodeObjectForKey: @"tags"] retain]; + __tags_isset = YES; + } + if ([decoder containsValueForKey: @"searches"]) + { + __searches = [[decoder decodeObjectForKey: @"searches"] retain]; + __searches_isset = YES; + } + if ([decoder containsValueForKey: @"resources"]) + { + __resources = [[decoder decodeObjectForKey: @"resources"] retain]; + __resources_isset = YES; + } + if ([decoder containsValueForKey: @"expungedNotes"]) + { + __expungedNotes = [[decoder decodeObjectForKey: @"expungedNotes"] retain]; + __expungedNotes_isset = YES; + } + if ([decoder containsValueForKey: @"expungedNotebooks"]) + { + __expungedNotebooks = [[decoder decodeObjectForKey: @"expungedNotebooks"] retain]; + __expungedNotebooks_isset = YES; + } + if ([decoder containsValueForKey: @"expungedTags"]) + { + __expungedTags = [[decoder decodeObjectForKey: @"expungedTags"] retain]; + __expungedTags_isset = YES; + } + if ([decoder containsValueForKey: @"expungedSearches"]) + { + __expungedSearches = [[decoder decodeObjectForKey: @"expungedSearches"] retain]; + __expungedSearches_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__currentTime_isset) + { + [encoder encodeInt64: __currentTime forKey: @"currentTime"]; + } + if (__chunkHighUSN_isset) + { + [encoder encodeInt32: __chunkHighUSN forKey: @"chunkHighUSN"]; + } + if (__updateCount_isset) + { + [encoder encodeInt32: __updateCount forKey: @"updateCount"]; + } + if (__notes_isset) + { + [encoder encodeObject: __notes forKey: @"notes"]; + } + if (__notebooks_isset) + { + [encoder encodeObject: __notebooks forKey: @"notebooks"]; + } + if (__tags_isset) + { + [encoder encodeObject: __tags forKey: @"tags"]; + } + if (__searches_isset) + { + [encoder encodeObject: __searches forKey: @"searches"]; + } + if (__resources_isset) + { + [encoder encodeObject: __resources forKey: @"resources"]; + } + if (__expungedNotes_isset) + { + [encoder encodeObject: __expungedNotes forKey: @"expungedNotes"]; + } + if (__expungedNotebooks_isset) + { + [encoder encodeObject: __expungedNotebooks forKey: @"expungedNotebooks"]; + } + if (__expungedTags_isset) + { + [encoder encodeObject: __expungedTags forKey: @"expungedTags"]; + } + if (__expungedSearches_isset) + { + [encoder encodeObject: __expungedSearches forKey: @"expungedSearches"]; + } +} + +- (void) dealloc +{ + [__notes release]; + [__notebooks release]; + [__tags release]; + [__searches release]; + [__resources release]; + [__expungedNotes release]; + [__expungedNotebooks release]; + [__expungedTags release]; + [__expungedSearches release]; + [super dealloc]; +} + +- (int64_t) currentTime { + return __currentTime; +} + +- (void) setCurrentTime: (int64_t) currentTime { + __currentTime = currentTime; + __currentTime_isset = YES; +} + +- (BOOL) currentTimeIsSet { + return __currentTime_isset; +} + +- (void) unsetCurrentTime { + __currentTime_isset = NO; +} + +- (int32_t) chunkHighUSN { + return __chunkHighUSN; +} + +- (void) setChunkHighUSN: (int32_t) chunkHighUSN { + __chunkHighUSN = chunkHighUSN; + __chunkHighUSN_isset = YES; +} + +- (BOOL) chunkHighUSNIsSet { + return __chunkHighUSN_isset; +} + +- (void) unsetChunkHighUSN { + __chunkHighUSN_isset = NO; +} + +- (int32_t) updateCount { + return __updateCount; +} + +- (void) setUpdateCount: (int32_t) updateCount { + __updateCount = updateCount; + __updateCount_isset = YES; +} + +- (BOOL) updateCountIsSet { + return __updateCount_isset; +} + +- (void) unsetUpdateCount { + __updateCount_isset = NO; +} + +- (NSArray *) notes { + return [[__notes retain] autorelease]; +} + +- (void) setNotes: (NSArray *) notes { + [notes retain]; + [__notes release]; + __notes = notes; + __notes_isset = YES; +} + +- (BOOL) notesIsSet { + return __notes_isset; +} + +- (void) unsetNotes { + [__notes release]; + __notes = nil; + __notes_isset = NO; +} + +- (NSArray *) notebooks { + return [[__notebooks retain] autorelease]; +} + +- (void) setNotebooks: (NSArray *) notebooks { + [notebooks retain]; + [__notebooks release]; + __notebooks = notebooks; + __notebooks_isset = YES; +} + +- (BOOL) notebooksIsSet { + return __notebooks_isset; +} + +- (void) unsetNotebooks { + [__notebooks release]; + __notebooks = nil; + __notebooks_isset = NO; +} + +- (NSArray *) tags { + return [[__tags retain] autorelease]; +} + +- (void) setTags: (NSArray *) tags { + [tags retain]; + [__tags release]; + __tags = tags; + __tags_isset = YES; +} + +- (BOOL) tagsIsSet { + return __tags_isset; +} + +- (void) unsetTags { + [__tags release]; + __tags = nil; + __tags_isset = NO; +} + +- (NSArray *) searches { + return [[__searches retain] autorelease]; +} + +- (void) setSearches: (NSArray *) searches { + [searches retain]; + [__searches release]; + __searches = searches; + __searches_isset = YES; +} + +- (BOOL) searchesIsSet { + return __searches_isset; +} + +- (void) unsetSearches { + [__searches release]; + __searches = nil; + __searches_isset = NO; +} + +- (NSArray *) resources { + return [[__resources retain] autorelease]; +} + +- (void) setResources: (NSArray *) resources { + [resources retain]; + [__resources release]; + __resources = resources; + __resources_isset = YES; +} + +- (BOOL) resourcesIsSet { + return __resources_isset; +} + +- (void) unsetResources { + [__resources release]; + __resources = nil; + __resources_isset = NO; +} + +- (NSArray *) expungedNotes { + return [[__expungedNotes retain] autorelease]; +} + +- (void) setExpungedNotes: (NSArray *) expungedNotes { + [expungedNotes retain]; + [__expungedNotes release]; + __expungedNotes = expungedNotes; + __expungedNotes_isset = YES; +} + +- (BOOL) expungedNotesIsSet { + return __expungedNotes_isset; +} + +- (void) unsetExpungedNotes { + [__expungedNotes release]; + __expungedNotes = nil; + __expungedNotes_isset = NO; +} + +- (NSArray *) expungedNotebooks { + return [[__expungedNotebooks retain] autorelease]; +} + +- (void) setExpungedNotebooks: (NSArray *) expungedNotebooks { + [expungedNotebooks retain]; + [__expungedNotebooks release]; + __expungedNotebooks = expungedNotebooks; + __expungedNotebooks_isset = YES; +} + +- (BOOL) expungedNotebooksIsSet { + return __expungedNotebooks_isset; +} + +- (void) unsetExpungedNotebooks { + [__expungedNotebooks release]; + __expungedNotebooks = nil; + __expungedNotebooks_isset = NO; +} + +- (NSArray *) expungedTags { + return [[__expungedTags retain] autorelease]; +} + +- (void) setExpungedTags: (NSArray *) expungedTags { + [expungedTags retain]; + [__expungedTags release]; + __expungedTags = expungedTags; + __expungedTags_isset = YES; +} + +- (BOOL) expungedTagsIsSet { + return __expungedTags_isset; +} + +- (void) unsetExpungedTags { + [__expungedTags release]; + __expungedTags = nil; + __expungedTags_isset = NO; +} + +- (NSArray *) expungedSearches { + return [[__expungedSearches retain] autorelease]; +} + +- (void) setExpungedSearches: (NSArray *) expungedSearches { + [expungedSearches retain]; + [__expungedSearches release]; + __expungedSearches = expungedSearches; + __expungedSearches_isset = YES; +} + +- (BOOL) expungedSearchesIsSet { + return __expungedSearches_isset; +} + +- (void) unsetExpungedSearches { + [__expungedSearches release]; + __expungedSearches = nil; + __expungedSearches_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setCurrentTime: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setChunkHighUSN: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setUpdateCount: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_LIST) { + int _size0; + [inProtocol readListBeginReturningElementType: NULL size: &_size0]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size0]; + int _i1; + for (_i1 = 0; _i1 < _size0; ++_i1) + { + EDAMNote *_elem2 = [[EDAMNote alloc] init]; + [_elem2 read: inProtocol]; + [fieldValue addObject: _elem2]; + [_elem2 release]; + } + [inProtocol readListEnd]; + [self setNotes: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 5: + if (fieldType == TType_LIST) { + int _size3; + [inProtocol readListBeginReturningElementType: NULL size: &_size3]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size3]; + int _i4; + for (_i4 = 0; _i4 < _size3; ++_i4) + { + EDAMNotebook *_elem5 = [[EDAMNotebook alloc] init]; + [_elem5 read: inProtocol]; + [fieldValue addObject: _elem5]; + [_elem5 release]; + } + [inProtocol readListEnd]; + [self setNotebooks: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 6: + if (fieldType == TType_LIST) { + int _size6; + [inProtocol readListBeginReturningElementType: NULL size: &_size6]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size6]; + int _i7; + for (_i7 = 0; _i7 < _size6; ++_i7) + { + EDAMTag *_elem8 = [[EDAMTag alloc] init]; + [_elem8 read: inProtocol]; + [fieldValue addObject: _elem8]; + [_elem8 release]; + } + [inProtocol readListEnd]; + [self setTags: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 7: + if (fieldType == TType_LIST) { + int _size9; + [inProtocol readListBeginReturningElementType: NULL size: &_size9]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size9]; + int _i10; + for (_i10 = 0; _i10 < _size9; ++_i10) + { + EDAMSavedSearch *_elem11 = [[EDAMSavedSearch alloc] init]; + [_elem11 read: inProtocol]; + [fieldValue addObject: _elem11]; + [_elem11 release]; + } + [inProtocol readListEnd]; + [self setSearches: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 8: + if (fieldType == TType_LIST) { + int _size12; + [inProtocol readListBeginReturningElementType: NULL size: &_size12]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size12]; + int _i13; + for (_i13 = 0; _i13 < _size12; ++_i13) + { + EDAMResource *_elem14 = [[EDAMResource alloc] init]; + [_elem14 read: inProtocol]; + [fieldValue addObject: _elem14]; + [_elem14 release]; + } + [inProtocol readListEnd]; + [self setResources: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 9: + if (fieldType == TType_LIST) { + int _size15; + [inProtocol readListBeginReturningElementType: NULL size: &_size15]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size15]; + int _i16; + for (_i16 = 0; _i16 < _size15; ++_i16) + { + NSString * _elem17 = [inProtocol readString]; + [fieldValue addObject: _elem17]; + } + [inProtocol readListEnd]; + [self setExpungedNotes: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 10: + if (fieldType == TType_LIST) { + int _size18; + [inProtocol readListBeginReturningElementType: NULL size: &_size18]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size18]; + int _i19; + for (_i19 = 0; _i19 < _size18; ++_i19) + { + NSString * _elem20 = [inProtocol readString]; + [fieldValue addObject: _elem20]; + } + [inProtocol readListEnd]; + [self setExpungedNotebooks: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 11: + if (fieldType == TType_LIST) { + int _size21; + [inProtocol readListBeginReturningElementType: NULL size: &_size21]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size21]; + int _i22; + for (_i22 = 0; _i22 < _size21; ++_i22) + { + NSString * _elem23 = [inProtocol readString]; + [fieldValue addObject: _elem23]; + } + [inProtocol readListEnd]; + [self setExpungedTags: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 12: + if (fieldType == TType_LIST) { + int _size24; + [inProtocol readListBeginReturningElementType: NULL size: &_size24]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size24]; + int _i25; + for (_i25 = 0; _i25 < _size24; ++_i25) + { + NSString * _elem26 = [inProtocol readString]; + [fieldValue addObject: _elem26]; + } + [inProtocol readListEnd]; + [self setExpungedSearches: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"SyncChunk"]; + if (__currentTime_isset) { + [outProtocol writeFieldBeginWithName: @"currentTime" type: TType_I64 fieldID: 1]; + [outProtocol writeI64: __currentTime]; + [outProtocol writeFieldEnd]; + } + if (__chunkHighUSN_isset) { + [outProtocol writeFieldBeginWithName: @"chunkHighUSN" type: TType_I32 fieldID: 2]; + [outProtocol writeI32: __chunkHighUSN]; + [outProtocol writeFieldEnd]; + } + if (__updateCount_isset) { + [outProtocol writeFieldBeginWithName: @"updateCount" type: TType_I32 fieldID: 3]; + [outProtocol writeI32: __updateCount]; + [outProtocol writeFieldEnd]; + } + if (__notes_isset) { + if (__notes != nil) { + [outProtocol writeFieldBeginWithName: @"notes" type: TType_LIST fieldID: 4]; + { + [outProtocol writeListBeginWithElementType: TType_STRUCT size: [__notes count]]; + int i28; + for (i28 = 0; i28 < [__notes count]; i28++) + { + [[__notes objectAtIndex: i28] write: outProtocol]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + if (__notebooks_isset) { + if (__notebooks != nil) { + [outProtocol writeFieldBeginWithName: @"notebooks" type: TType_LIST fieldID: 5]; + { + [outProtocol writeListBeginWithElementType: TType_STRUCT size: [__notebooks count]]; + int i30; + for (i30 = 0; i30 < [__notebooks count]; i30++) + { + [[__notebooks objectAtIndex: i30] write: outProtocol]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + if (__tags_isset) { + if (__tags != nil) { + [outProtocol writeFieldBeginWithName: @"tags" type: TType_LIST fieldID: 6]; + { + [outProtocol writeListBeginWithElementType: TType_STRUCT size: [__tags count]]; + int i32; + for (i32 = 0; i32 < [__tags count]; i32++) + { + [[__tags objectAtIndex: i32] write: outProtocol]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + if (__searches_isset) { + if (__searches != nil) { + [outProtocol writeFieldBeginWithName: @"searches" type: TType_LIST fieldID: 7]; + { + [outProtocol writeListBeginWithElementType: TType_STRUCT size: [__searches count]]; + int i34; + for (i34 = 0; i34 < [__searches count]; i34++) + { + [[__searches objectAtIndex: i34] write: outProtocol]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + if (__resources_isset) { + if (__resources != nil) { + [outProtocol writeFieldBeginWithName: @"resources" type: TType_LIST fieldID: 8]; + { + [outProtocol writeListBeginWithElementType: TType_STRUCT size: [__resources count]]; + int i36; + for (i36 = 0; i36 < [__resources count]; i36++) + { + [[__resources objectAtIndex: i36] write: outProtocol]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + if (__expungedNotes_isset) { + if (__expungedNotes != nil) { + [outProtocol writeFieldBeginWithName: @"expungedNotes" type: TType_LIST fieldID: 9]; + { + [outProtocol writeListBeginWithElementType: TType_STRING size: [__expungedNotes count]]; + int i38; + for (i38 = 0; i38 < [__expungedNotes count]; i38++) + { + [outProtocol writeString: [__expungedNotes objectAtIndex: i38]]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + if (__expungedNotebooks_isset) { + if (__expungedNotebooks != nil) { + [outProtocol writeFieldBeginWithName: @"expungedNotebooks" type: TType_LIST fieldID: 10]; + { + [outProtocol writeListBeginWithElementType: TType_STRING size: [__expungedNotebooks count]]; + int i40; + for (i40 = 0; i40 < [__expungedNotebooks count]; i40++) + { + [outProtocol writeString: [__expungedNotebooks objectAtIndex: i40]]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + if (__expungedTags_isset) { + if (__expungedTags != nil) { + [outProtocol writeFieldBeginWithName: @"expungedTags" type: TType_LIST fieldID: 11]; + { + [outProtocol writeListBeginWithElementType: TType_STRING size: [__expungedTags count]]; + int i42; + for (i42 = 0; i42 < [__expungedTags count]; i42++) + { + [outProtocol writeString: [__expungedTags objectAtIndex: i42]]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + if (__expungedSearches_isset) { + if (__expungedSearches != nil) { + [outProtocol writeFieldBeginWithName: @"expungedSearches" type: TType_LIST fieldID: 12]; + { + [outProtocol writeListBeginWithElementType: TType_STRING size: [__expungedSearches count]]; + int i44; + for (i44 = 0; i44 < [__expungedSearches count]; i44++) + { + [outProtocol writeString: [__expungedSearches objectAtIndex: i44]]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"SyncChunk("]; + [ms appendString: @"currentTime:"]; + [ms appendFormat: @"%qi", __currentTime]; + [ms appendString: @",chunkHighUSN:"]; + [ms appendFormat: @"%i", __chunkHighUSN]; + [ms appendString: @",updateCount:"]; + [ms appendFormat: @"%i", __updateCount]; + [ms appendString: @",notes:"]; + [ms appendFormat: @"%@", __notes]; + [ms appendString: @",notebooks:"]; + [ms appendFormat: @"%@", __notebooks]; + [ms appendString: @",tags:"]; + [ms appendFormat: @"%@", __tags]; + [ms appendString: @",searches:"]; + [ms appendFormat: @"%@", __searches]; + [ms appendString: @",resources:"]; + [ms appendFormat: @"%@", __resources]; + [ms appendString: @",expungedNotes:"]; + [ms appendFormat: @"%@", __expungedNotes]; + [ms appendString: @",expungedNotebooks:"]; + [ms appendFormat: @"%@", __expungedNotebooks]; + [ms appendString: @",expungedTags:"]; + [ms appendFormat: @"%@", __expungedTags]; + [ms appendString: @",expungedSearches:"]; + [ms appendFormat: @"%@", __expungedSearches]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMNoteFilter + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic order; +@dynamic ascending; +@dynamic words; +@dynamic notebookGuid; +@dynamic tagGuids; +@dynamic timeZone; +@dynamic inactive; +#endif + +- (id) initWithOrder: (int32_t) order ascending: (BOOL) ascending words: (NSString *) words notebookGuid: (EDAMGuid) notebookGuid tagGuids: (NSArray *) tagGuids timeZone: (NSString *) timeZone inactive: (BOOL) inactive +{ + self = [super init]; + __order = order; + __order_isset = YES; + __ascending = ascending; + __ascending_isset = YES; + __words = [words retain]; + __words_isset = YES; + __notebookGuid = [notebookGuid retain]; + __notebookGuid_isset = YES; + __tagGuids = [tagGuids retain]; + __tagGuids_isset = YES; + __timeZone = [timeZone retain]; + __timeZone_isset = YES; + __inactive = inactive; + __inactive_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"order"]) + { + __order = [decoder decodeInt32ForKey: @"order"]; + __order_isset = YES; + } + if ([decoder containsValueForKey: @"ascending"]) + { + __ascending = [decoder decodeBoolForKey: @"ascending"]; + __ascending_isset = YES; + } + if ([decoder containsValueForKey: @"words"]) + { + __words = [[decoder decodeObjectForKey: @"words"] retain]; + __words_isset = YES; + } + if ([decoder containsValueForKey: @"notebookGuid"]) + { + __notebookGuid = [[decoder decodeObjectForKey: @"notebookGuid"] retain]; + __notebookGuid_isset = YES; + } + if ([decoder containsValueForKey: @"tagGuids"]) + { + __tagGuids = [[decoder decodeObjectForKey: @"tagGuids"] retain]; + __tagGuids_isset = YES; + } + if ([decoder containsValueForKey: @"timeZone"]) + { + __timeZone = [[decoder decodeObjectForKey: @"timeZone"] retain]; + __timeZone_isset = YES; + } + if ([decoder containsValueForKey: @"inactive"]) + { + __inactive = [decoder decodeBoolForKey: @"inactive"]; + __inactive_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__order_isset) + { + [encoder encodeInt32: __order forKey: @"order"]; + } + if (__ascending_isset) + { + [encoder encodeBool: __ascending forKey: @"ascending"]; + } + if (__words_isset) + { + [encoder encodeObject: __words forKey: @"words"]; + } + if (__notebookGuid_isset) + { + [encoder encodeObject: __notebookGuid forKey: @"notebookGuid"]; + } + if (__tagGuids_isset) + { + [encoder encodeObject: __tagGuids forKey: @"tagGuids"]; + } + if (__timeZone_isset) + { + [encoder encodeObject: __timeZone forKey: @"timeZone"]; + } + if (__inactive_isset) + { + [encoder encodeBool: __inactive forKey: @"inactive"]; + } +} + +- (void) dealloc +{ + [__words release]; + [__notebookGuid release]; + [__tagGuids release]; + [__timeZone release]; + [super dealloc]; +} + +- (int32_t) order { + return __order; +} + +- (void) setOrder: (int32_t) order { + __order = order; + __order_isset = YES; +} + +- (BOOL) orderIsSet { + return __order_isset; +} + +- (void) unsetOrder { + __order_isset = NO; +} + +- (BOOL) ascending { + return __ascending; +} + +- (void) setAscending: (BOOL) ascending { + __ascending = ascending; + __ascending_isset = YES; +} + +- (BOOL) ascendingIsSet { + return __ascending_isset; +} + +- (void) unsetAscending { + __ascending_isset = NO; +} + +- (NSString *) words { + return [[__words retain] autorelease]; +} + +- (void) setWords: (NSString *) words { + [words retain]; + [__words release]; + __words = words; + __words_isset = YES; +} + +- (BOOL) wordsIsSet { + return __words_isset; +} + +- (void) unsetWords { + [__words release]; + __words = nil; + __words_isset = NO; +} + +- (NSString *) notebookGuid { + return [[__notebookGuid retain] autorelease]; +} + +- (void) setNotebookGuid: (NSString *) notebookGuid { + [notebookGuid retain]; + [__notebookGuid release]; + __notebookGuid = notebookGuid; + __notebookGuid_isset = YES; +} + +- (BOOL) notebookGuidIsSet { + return __notebookGuid_isset; +} + +- (void) unsetNotebookGuid { + [__notebookGuid release]; + __notebookGuid = nil; + __notebookGuid_isset = NO; +} + +- (NSArray *) tagGuids { + return [[__tagGuids retain] autorelease]; +} + +- (void) setTagGuids: (NSArray *) tagGuids { + [tagGuids retain]; + [__tagGuids release]; + __tagGuids = tagGuids; + __tagGuids_isset = YES; +} + +- (BOOL) tagGuidsIsSet { + return __tagGuids_isset; +} + +- (void) unsetTagGuids { + [__tagGuids release]; + __tagGuids = nil; + __tagGuids_isset = NO; +} + +- (NSString *) timeZone { + return [[__timeZone retain] autorelease]; +} + +- (void) setTimeZone: (NSString *) timeZone { + [timeZone retain]; + [__timeZone release]; + __timeZone = timeZone; + __timeZone_isset = YES; +} + +- (BOOL) timeZoneIsSet { + return __timeZone_isset; +} + +- (void) unsetTimeZone { + [__timeZone release]; + __timeZone = nil; + __timeZone_isset = NO; +} + +- (BOOL) inactive { + return __inactive; +} + +- (void) setInactive: (BOOL) inactive { + __inactive = inactive; + __inactive_isset = YES; +} + +- (BOOL) inactiveIsSet { + return __inactive_isset; +} + +- (void) unsetInactive { + __inactive_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setOrder: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setAscending: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setWords: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setNotebookGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 5: + if (fieldType == TType_LIST) { + int _size45; + [inProtocol readListBeginReturningElementType: NULL size: &_size45]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size45]; + int _i46; + for (_i46 = 0; _i46 < _size45; ++_i46) + { + NSString * _elem47 = [inProtocol readString]; + [fieldValue addObject: _elem47]; + } + [inProtocol readListEnd]; + [self setTagGuids: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 6: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setTimeZone: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 7: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setInactive: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"NoteFilter"]; + if (__order_isset) { + [outProtocol writeFieldBeginWithName: @"order" type: TType_I32 fieldID: 1]; + [outProtocol writeI32: __order]; + [outProtocol writeFieldEnd]; + } + if (__ascending_isset) { + [outProtocol writeFieldBeginWithName: @"ascending" type: TType_BOOL fieldID: 2]; + [outProtocol writeBool: __ascending]; + [outProtocol writeFieldEnd]; + } + if (__words_isset) { + if (__words != nil) { + [outProtocol writeFieldBeginWithName: @"words" type: TType_STRING fieldID: 3]; + [outProtocol writeString: __words]; + [outProtocol writeFieldEnd]; + } + } + if (__notebookGuid_isset) { + if (__notebookGuid != nil) { + [outProtocol writeFieldBeginWithName: @"notebookGuid" type: TType_STRING fieldID: 4]; + [outProtocol writeString: __notebookGuid]; + [outProtocol writeFieldEnd]; + } + } + if (__tagGuids_isset) { + if (__tagGuids != nil) { + [outProtocol writeFieldBeginWithName: @"tagGuids" type: TType_LIST fieldID: 5]; + { + [outProtocol writeListBeginWithElementType: TType_STRING size: [__tagGuids count]]; + int i49; + for (i49 = 0; i49 < [__tagGuids count]; i49++) + { + [outProtocol writeString: [__tagGuids objectAtIndex: i49]]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + if (__timeZone_isset) { + if (__timeZone != nil) { + [outProtocol writeFieldBeginWithName: @"timeZone" type: TType_STRING fieldID: 6]; + [outProtocol writeString: __timeZone]; + [outProtocol writeFieldEnd]; + } + } + if (__inactive_isset) { + [outProtocol writeFieldBeginWithName: @"inactive" type: TType_BOOL fieldID: 7]; + [outProtocol writeBool: __inactive]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"NoteFilter("]; + [ms appendString: @"order:"]; + [ms appendFormat: @"%i", __order]; + [ms appendString: @",ascending:"]; + [ms appendFormat: @"%i", __ascending]; + [ms appendString: @",words:"]; + [ms appendFormat: @"\"%@\"", __words]; + [ms appendString: @",notebookGuid:"]; + [ms appendFormat: @"\"%@\"", __notebookGuid]; + [ms appendString: @",tagGuids:"]; + [ms appendFormat: @"%@", __tagGuids]; + [ms appendString: @",timeZone:"]; + [ms appendFormat: @"\"%@\"", __timeZone]; + [ms appendString: @",inactive:"]; + [ms appendFormat: @"%i", __inactive]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMNoteList + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic startIndex; +@dynamic totalNotes; +@dynamic notes; +@dynamic stoppedWords; +@dynamic searchedWords; +#endif + +- (id) initWithStartIndex: (int32_t) startIndex totalNotes: (int32_t) totalNotes notes: (NSArray *) notes stoppedWords: (NSArray *) stoppedWords searchedWords: (NSArray *) searchedWords +{ + self = [super init]; + __startIndex = startIndex; + __startIndex_isset = YES; + __totalNotes = totalNotes; + __totalNotes_isset = YES; + __notes = [notes retain]; + __notes_isset = YES; + __stoppedWords = [stoppedWords retain]; + __stoppedWords_isset = YES; + __searchedWords = [searchedWords retain]; + __searchedWords_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"startIndex"]) + { + __startIndex = [decoder decodeInt32ForKey: @"startIndex"]; + __startIndex_isset = YES; + } + if ([decoder containsValueForKey: @"totalNotes"]) + { + __totalNotes = [decoder decodeInt32ForKey: @"totalNotes"]; + __totalNotes_isset = YES; + } + if ([decoder containsValueForKey: @"notes"]) + { + __notes = [[decoder decodeObjectForKey: @"notes"] retain]; + __notes_isset = YES; + } + if ([decoder containsValueForKey: @"stoppedWords"]) + { + __stoppedWords = [[decoder decodeObjectForKey: @"stoppedWords"] retain]; + __stoppedWords_isset = YES; + } + if ([decoder containsValueForKey: @"searchedWords"]) + { + __searchedWords = [[decoder decodeObjectForKey: @"searchedWords"] retain]; + __searchedWords_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__startIndex_isset) + { + [encoder encodeInt32: __startIndex forKey: @"startIndex"]; + } + if (__totalNotes_isset) + { + [encoder encodeInt32: __totalNotes forKey: @"totalNotes"]; + } + if (__notes_isset) + { + [encoder encodeObject: __notes forKey: @"notes"]; + } + if (__stoppedWords_isset) + { + [encoder encodeObject: __stoppedWords forKey: @"stoppedWords"]; + } + if (__searchedWords_isset) + { + [encoder encodeObject: __searchedWords forKey: @"searchedWords"]; + } +} + +- (void) dealloc +{ + [__notes release]; + [__stoppedWords release]; + [__searchedWords release]; + [super dealloc]; +} + +- (int32_t) startIndex { + return __startIndex; +} + +- (void) setStartIndex: (int32_t) startIndex { + __startIndex = startIndex; + __startIndex_isset = YES; +} + +- (BOOL) startIndexIsSet { + return __startIndex_isset; +} + +- (void) unsetStartIndex { + __startIndex_isset = NO; +} + +- (int32_t) totalNotes { + return __totalNotes; +} + +- (void) setTotalNotes: (int32_t) totalNotes { + __totalNotes = totalNotes; + __totalNotes_isset = YES; +} + +- (BOOL) totalNotesIsSet { + return __totalNotes_isset; +} + +- (void) unsetTotalNotes { + __totalNotes_isset = NO; +} + +- (NSArray *) notes { + return [[__notes retain] autorelease]; +} + +- (void) setNotes: (NSArray *) notes { + [notes retain]; + [__notes release]; + __notes = notes; + __notes_isset = YES; +} + +- (BOOL) notesIsSet { + return __notes_isset; +} + +- (void) unsetNotes { + [__notes release]; + __notes = nil; + __notes_isset = NO; +} + +- (NSArray *) stoppedWords { + return [[__stoppedWords retain] autorelease]; +} + +- (void) setStoppedWords: (NSArray *) stoppedWords { + [stoppedWords retain]; + [__stoppedWords release]; + __stoppedWords = stoppedWords; + __stoppedWords_isset = YES; +} + +- (BOOL) stoppedWordsIsSet { + return __stoppedWords_isset; +} + +- (void) unsetStoppedWords { + [__stoppedWords release]; + __stoppedWords = nil; + __stoppedWords_isset = NO; +} + +- (NSArray *) searchedWords { + return [[__searchedWords retain] autorelease]; +} + +- (void) setSearchedWords: (NSArray *) searchedWords { + [searchedWords retain]; + [__searchedWords release]; + __searchedWords = searchedWords; + __searchedWords_isset = YES; +} + +- (BOOL) searchedWordsIsSet { + return __searchedWords_isset; +} + +- (void) unsetSearchedWords { + [__searchedWords release]; + __searchedWords = nil; + __searchedWords_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setStartIndex: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setTotalNotes: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_LIST) { + int _size50; + [inProtocol readListBeginReturningElementType: NULL size: &_size50]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size50]; + int _i51; + for (_i51 = 0; _i51 < _size50; ++_i51) + { + EDAMNote *_elem52 = [[EDAMNote alloc] init]; + [_elem52 read: inProtocol]; + [fieldValue addObject: _elem52]; + [_elem52 release]; + } + [inProtocol readListEnd]; + [self setNotes: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_LIST) { + int _size53; + [inProtocol readListBeginReturningElementType: NULL size: &_size53]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size53]; + int _i54; + for (_i54 = 0; _i54 < _size53; ++_i54) + { + NSString * _elem55 = [inProtocol readString]; + [fieldValue addObject: _elem55]; + } + [inProtocol readListEnd]; + [self setStoppedWords: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 5: + if (fieldType == TType_LIST) { + int _size56; + [inProtocol readListBeginReturningElementType: NULL size: &_size56]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size56]; + int _i57; + for (_i57 = 0; _i57 < _size56; ++_i57) + { + NSString * _elem58 = [inProtocol readString]; + [fieldValue addObject: _elem58]; + } + [inProtocol readListEnd]; + [self setSearchedWords: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"NoteList"]; + if (__startIndex_isset) { + [outProtocol writeFieldBeginWithName: @"startIndex" type: TType_I32 fieldID: 1]; + [outProtocol writeI32: __startIndex]; + [outProtocol writeFieldEnd]; + } + if (__totalNotes_isset) { + [outProtocol writeFieldBeginWithName: @"totalNotes" type: TType_I32 fieldID: 2]; + [outProtocol writeI32: __totalNotes]; + [outProtocol writeFieldEnd]; + } + if (__notes_isset) { + if (__notes != nil) { + [outProtocol writeFieldBeginWithName: @"notes" type: TType_LIST fieldID: 3]; + { + [outProtocol writeListBeginWithElementType: TType_STRUCT size: [__notes count]]; + int i60; + for (i60 = 0; i60 < [__notes count]; i60++) + { + [[__notes objectAtIndex: i60] write: outProtocol]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + if (__stoppedWords_isset) { + if (__stoppedWords != nil) { + [outProtocol writeFieldBeginWithName: @"stoppedWords" type: TType_LIST fieldID: 4]; + { + [outProtocol writeListBeginWithElementType: TType_STRING size: [__stoppedWords count]]; + int i62; + for (i62 = 0; i62 < [__stoppedWords count]; i62++) + { + [outProtocol writeString: [__stoppedWords objectAtIndex: i62]]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + if (__searchedWords_isset) { + if (__searchedWords != nil) { + [outProtocol writeFieldBeginWithName: @"searchedWords" type: TType_LIST fieldID: 5]; + { + [outProtocol writeListBeginWithElementType: TType_STRING size: [__searchedWords count]]; + int i64; + for (i64 = 0; i64 < [__searchedWords count]; i64++) + { + [outProtocol writeString: [__searchedWords objectAtIndex: i64]]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"NoteList("]; + [ms appendString: @"startIndex:"]; + [ms appendFormat: @"%i", __startIndex]; + [ms appendString: @",totalNotes:"]; + [ms appendFormat: @"%i", __totalNotes]; + [ms appendString: @",notes:"]; + [ms appendFormat: @"%@", __notes]; + [ms appendString: @",stoppedWords:"]; + [ms appendFormat: @"%@", __stoppedWords]; + [ms appendString: @",searchedWords:"]; + [ms appendFormat: @"%@", __searchedWords]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMNoteCollectionCounts + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic notebookCounts; +@dynamic tagCounts; +@dynamic trashCount; +#endif + +- (id) initWithNotebookCounts: (NSDictionary *) notebookCounts tagCounts: (NSDictionary *) tagCounts trashCount: (int32_t) trashCount +{ + self = [super init]; + __notebookCounts = [notebookCounts retain]; + __notebookCounts_isset = YES; + __tagCounts = [tagCounts retain]; + __tagCounts_isset = YES; + __trashCount = trashCount; + __trashCount_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"notebookCounts"]) + { + __notebookCounts = [[decoder decodeObjectForKey: @"notebookCounts"] retain]; + __notebookCounts_isset = YES; + } + if ([decoder containsValueForKey: @"tagCounts"]) + { + __tagCounts = [[decoder decodeObjectForKey: @"tagCounts"] retain]; + __tagCounts_isset = YES; + } + if ([decoder containsValueForKey: @"trashCount"]) + { + __trashCount = [decoder decodeInt32ForKey: @"trashCount"]; + __trashCount_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__notebookCounts_isset) + { + [encoder encodeObject: __notebookCounts forKey: @"notebookCounts"]; + } + if (__tagCounts_isset) + { + [encoder encodeObject: __tagCounts forKey: @"tagCounts"]; + } + if (__trashCount_isset) + { + [encoder encodeInt32: __trashCount forKey: @"trashCount"]; + } +} + +- (void) dealloc +{ + [__notebookCounts release]; + [__tagCounts release]; + [super dealloc]; +} + +- (NSDictionary *) notebookCounts { + return [[__notebookCounts retain] autorelease]; +} + +- (void) setNotebookCounts: (NSDictionary *) notebookCounts { + [notebookCounts retain]; + [__notebookCounts release]; + __notebookCounts = notebookCounts; + __notebookCounts_isset = YES; +} + +- (BOOL) notebookCountsIsSet { + return __notebookCounts_isset; +} + +- (void) unsetNotebookCounts { + [__notebookCounts release]; + __notebookCounts = nil; + __notebookCounts_isset = NO; +} + +- (NSDictionary *) tagCounts { + return [[__tagCounts retain] autorelease]; +} + +- (void) setTagCounts: (NSDictionary *) tagCounts { + [tagCounts retain]; + [__tagCounts release]; + __tagCounts = tagCounts; + __tagCounts_isset = YES; +} + +- (BOOL) tagCountsIsSet { + return __tagCounts_isset; +} + +- (void) unsetTagCounts { + [__tagCounts release]; + __tagCounts = nil; + __tagCounts_isset = NO; +} + +- (int32_t) trashCount { + return __trashCount; +} + +- (void) setTrashCount: (int32_t) trashCount { + __trashCount = trashCount; + __trashCount_isset = YES; +} + +- (BOOL) trashCountIsSet { + return __trashCount_isset; +} + +- (void) unsetTrashCount { + __trashCount_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_MAP) { + int _size65; + [inProtocol readMapBeginReturningKeyType: NULL valueType: NULL size: &_size65]; + NSMutableDictionary * fieldValue = [[NSMutableDictionary alloc] initWithCapacity: _size65]; + int _i66; + for (_i66 = 0; _i66 < _size65; ++_i66) + { + NSString * _key67 = [inProtocol readString]; + int32_t _val68 = [inProtocol readI32]; + [fieldValue setObject: [NSNumber numberWithLong: _val68] forKey: _key67]; + } + [inProtocol readMapEnd]; + [self setNotebookCounts: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_MAP) { + int _size69; + [inProtocol readMapBeginReturningKeyType: NULL valueType: NULL size: &_size69]; + NSMutableDictionary * fieldValue = [[NSMutableDictionary alloc] initWithCapacity: _size69]; + int _i70; + for (_i70 = 0; _i70 < _size69; ++_i70) + { + NSString * _key71 = [inProtocol readString]; + int32_t _val72 = [inProtocol readI32]; + [fieldValue setObject: [NSNumber numberWithLong: _val72] forKey: _key71]; + } + [inProtocol readMapEnd]; + [self setTagCounts: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setTrashCount: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"NoteCollectionCounts"]; + if (__notebookCounts_isset) { + if (__notebookCounts != nil) { + [outProtocol writeFieldBeginWithName: @"notebookCounts" type: TType_MAP fieldID: 1]; + { + [outProtocol writeMapBeginWithKeyType: TType_STRING valueType: TType_I32 size: [__notebookCounts count]]; + NSEnumerator * _iter73 = [__notebookCounts keyEnumerator]; + id key74; + while ((key74 = [_iter73 nextObject])) + { + [outProtocol writeString: key74]; + [outProtocol writeI32: [[__notebookCounts objectForKey: key74] longValue]]; + } + [outProtocol writeMapEnd]; + } + [outProtocol writeFieldEnd]; + } + } + if (__tagCounts_isset) { + if (__tagCounts != nil) { + [outProtocol writeFieldBeginWithName: @"tagCounts" type: TType_MAP fieldID: 2]; + { + [outProtocol writeMapBeginWithKeyType: TType_STRING valueType: TType_I32 size: [__tagCounts count]]; + NSEnumerator * _iter75 = [__tagCounts keyEnumerator]; + id key76; + while ((key76 = [_iter75 nextObject])) + { + [outProtocol writeString: key76]; + [outProtocol writeI32: [[__tagCounts objectForKey: key76] longValue]]; + } + [outProtocol writeMapEnd]; + } + [outProtocol writeFieldEnd]; + } + } + if (__trashCount_isset) { + [outProtocol writeFieldBeginWithName: @"trashCount" type: TType_I32 fieldID: 3]; + [outProtocol writeI32: __trashCount]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"NoteCollectionCounts("]; + [ms appendString: @"notebookCounts:"]; + [ms appendFormat: @"%@", __notebookCounts]; + [ms appendString: @",tagCounts:"]; + [ms appendFormat: @"%@", __tagCounts]; + [ms appendString: @",trashCount:"]; + [ms appendFormat: @"%i", __trashCount]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMAdImpressions + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic adId; +@dynamic impressionCount; +@dynamic impressionTime; +#endif + +- (id) initWithAdId: (int32_t) adId impressionCount: (int32_t) impressionCount impressionTime: (int32_t) impressionTime +{ + self = [super init]; + __adId = adId; + __adId_isset = YES; + __impressionCount = impressionCount; + __impressionCount_isset = YES; + __impressionTime = impressionTime; + __impressionTime_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"adId"]) + { + __adId = [decoder decodeInt32ForKey: @"adId"]; + __adId_isset = YES; + } + if ([decoder containsValueForKey: @"impressionCount"]) + { + __impressionCount = [decoder decodeInt32ForKey: @"impressionCount"]; + __impressionCount_isset = YES; + } + if ([decoder containsValueForKey: @"impressionTime"]) + { + __impressionTime = [decoder decodeInt32ForKey: @"impressionTime"]; + __impressionTime_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__adId_isset) + { + [encoder encodeInt32: __adId forKey: @"adId"]; + } + if (__impressionCount_isset) + { + [encoder encodeInt32: __impressionCount forKey: @"impressionCount"]; + } + if (__impressionTime_isset) + { + [encoder encodeInt32: __impressionTime forKey: @"impressionTime"]; + } +} + +- (void) dealloc +{ + [super dealloc]; +} + +- (int32_t) adId { + return __adId; +} + +- (void) setAdId: (int32_t) adId { + __adId = adId; + __adId_isset = YES; +} + +- (BOOL) adIdIsSet { + return __adId_isset; +} + +- (void) unsetAdId { + __adId_isset = NO; +} + +- (int32_t) impressionCount { + return __impressionCount; +} + +- (void) setImpressionCount: (int32_t) impressionCount { + __impressionCount = impressionCount; + __impressionCount_isset = YES; +} + +- (BOOL) impressionCountIsSet { + return __impressionCount_isset; +} + +- (void) unsetImpressionCount { + __impressionCount_isset = NO; +} + +- (int32_t) impressionTime { + return __impressionTime; +} + +- (void) setImpressionTime: (int32_t) impressionTime { + __impressionTime = impressionTime; + __impressionTime_isset = YES; +} + +- (BOOL) impressionTimeIsSet { + return __impressionTime_isset; +} + +- (void) unsetImpressionTime { + __impressionTime_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setAdId: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setImpressionCount: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setImpressionTime: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"AdImpressions"]; + if (__adId_isset) { + [outProtocol writeFieldBeginWithName: @"adId" type: TType_I32 fieldID: 1]; + [outProtocol writeI32: __adId]; + [outProtocol writeFieldEnd]; + } + if (__impressionCount_isset) { + [outProtocol writeFieldBeginWithName: @"impressionCount" type: TType_I32 fieldID: 2]; + [outProtocol writeI32: __impressionCount]; + [outProtocol writeFieldEnd]; + } + if (__impressionTime_isset) { + [outProtocol writeFieldBeginWithName: @"impressionTime" type: TType_I32 fieldID: 3]; + [outProtocol writeI32: __impressionTime]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"AdImpressions("]; + [ms appendString: @"adId:"]; + [ms appendFormat: @"%i", __adId]; + [ms appendString: @",impressionCount:"]; + [ms appendFormat: @"%i", __impressionCount]; + [ms appendString: @",impressionTime:"]; + [ms appendFormat: @"%i", __impressionTime]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMAdParameters + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic clientLanguage; +@dynamic impressions; +@dynamic supportHtml; +@dynamic clientProperties; +#endif + +- (id) initWithClientLanguage: (NSString *) clientLanguage impressions: (NSArray *) impressions supportHtml: (BOOL) supportHtml clientProperties: (NSDictionary *) clientProperties +{ + self = [super init]; + __clientLanguage = [clientLanguage retain]; + __clientLanguage_isset = YES; + __impressions = [impressions retain]; + __impressions_isset = YES; + __supportHtml = supportHtml; + __supportHtml_isset = YES; + __clientProperties = [clientProperties retain]; + __clientProperties_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"clientLanguage"]) + { + __clientLanguage = [[decoder decodeObjectForKey: @"clientLanguage"] retain]; + __clientLanguage_isset = YES; + } + if ([decoder containsValueForKey: @"impressions"]) + { + __impressions = [[decoder decodeObjectForKey: @"impressions"] retain]; + __impressions_isset = YES; + } + if ([decoder containsValueForKey: @"supportHtml"]) + { + __supportHtml = [decoder decodeBoolForKey: @"supportHtml"]; + __supportHtml_isset = YES; + } + if ([decoder containsValueForKey: @"clientProperties"]) + { + __clientProperties = [[decoder decodeObjectForKey: @"clientProperties"] retain]; + __clientProperties_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__clientLanguage_isset) + { + [encoder encodeObject: __clientLanguage forKey: @"clientLanguage"]; + } + if (__impressions_isset) + { + [encoder encodeObject: __impressions forKey: @"impressions"]; + } + if (__supportHtml_isset) + { + [encoder encodeBool: __supportHtml forKey: @"supportHtml"]; + } + if (__clientProperties_isset) + { + [encoder encodeObject: __clientProperties forKey: @"clientProperties"]; + } +} + +- (void) dealloc +{ + [__clientLanguage release]; + [__impressions release]; + [__clientProperties release]; + [super dealloc]; +} + +- (NSString *) clientLanguage { + return [[__clientLanguage retain] autorelease]; +} + +- (void) setClientLanguage: (NSString *) clientLanguage { + [clientLanguage retain]; + [__clientLanguage release]; + __clientLanguage = clientLanguage; + __clientLanguage_isset = YES; +} + +- (BOOL) clientLanguageIsSet { + return __clientLanguage_isset; +} + +- (void) unsetClientLanguage { + [__clientLanguage release]; + __clientLanguage = nil; + __clientLanguage_isset = NO; +} + +- (NSArray *) impressions { + return [[__impressions retain] autorelease]; +} + +- (void) setImpressions: (NSArray *) impressions { + [impressions retain]; + [__impressions release]; + __impressions = impressions; + __impressions_isset = YES; +} + +- (BOOL) impressionsIsSet { + return __impressions_isset; +} + +- (void) unsetImpressions { + [__impressions release]; + __impressions = nil; + __impressions_isset = NO; +} + +- (BOOL) supportHtml { + return __supportHtml; +} + +- (void) setSupportHtml: (BOOL) supportHtml { + __supportHtml = supportHtml; + __supportHtml_isset = YES; +} + +- (BOOL) supportHtmlIsSet { + return __supportHtml_isset; +} + +- (void) unsetSupportHtml { + __supportHtml_isset = NO; +} + +- (NSDictionary *) clientProperties { + return [[__clientProperties retain] autorelease]; +} + +- (void) setClientProperties: (NSDictionary *) clientProperties { + [clientProperties retain]; + [__clientProperties release]; + __clientProperties = clientProperties; + __clientProperties_isset = YES; +} + +- (BOOL) clientPropertiesIsSet { + return __clientProperties_isset; +} + +- (void) unsetClientProperties { + [__clientProperties release]; + __clientProperties = nil; + __clientProperties_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setClientLanguage: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_LIST) { + int _size77; + [inProtocol readListBeginReturningElementType: NULL size: &_size77]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size77]; + int _i78; + for (_i78 = 0; _i78 < _size77; ++_i78) + { + EDAMAdImpressions *_elem79 = [[EDAMAdImpressions alloc] init]; + [_elem79 read: inProtocol]; + [fieldValue addObject: _elem79]; + [_elem79 release]; + } + [inProtocol readListEnd]; + [self setImpressions: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 5: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setSupportHtml: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 6: + if (fieldType == TType_MAP) { + int _size80; + [inProtocol readMapBeginReturningKeyType: NULL valueType: NULL size: &_size80]; + NSMutableDictionary * fieldValue = [[NSMutableDictionary alloc] initWithCapacity: _size80]; + int _i81; + for (_i81 = 0; _i81 < _size80; ++_i81) + { + NSString * _key82 = [inProtocol readString]; + NSString * _val83 = [inProtocol readString]; + [fieldValue setObject: _val83 forKey: _key82]; + } + [inProtocol readMapEnd]; + [self setClientProperties: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"AdParameters"]; + if (__clientLanguage_isset) { + if (__clientLanguage != nil) { + [outProtocol writeFieldBeginWithName: @"clientLanguage" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __clientLanguage]; + [outProtocol writeFieldEnd]; + } + } + if (__impressions_isset) { + if (__impressions != nil) { + [outProtocol writeFieldBeginWithName: @"impressions" type: TType_LIST fieldID: 4]; + { + [outProtocol writeListBeginWithElementType: TType_STRUCT size: [__impressions count]]; + int i85; + for (i85 = 0; i85 < [__impressions count]; i85++) + { + [[__impressions objectAtIndex: i85] write: outProtocol]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + if (__supportHtml_isset) { + [outProtocol writeFieldBeginWithName: @"supportHtml" type: TType_BOOL fieldID: 5]; + [outProtocol writeBool: __supportHtml]; + [outProtocol writeFieldEnd]; + } + if (__clientProperties_isset) { + if (__clientProperties != nil) { + [outProtocol writeFieldBeginWithName: @"clientProperties" type: TType_MAP fieldID: 6]; + { + [outProtocol writeMapBeginWithKeyType: TType_STRING valueType: TType_STRING size: [__clientProperties count]]; + NSEnumerator * _iter86 = [__clientProperties keyEnumerator]; + id key87; + while ((key87 = [_iter86 nextObject])) + { + [outProtocol writeString: key87]; + [outProtocol writeString: [__clientProperties objectForKey: key87]]; + } + [outProtocol writeMapEnd]; + } + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"AdParameters("]; + [ms appendString: @"clientLanguage:"]; + [ms appendFormat: @"\"%@\"", __clientLanguage]; + [ms appendString: @",impressions:"]; + [ms appendFormat: @"%@", __impressions]; + [ms appendString: @",supportHtml:"]; + [ms appendFormat: @"%i", __supportHtml]; + [ms appendString: @",clientProperties:"]; + [ms appendFormat: @"%@", __clientProperties]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMNoteEmailParameters + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic guid; +@dynamic note; +@dynamic toAddresses; +@dynamic ccAddresses; +@dynamic subject; +@dynamic message; +#endif + +- (id) initWithGuid: (NSString *) guid note: (EDAMNote *) note toAddresses: (NSArray *) toAddresses ccAddresses: (NSArray *) ccAddresses subject: (NSString *) subject message: (NSString *) message +{ + self = [super init]; + __guid = [guid retain]; + __guid_isset = YES; + __note = [note retain]; + __note_isset = YES; + __toAddresses = [toAddresses retain]; + __toAddresses_isset = YES; + __ccAddresses = [ccAddresses retain]; + __ccAddresses_isset = YES; + __subject = [subject retain]; + __subject_isset = YES; + __message = [message retain]; + __message_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + if ([decoder containsValueForKey: @"note"]) + { + __note = [[decoder decodeObjectForKey: @"note"] retain]; + __note_isset = YES; + } + if ([decoder containsValueForKey: @"toAddresses"]) + { + __toAddresses = [[decoder decodeObjectForKey: @"toAddresses"] retain]; + __toAddresses_isset = YES; + } + if ([decoder containsValueForKey: @"ccAddresses"]) + { + __ccAddresses = [[decoder decodeObjectForKey: @"ccAddresses"] retain]; + __ccAddresses_isset = YES; + } + if ([decoder containsValueForKey: @"subject"]) + { + __subject = [[decoder decodeObjectForKey: @"subject"] retain]; + __subject_isset = YES; + } + if ([decoder containsValueForKey: @"message"]) + { + __message = [[decoder decodeObjectForKey: @"message"] retain]; + __message_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } + if (__note_isset) + { + [encoder encodeObject: __note forKey: @"note"]; + } + if (__toAddresses_isset) + { + [encoder encodeObject: __toAddresses forKey: @"toAddresses"]; + } + if (__ccAddresses_isset) + { + [encoder encodeObject: __ccAddresses forKey: @"ccAddresses"]; + } + if (__subject_isset) + { + [encoder encodeObject: __subject forKey: @"subject"]; + } + if (__message_isset) + { + [encoder encodeObject: __message forKey: @"message"]; + } +} + +- (void) dealloc +{ + [__guid release]; + [__note release]; + [__toAddresses release]; + [__ccAddresses release]; + [__subject release]; + [__message release]; + [super dealloc]; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (EDAMNote *) note { + return [[__note retain] autorelease]; +} + +- (void) setNote: (EDAMNote *) note { + [note retain]; + [__note release]; + __note = note; + __note_isset = YES; +} + +- (BOOL) noteIsSet { + return __note_isset; +} + +- (void) unsetNote { + [__note release]; + __note = nil; + __note_isset = NO; +} + +- (NSArray *) toAddresses { + return [[__toAddresses retain] autorelease]; +} + +- (void) setToAddresses: (NSArray *) toAddresses { + [toAddresses retain]; + [__toAddresses release]; + __toAddresses = toAddresses; + __toAddresses_isset = YES; +} + +- (BOOL) toAddressesIsSet { + return __toAddresses_isset; +} + +- (void) unsetToAddresses { + [__toAddresses release]; + __toAddresses = nil; + __toAddresses_isset = NO; +} + +- (NSArray *) ccAddresses { + return [[__ccAddresses retain] autorelease]; +} + +- (void) setCcAddresses: (NSArray *) ccAddresses { + [ccAddresses retain]; + [__ccAddresses release]; + __ccAddresses = ccAddresses; + __ccAddresses_isset = YES; +} + +- (BOOL) ccAddressesIsSet { + return __ccAddresses_isset; +} + +- (void) unsetCcAddresses { + [__ccAddresses release]; + __ccAddresses = nil; + __ccAddresses_isset = NO; +} + +- (NSString *) subject { + return [[__subject retain] autorelease]; +} + +- (void) setSubject: (NSString *) subject { + [subject retain]; + [__subject release]; + __subject = subject; + __subject_isset = YES; +} + +- (BOOL) subjectIsSet { + return __subject_isset; +} + +- (void) unsetSubject { + [__subject release]; + __subject = nil; + __subject_isset = NO; +} + +- (NSString *) message { + return [[__message retain] autorelease]; +} + +- (void) setMessage: (NSString *) message { + [message retain]; + [__message release]; + __message = message; + __message_isset = YES; +} + +- (BOOL) messageIsSet { + return __message_isset; +} + +- (void) unsetMessage { + [__message release]; + __message = nil; + __message_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMNote *fieldValue = [[EDAMNote alloc] init]; + [fieldValue read: inProtocol]; + [self setNote: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_LIST) { + int _size88; + [inProtocol readListBeginReturningElementType: NULL size: &_size88]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size88]; + int _i89; + for (_i89 = 0; _i89 < _size88; ++_i89) + { + NSString * _elem90 = [inProtocol readString]; + [fieldValue addObject: _elem90]; + } + [inProtocol readListEnd]; + [self setToAddresses: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_LIST) { + int _size91; + [inProtocol readListBeginReturningElementType: NULL size: &_size91]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size91]; + int _i92; + for (_i92 = 0; _i92 < _size91; ++_i92) + { + NSString * _elem93 = [inProtocol readString]; + [fieldValue addObject: _elem93]; + } + [inProtocol readListEnd]; + [self setCcAddresses: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 5: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setSubject: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 6: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setMessage: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"NoteEmailParameters"]; + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + if (__note_isset) { + if (__note != nil) { + [outProtocol writeFieldBeginWithName: @"note" type: TType_STRUCT fieldID: 2]; + [__note write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + if (__toAddresses_isset) { + if (__toAddresses != nil) { + [outProtocol writeFieldBeginWithName: @"toAddresses" type: TType_LIST fieldID: 3]; + { + [outProtocol writeListBeginWithElementType: TType_STRING size: [__toAddresses count]]; + int i95; + for (i95 = 0; i95 < [__toAddresses count]; i95++) + { + [outProtocol writeString: [__toAddresses objectAtIndex: i95]]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + if (__ccAddresses_isset) { + if (__ccAddresses != nil) { + [outProtocol writeFieldBeginWithName: @"ccAddresses" type: TType_LIST fieldID: 4]; + { + [outProtocol writeListBeginWithElementType: TType_STRING size: [__ccAddresses count]]; + int i97; + for (i97 = 0; i97 < [__ccAddresses count]; i97++) + { + [outProtocol writeString: [__ccAddresses objectAtIndex: i97]]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + if (__subject_isset) { + if (__subject != nil) { + [outProtocol writeFieldBeginWithName: @"subject" type: TType_STRING fieldID: 5]; + [outProtocol writeString: __subject]; + [outProtocol writeFieldEnd]; + } + } + if (__message_isset) { + if (__message != nil) { + [outProtocol writeFieldBeginWithName: @"message" type: TType_STRING fieldID: 6]; + [outProtocol writeString: __message]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"NoteEmailParameters("]; + [ms appendString: @"guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @",note:"]; + [ms appendFormat: @"%@", __note]; + [ms appendString: @",toAddresses:"]; + [ms appendFormat: @"%@", __toAddresses]; + [ms appendString: @",ccAddresses:"]; + [ms appendFormat: @"%@", __ccAddresses]; + [ms appendString: @",subject:"]; + [ms appendFormat: @"\"%@\"", __subject]; + [ms appendString: @",message:"]; + [ms appendFormat: @"\"%@\"", __message]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMNoteVersionId + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic updateSequenceNum; +@dynamic updated; +@dynamic saved; +@dynamic title; +#endif + +- (id) initWithUpdateSequenceNum: (int32_t) updateSequenceNum updated: (EDAMTimestamp) updated saved: (EDAMTimestamp) saved title: (NSString *) title +{ + self = [super init]; + __updateSequenceNum = updateSequenceNum; + __updateSequenceNum_isset = YES; + __updated = updated; + __updated_isset = YES; + __saved = saved; + __saved_isset = YES; + __title = [title retain]; + __title_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"updateSequenceNum"]) + { + __updateSequenceNum = [decoder decodeInt32ForKey: @"updateSequenceNum"]; + __updateSequenceNum_isset = YES; + } + if ([decoder containsValueForKey: @"updated"]) + { + __updated = [decoder decodeInt64ForKey: @"updated"]; + __updated_isset = YES; + } + if ([decoder containsValueForKey: @"saved"]) + { + __saved = [decoder decodeInt64ForKey: @"saved"]; + __saved_isset = YES; + } + if ([decoder containsValueForKey: @"title"]) + { + __title = [[decoder decodeObjectForKey: @"title"] retain]; + __title_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__updateSequenceNum_isset) + { + [encoder encodeInt32: __updateSequenceNum forKey: @"updateSequenceNum"]; + } + if (__updated_isset) + { + [encoder encodeInt64: __updated forKey: @"updated"]; + } + if (__saved_isset) + { + [encoder encodeInt64: __saved forKey: @"saved"]; + } + if (__title_isset) + { + [encoder encodeObject: __title forKey: @"title"]; + } +} + +- (void) dealloc +{ + [__title release]; + [super dealloc]; +} + +- (int32_t) updateSequenceNum { + return __updateSequenceNum; +} + +- (void) setUpdateSequenceNum: (int32_t) updateSequenceNum { + __updateSequenceNum = updateSequenceNum; + __updateSequenceNum_isset = YES; +} + +- (BOOL) updateSequenceNumIsSet { + return __updateSequenceNum_isset; +} + +- (void) unsetUpdateSequenceNum { + __updateSequenceNum_isset = NO; +} + +- (int64_t) updated { + return __updated; +} + +- (void) setUpdated: (int64_t) updated { + __updated = updated; + __updated_isset = YES; +} + +- (BOOL) updatedIsSet { + return __updated_isset; +} + +- (void) unsetUpdated { + __updated_isset = NO; +} + +- (int64_t) saved { + return __saved; +} + +- (void) setSaved: (int64_t) saved { + __saved = saved; + __saved_isset = YES; +} + +- (BOOL) savedIsSet { + return __saved_isset; +} + +- (void) unsetSaved { + __saved_isset = NO; +} + +- (NSString *) title { + return [[__title retain] autorelease]; +} + +- (void) setTitle: (NSString *) title { + [title retain]; + [__title release]; + __title = title; + __title_isset = YES; +} + +- (BOOL) titleIsSet { + return __title_isset; +} + +- (void) unsetTitle { + [__title release]; + __title = nil; + __title_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setUpdateSequenceNum: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setUpdated: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setSaved: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setTitle: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"NoteVersionId"]; + if (__updateSequenceNum_isset) { + [outProtocol writeFieldBeginWithName: @"updateSequenceNum" type: TType_I32 fieldID: 1]; + [outProtocol writeI32: __updateSequenceNum]; + [outProtocol writeFieldEnd]; + } + if (__updated_isset) { + [outProtocol writeFieldBeginWithName: @"updated" type: TType_I64 fieldID: 2]; + [outProtocol writeI64: __updated]; + [outProtocol writeFieldEnd]; + } + if (__saved_isset) { + [outProtocol writeFieldBeginWithName: @"saved" type: TType_I64 fieldID: 3]; + [outProtocol writeI64: __saved]; + [outProtocol writeFieldEnd]; + } + if (__title_isset) { + if (__title != nil) { + [outProtocol writeFieldBeginWithName: @"title" type: TType_STRING fieldID: 4]; + [outProtocol writeString: __title]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"NoteVersionId("]; + [ms appendString: @"updateSequenceNum:"]; + [ms appendFormat: @"%i", __updateSequenceNum]; + [ms appendString: @",updated:"]; + [ms appendFormat: @"%qi", __updated]; + [ms appendString: @",saved:"]; + [ms appendFormat: @"%qi", __saved]; + [ms appendString: @",title:"]; + [ms appendFormat: @"\"%@\"", __title]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetSyncState_args : NSObject { + NSString * __authenticationToken; + + BOOL __authenticationToken_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +@end + +@implementation EDAMgetSyncState_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getSyncState_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getSyncState_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetSyncState_result : NSObject { + EDAMSyncState * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMSyncState * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (EDAMSyncState *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMSyncState *) success; +- (void) setSuccess: (EDAMSyncState *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMGetSyncState_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (EDAMSyncState *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [super dealloc]; +} + +- (EDAMSyncState *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMSyncState *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMSyncState *fieldValue = [[EDAMSyncState alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetSyncState_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetSyncState_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetSyncChunk_args : NSObject { + NSString * __authenticationToken; + int32_t __afterUSN; + int32_t __maxEntries; + BOOL __fullSyncOnly; + + BOOL __authenticationToken_isset; + BOOL __afterUSN_isset; + BOOL __maxEntries_isset; + BOOL __fullSyncOnly_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, getter=afterUSN, setter=setAfterUSN:) int32_t afterUSN; +@property (nonatomic, getter=maxEntries, setter=setMaxEntries:) int32_t maxEntries; +@property (nonatomic, getter=fullSyncOnly, setter=setFullSyncOnly:) BOOL fullSyncOnly; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken afterUSN: (int32_t) afterUSN maxEntries: (int32_t) maxEntries fullSyncOnly: (BOOL) fullSyncOnly; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (int32_t) afterUSN; +- (void) setAfterUSN: (int32_t) afterUSN; +- (BOOL) afterUSNIsSet; + +- (int32_t) maxEntries; +- (void) setMaxEntries: (int32_t) maxEntries; +- (BOOL) maxEntriesIsSet; + +- (BOOL) fullSyncOnly; +- (void) setFullSyncOnly: (BOOL) fullSyncOnly; +- (BOOL) fullSyncOnlyIsSet; + +@end + +@implementation EDAMgetSyncChunk_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic afterUSN; +@dynamic maxEntries; +@dynamic fullSyncOnly; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken afterUSN: (int32_t) afterUSN maxEntries: (int32_t) maxEntries fullSyncOnly: (BOOL) fullSyncOnly +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __afterUSN = afterUSN; + __afterUSN_isset = YES; + __maxEntries = maxEntries; + __maxEntries_isset = YES; + __fullSyncOnly = fullSyncOnly; + __fullSyncOnly_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"afterUSN"]) + { + __afterUSN = [decoder decodeInt32ForKey: @"afterUSN"]; + __afterUSN_isset = YES; + } + if ([decoder containsValueForKey: @"maxEntries"]) + { + __maxEntries = [decoder decodeInt32ForKey: @"maxEntries"]; + __maxEntries_isset = YES; + } + if ([decoder containsValueForKey: @"fullSyncOnly"]) + { + __fullSyncOnly = [decoder decodeBoolForKey: @"fullSyncOnly"]; + __fullSyncOnly_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__afterUSN_isset) + { + [encoder encodeInt32: __afterUSN forKey: @"afterUSN"]; + } + if (__maxEntries_isset) + { + [encoder encodeInt32: __maxEntries forKey: @"maxEntries"]; + } + if (__fullSyncOnly_isset) + { + [encoder encodeBool: __fullSyncOnly forKey: @"fullSyncOnly"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (int32_t) afterUSN { + return __afterUSN; +} + +- (void) setAfterUSN: (int32_t) afterUSN { + __afterUSN = afterUSN; + __afterUSN_isset = YES; +} + +- (BOOL) afterUSNIsSet { + return __afterUSN_isset; +} + +- (void) unsetAfterUSN { + __afterUSN_isset = NO; +} + +- (int32_t) maxEntries { + return __maxEntries; +} + +- (void) setMaxEntries: (int32_t) maxEntries { + __maxEntries = maxEntries; + __maxEntries_isset = YES; +} + +- (BOOL) maxEntriesIsSet { + return __maxEntries_isset; +} + +- (void) unsetMaxEntries { + __maxEntries_isset = NO; +} + +- (BOOL) fullSyncOnly { + return __fullSyncOnly; +} + +- (void) setFullSyncOnly: (BOOL) fullSyncOnly { + __fullSyncOnly = fullSyncOnly; + __fullSyncOnly_isset = YES; +} + +- (BOOL) fullSyncOnlyIsSet { + return __fullSyncOnly_isset; +} + +- (void) unsetFullSyncOnly { + __fullSyncOnly_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setAfterUSN: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setMaxEntries: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setFullSyncOnly: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getSyncChunk_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__afterUSN_isset) { + [outProtocol writeFieldBeginWithName: @"afterUSN" type: TType_I32 fieldID: 2]; + [outProtocol writeI32: __afterUSN]; + [outProtocol writeFieldEnd]; + } + if (__maxEntries_isset) { + [outProtocol writeFieldBeginWithName: @"maxEntries" type: TType_I32 fieldID: 3]; + [outProtocol writeI32: __maxEntries]; + [outProtocol writeFieldEnd]; + } + if (__fullSyncOnly_isset) { + [outProtocol writeFieldBeginWithName: @"fullSyncOnly" type: TType_BOOL fieldID: 4]; + [outProtocol writeBool: __fullSyncOnly]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getSyncChunk_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",afterUSN:"]; + [ms appendFormat: @"%i", __afterUSN]; + [ms appendString: @",maxEntries:"]; + [ms appendFormat: @"%i", __maxEntries]; + [ms appendString: @",fullSyncOnly:"]; + [ms appendFormat: @"%i", __fullSyncOnly]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetSyncChunk_result : NSObject { + EDAMSyncChunk * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMSyncChunk * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (EDAMSyncChunk *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMSyncChunk *) success; +- (void) setSuccess: (EDAMSyncChunk *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMGetSyncChunk_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (EDAMSyncChunk *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [super dealloc]; +} + +- (EDAMSyncChunk *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMSyncChunk *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMSyncChunk *fieldValue = [[EDAMSyncChunk alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetSyncChunk_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetSyncChunk_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMlistNotebooks_args : NSObject { + NSString * __authenticationToken; + + BOOL __authenticationToken_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +@end + +@implementation EDAMlistNotebooks_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"listNotebooks_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"listNotebooks_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMListNotebooks_result : NSObject { + NSArray * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) NSArray * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (NSArray *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSArray *) success; +- (void) setSuccess: (NSArray *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMListNotebooks_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (NSArray *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [super dealloc]; +} + +- (NSArray *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (NSArray *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_LIST) { + int _size98; + [inProtocol readListBeginReturningElementType: NULL size: &_size98]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size98]; + int _i99; + for (_i99 = 0; _i99 < _size98; ++_i99) + { + EDAMNotebook *_elem100 = [[EDAMNotebook alloc] init]; + [_elem100 read: inProtocol]; + [fieldValue addObject: _elem100]; + [_elem100 release]; + } + [inProtocol readListEnd]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"ListNotebooks_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_LIST fieldID: 0]; + { + [outProtocol writeListBeginWithElementType: TType_STRUCT size: [__success count]]; + int i102; + for (i102 = 0; i102 < [__success count]; i102++) + { + [[__success objectAtIndex: i102] write: outProtocol]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"ListNotebooks_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetNotebook_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __guid; + + BOOL __authenticationToken_isset; + BOOL __guid_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +@end + +@implementation EDAMgetNotebook_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __guid = [guid retain]; + __guid_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__guid release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getNotebook_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getNotebook_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetNotebook_result : NSObject { + EDAMNotebook * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMNotebook * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (EDAMNotebook *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMNotebook *) success; +- (void) setSuccess: (EDAMNotebook *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMGetNotebook_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (EDAMNotebook *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (EDAMNotebook *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMNotebook *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMNotebook *fieldValue = [[EDAMNotebook alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetNotebook_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetNotebook_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetDefaultNotebook_args : NSObject { + NSString * __authenticationToken; + + BOOL __authenticationToken_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +@end + +@implementation EDAMgetDefaultNotebook_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getDefaultNotebook_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getDefaultNotebook_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetDefaultNotebook_result : NSObject { + EDAMNotebook * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMNotebook * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (EDAMNotebook *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMNotebook *) success; +- (void) setSuccess: (EDAMNotebook *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMGetDefaultNotebook_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (EDAMNotebook *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [super dealloc]; +} + +- (EDAMNotebook *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMNotebook *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMNotebook *fieldValue = [[EDAMNotebook alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetDefaultNotebook_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetDefaultNotebook_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMcreateNotebook_args : NSObject { + NSString * __authenticationToken; + EDAMNotebook * __notebook; + + BOOL __authenticationToken_isset; + BOOL __notebook_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=notebook, setter=setNotebook:) EDAMNotebook * notebook; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken notebook: (EDAMNotebook *) notebook; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMNotebook *) notebook; +- (void) setNotebook: (EDAMNotebook *) notebook; +- (BOOL) notebookIsSet; + +@end + +@implementation EDAMcreateNotebook_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic notebook; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken notebook: (EDAMNotebook *) notebook +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __notebook = [notebook retain]; + __notebook_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"notebook"]) + { + __notebook = [[decoder decodeObjectForKey: @"notebook"] retain]; + __notebook_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__notebook_isset) + { + [encoder encodeObject: __notebook forKey: @"notebook"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__notebook release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (EDAMNotebook *) notebook { + return [[__notebook retain] autorelease]; +} + +- (void) setNotebook: (EDAMNotebook *) notebook { + [notebook retain]; + [__notebook release]; + __notebook = notebook; + __notebook_isset = YES; +} + +- (BOOL) notebookIsSet { + return __notebook_isset; +} + +- (void) unsetNotebook { + [__notebook release]; + __notebook = nil; + __notebook_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMNotebook *fieldValue = [[EDAMNotebook alloc] init]; + [fieldValue read: inProtocol]; + [self setNotebook: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"createNotebook_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__notebook_isset) { + if (__notebook != nil) { + [outProtocol writeFieldBeginWithName: @"notebook" type: TType_STRUCT fieldID: 2]; + [__notebook write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"createNotebook_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",notebook:"]; + [ms appendFormat: @"%@", __notebook]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMCreateNotebook_result : NSObject { + EDAMNotebook * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMNotebook * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (EDAMNotebook *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMNotebook *) success; +- (void) setSuccess: (EDAMNotebook *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMCreateNotebook_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (EDAMNotebook *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [super dealloc]; +} + +- (EDAMNotebook *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMNotebook *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMNotebook *fieldValue = [[EDAMNotebook alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"CreateNotebook_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"CreateNotebook_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMupdateNotebook_args : NSObject { + NSString * __authenticationToken; + EDAMNotebook * __notebook; + + BOOL __authenticationToken_isset; + BOOL __notebook_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=notebook, setter=setNotebook:) EDAMNotebook * notebook; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken notebook: (EDAMNotebook *) notebook; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMNotebook *) notebook; +- (void) setNotebook: (EDAMNotebook *) notebook; +- (BOOL) notebookIsSet; + +@end + +@implementation EDAMupdateNotebook_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic notebook; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken notebook: (EDAMNotebook *) notebook +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __notebook = [notebook retain]; + __notebook_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"notebook"]) + { + __notebook = [[decoder decodeObjectForKey: @"notebook"] retain]; + __notebook_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__notebook_isset) + { + [encoder encodeObject: __notebook forKey: @"notebook"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__notebook release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (EDAMNotebook *) notebook { + return [[__notebook retain] autorelease]; +} + +- (void) setNotebook: (EDAMNotebook *) notebook { + [notebook retain]; + [__notebook release]; + __notebook = notebook; + __notebook_isset = YES; +} + +- (BOOL) notebookIsSet { + return __notebook_isset; +} + +- (void) unsetNotebook { + [__notebook release]; + __notebook = nil; + __notebook_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMNotebook *fieldValue = [[EDAMNotebook alloc] init]; + [fieldValue read: inProtocol]; + [self setNotebook: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"updateNotebook_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__notebook_isset) { + if (__notebook != nil) { + [outProtocol writeFieldBeginWithName: @"notebook" type: TType_STRUCT fieldID: 2]; + [__notebook write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"updateNotebook_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",notebook:"]; + [ms appendFormat: @"%@", __notebook]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMUpdateNotebook_result : NSObject { + int32_t __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=success, setter=setSuccess:) int32_t success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int32_t) success; +- (void) setSuccess: (int32_t) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMUpdateNotebook_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = success; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [decoder decodeInt32ForKey: @"success"]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeInt32: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (int32_t) success { + return __success; +} + +- (void) setSuccess: (int32_t) success { + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setSuccess: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"UpdateNotebook_result"]; + + if (__success_isset) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_I32 fieldID: 0]; + [outProtocol writeI32: __success]; + [outProtocol writeFieldEnd]; + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"UpdateNotebook_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%i", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMexpungeNotebook_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __guid; + + BOOL __authenticationToken_isset; + BOOL __guid_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +@end + +@implementation EDAMexpungeNotebook_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __guid = [guid retain]; + __guid_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__guid release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"expungeNotebook_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"expungeNotebook_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMExpungeNotebook_result : NSObject { + int32_t __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=success, setter=setSuccess:) int32_t success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int32_t) success; +- (void) setSuccess: (int32_t) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMExpungeNotebook_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = success; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [decoder decodeInt32ForKey: @"success"]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeInt32: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (int32_t) success { + return __success; +} + +- (void) setSuccess: (int32_t) success { + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setSuccess: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"ExpungeNotebook_result"]; + + if (__success_isset) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_I32 fieldID: 0]; + [outProtocol writeI32: __success]; + [outProtocol writeFieldEnd]; + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"ExpungeNotebook_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%i", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMlistTags_args : NSObject { + NSString * __authenticationToken; + + BOOL __authenticationToken_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +@end + +@implementation EDAMlistTags_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"listTags_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"listTags_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMListTags_result : NSObject { + NSArray * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) NSArray * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (NSArray *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSArray *) success; +- (void) setSuccess: (NSArray *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMListTags_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (NSArray *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [super dealloc]; +} + +- (NSArray *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (NSArray *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_LIST) { + int _size103; + [inProtocol readListBeginReturningElementType: NULL size: &_size103]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size103]; + int _i104; + for (_i104 = 0; _i104 < _size103; ++_i104) + { + EDAMTag *_elem105 = [[EDAMTag alloc] init]; + [_elem105 read: inProtocol]; + [fieldValue addObject: _elem105]; + [_elem105 release]; + } + [inProtocol readListEnd]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"ListTags_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_LIST fieldID: 0]; + { + [outProtocol writeListBeginWithElementType: TType_STRUCT size: [__success count]]; + int i107; + for (i107 = 0; i107 < [__success count]; i107++) + { + [[__success objectAtIndex: i107] write: outProtocol]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"ListTags_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMlistTagsByNotebook_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __notebookGuid; + + BOOL __authenticationToken_isset; + BOOL __notebookGuid_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=notebookGuid, setter=setNotebookGuid:) EDAMGuid notebookGuid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken notebookGuid: (EDAMGuid) notebookGuid; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) notebookGuid; +- (void) setNotebookGuid: (EDAMGuid) notebookGuid; +- (BOOL) notebookGuidIsSet; + +@end + +@implementation EDAMlistTagsByNotebook_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic notebookGuid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken notebookGuid: (EDAMGuid) notebookGuid +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __notebookGuid = [notebookGuid retain]; + __notebookGuid_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"notebookGuid"]) + { + __notebookGuid = [[decoder decodeObjectForKey: @"notebookGuid"] retain]; + __notebookGuid_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__notebookGuid_isset) + { + [encoder encodeObject: __notebookGuid forKey: @"notebookGuid"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__notebookGuid release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) notebookGuid { + return [[__notebookGuid retain] autorelease]; +} + +- (void) setNotebookGuid: (NSString *) notebookGuid { + [notebookGuid retain]; + [__notebookGuid release]; + __notebookGuid = notebookGuid; + __notebookGuid_isset = YES; +} + +- (BOOL) notebookGuidIsSet { + return __notebookGuid_isset; +} + +- (void) unsetNotebookGuid { + [__notebookGuid release]; + __notebookGuid = nil; + __notebookGuid_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setNotebookGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"listTagsByNotebook_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__notebookGuid_isset) { + if (__notebookGuid != nil) { + [outProtocol writeFieldBeginWithName: @"notebookGuid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __notebookGuid]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"listTagsByNotebook_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",notebookGuid:"]; + [ms appendFormat: @"\"%@\"", __notebookGuid]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMListTagsByNotebook_result : NSObject { + NSArray * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) NSArray * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (NSArray *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSArray *) success; +- (void) setSuccess: (NSArray *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMListTagsByNotebook_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (NSArray *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (NSArray *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (NSArray *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_LIST) { + int _size108; + [inProtocol readListBeginReturningElementType: NULL size: &_size108]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size108]; + int _i109; + for (_i109 = 0; _i109 < _size108; ++_i109) + { + EDAMTag *_elem110 = [[EDAMTag alloc] init]; + [_elem110 read: inProtocol]; + [fieldValue addObject: _elem110]; + [_elem110 release]; + } + [inProtocol readListEnd]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"ListTagsByNotebook_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_LIST fieldID: 0]; + { + [outProtocol writeListBeginWithElementType: TType_STRUCT size: [__success count]]; + int i112; + for (i112 = 0; i112 < [__success count]; i112++) + { + [[__success objectAtIndex: i112] write: outProtocol]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"ListTagsByNotebook_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetTag_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __guid; + + BOOL __authenticationToken_isset; + BOOL __guid_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +@end + +@implementation EDAMgetTag_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __guid = [guid retain]; + __guid_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__guid release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getTag_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getTag_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetTag_result : NSObject { + EDAMTag * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMTag * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (EDAMTag *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMTag *) success; +- (void) setSuccess: (EDAMTag *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMGetTag_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (EDAMTag *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (EDAMTag *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMTag *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMTag *fieldValue = [[EDAMTag alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetTag_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetTag_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMcreateTag_args : NSObject { + NSString * __authenticationToken; + EDAMTag * __tag; + + BOOL __authenticationToken_isset; + BOOL __tag_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=tag, setter=setTag:) EDAMTag * tag; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken tag: (EDAMTag *) tag; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMTag *) tag; +- (void) setTag: (EDAMTag *) tag; +- (BOOL) tagIsSet; + +@end + +@implementation EDAMcreateTag_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic tag; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken tag: (EDAMTag *) tag +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __tag = [tag retain]; + __tag_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"tag"]) + { + __tag = [[decoder decodeObjectForKey: @"tag"] retain]; + __tag_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__tag_isset) + { + [encoder encodeObject: __tag forKey: @"tag"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__tag release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (EDAMTag *) tag { + return [[__tag retain] autorelease]; +} + +- (void) setTag: (EDAMTag *) tag { + [tag retain]; + [__tag release]; + __tag = tag; + __tag_isset = YES; +} + +- (BOOL) tagIsSet { + return __tag_isset; +} + +- (void) unsetTag { + [__tag release]; + __tag = nil; + __tag_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMTag *fieldValue = [[EDAMTag alloc] init]; + [fieldValue read: inProtocol]; + [self setTag: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"createTag_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__tag_isset) { + if (__tag != nil) { + [outProtocol writeFieldBeginWithName: @"tag" type: TType_STRUCT fieldID: 2]; + [__tag write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"createTag_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",tag:"]; + [ms appendFormat: @"%@", __tag]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMCreateTag_result : NSObject { + EDAMTag * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMTag * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (EDAMTag *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMTag *) success; +- (void) setSuccess: (EDAMTag *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMCreateTag_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (EDAMTag *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (EDAMTag *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMTag *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMTag *fieldValue = [[EDAMTag alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"CreateTag_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"CreateTag_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMupdateTag_args : NSObject { + NSString * __authenticationToken; + EDAMTag * __tag; + + BOOL __authenticationToken_isset; + BOOL __tag_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=tag, setter=setTag:) EDAMTag * tag; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken tag: (EDAMTag *) tag; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMTag *) tag; +- (void) setTag: (EDAMTag *) tag; +- (BOOL) tagIsSet; + +@end + +@implementation EDAMupdateTag_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic tag; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken tag: (EDAMTag *) tag +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __tag = [tag retain]; + __tag_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"tag"]) + { + __tag = [[decoder decodeObjectForKey: @"tag"] retain]; + __tag_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__tag_isset) + { + [encoder encodeObject: __tag forKey: @"tag"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__tag release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (EDAMTag *) tag { + return [[__tag retain] autorelease]; +} + +- (void) setTag: (EDAMTag *) tag { + [tag retain]; + [__tag release]; + __tag = tag; + __tag_isset = YES; +} + +- (BOOL) tagIsSet { + return __tag_isset; +} + +- (void) unsetTag { + [__tag release]; + __tag = nil; + __tag_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMTag *fieldValue = [[EDAMTag alloc] init]; + [fieldValue read: inProtocol]; + [self setTag: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"updateTag_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__tag_isset) { + if (__tag != nil) { + [outProtocol writeFieldBeginWithName: @"tag" type: TType_STRUCT fieldID: 2]; + [__tag write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"updateTag_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",tag:"]; + [ms appendFormat: @"%@", __tag]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMUpdateTag_result : NSObject { + int32_t __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=success, setter=setSuccess:) int32_t success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int32_t) success; +- (void) setSuccess: (int32_t) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMUpdateTag_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = success; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [decoder decodeInt32ForKey: @"success"]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeInt32: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (int32_t) success { + return __success; +} + +- (void) setSuccess: (int32_t) success { + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setSuccess: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"UpdateTag_result"]; + + if (__success_isset) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_I32 fieldID: 0]; + [outProtocol writeI32: __success]; + [outProtocol writeFieldEnd]; + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"UpdateTag_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%i", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMuntagAll_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __guid; + + BOOL __authenticationToken_isset; + BOOL __guid_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +@end + +@implementation EDAMuntagAll_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __guid = [guid retain]; + __guid_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__guid release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"untagAll_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"untagAll_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMUntagAll_result : NSObject { + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithUserException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMUntagAll_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithUserException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"UntagAll_result"]; + + if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"UntagAll_result("]; + [ms appendString: @"userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMexpungeTag_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __guid; + + BOOL __authenticationToken_isset; + BOOL __guid_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +@end + +@implementation EDAMexpungeTag_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __guid = [guid retain]; + __guid_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__guid release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"expungeTag_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"expungeTag_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMExpungeTag_result : NSObject { + int32_t __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=success, setter=setSuccess:) int32_t success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int32_t) success; +- (void) setSuccess: (int32_t) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMExpungeTag_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = success; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [decoder decodeInt32ForKey: @"success"]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeInt32: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (int32_t) success { + return __success; +} + +- (void) setSuccess: (int32_t) success { + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setSuccess: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"ExpungeTag_result"]; + + if (__success_isset) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_I32 fieldID: 0]; + [outProtocol writeI32: __success]; + [outProtocol writeFieldEnd]; + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"ExpungeTag_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%i", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMlistSearches_args : NSObject { + NSString * __authenticationToken; + + BOOL __authenticationToken_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +@end + +@implementation EDAMlistSearches_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"listSearches_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"listSearches_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMListSearches_result : NSObject { + NSArray * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) NSArray * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (NSArray *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSArray *) success; +- (void) setSuccess: (NSArray *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMListSearches_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (NSArray *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [super dealloc]; +} + +- (NSArray *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (NSArray *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_LIST) { + int _size113; + [inProtocol readListBeginReturningElementType: NULL size: &_size113]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size113]; + int _i114; + for (_i114 = 0; _i114 < _size113; ++_i114) + { + EDAMSavedSearch *_elem115 = [[EDAMSavedSearch alloc] init]; + [_elem115 read: inProtocol]; + [fieldValue addObject: _elem115]; + [_elem115 release]; + } + [inProtocol readListEnd]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"ListSearches_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_LIST fieldID: 0]; + { + [outProtocol writeListBeginWithElementType: TType_STRUCT size: [__success count]]; + int i117; + for (i117 = 0; i117 < [__success count]; i117++) + { + [[__success objectAtIndex: i117] write: outProtocol]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"ListSearches_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetSearch_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __guid; + + BOOL __authenticationToken_isset; + BOOL __guid_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +@end + +@implementation EDAMgetSearch_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __guid = [guid retain]; + __guid_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__guid release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getSearch_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getSearch_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetSearch_result : NSObject { + EDAMSavedSearch * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMSavedSearch * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (EDAMSavedSearch *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMSavedSearch *) success; +- (void) setSuccess: (EDAMSavedSearch *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMGetSearch_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (EDAMSavedSearch *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (EDAMSavedSearch *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMSavedSearch *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMSavedSearch *fieldValue = [[EDAMSavedSearch alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetSearch_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetSearch_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMcreateSearch_args : NSObject { + NSString * __authenticationToken; + EDAMSavedSearch * __search; + + BOOL __authenticationToken_isset; + BOOL __search_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=search, setter=setSearch:) EDAMSavedSearch * search; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken search: (EDAMSavedSearch *) search; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMSavedSearch *) search; +- (void) setSearch: (EDAMSavedSearch *) search; +- (BOOL) searchIsSet; + +@end + +@implementation EDAMcreateSearch_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic search; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken search: (EDAMSavedSearch *) search +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __search = [search retain]; + __search_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"search"]) + { + __search = [[decoder decodeObjectForKey: @"search"] retain]; + __search_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__search_isset) + { + [encoder encodeObject: __search forKey: @"search"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__search release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (EDAMSavedSearch *) search { + return [[__search retain] autorelease]; +} + +- (void) setSearch: (EDAMSavedSearch *) search { + [search retain]; + [__search release]; + __search = search; + __search_isset = YES; +} + +- (BOOL) searchIsSet { + return __search_isset; +} + +- (void) unsetSearch { + [__search release]; + __search = nil; + __search_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSavedSearch *fieldValue = [[EDAMSavedSearch alloc] init]; + [fieldValue read: inProtocol]; + [self setSearch: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"createSearch_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__search_isset) { + if (__search != nil) { + [outProtocol writeFieldBeginWithName: @"search" type: TType_STRUCT fieldID: 2]; + [__search write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"createSearch_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",search:"]; + [ms appendFormat: @"%@", __search]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMCreateSearch_result : NSObject { + EDAMSavedSearch * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMSavedSearch * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (EDAMSavedSearch *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMSavedSearch *) success; +- (void) setSuccess: (EDAMSavedSearch *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMCreateSearch_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (EDAMSavedSearch *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [super dealloc]; +} + +- (EDAMSavedSearch *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMSavedSearch *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMSavedSearch *fieldValue = [[EDAMSavedSearch alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"CreateSearch_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"CreateSearch_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMupdateSearch_args : NSObject { + NSString * __authenticationToken; + EDAMSavedSearch * __search; + + BOOL __authenticationToken_isset; + BOOL __search_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=search, setter=setSearch:) EDAMSavedSearch * search; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken search: (EDAMSavedSearch *) search; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMSavedSearch *) search; +- (void) setSearch: (EDAMSavedSearch *) search; +- (BOOL) searchIsSet; + +@end + +@implementation EDAMupdateSearch_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic search; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken search: (EDAMSavedSearch *) search +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __search = [search retain]; + __search_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"search"]) + { + __search = [[decoder decodeObjectForKey: @"search"] retain]; + __search_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__search_isset) + { + [encoder encodeObject: __search forKey: @"search"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__search release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (EDAMSavedSearch *) search { + return [[__search retain] autorelease]; +} + +- (void) setSearch: (EDAMSavedSearch *) search { + [search retain]; + [__search release]; + __search = search; + __search_isset = YES; +} + +- (BOOL) searchIsSet { + return __search_isset; +} + +- (void) unsetSearch { + [__search release]; + __search = nil; + __search_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSavedSearch *fieldValue = [[EDAMSavedSearch alloc] init]; + [fieldValue read: inProtocol]; + [self setSearch: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"updateSearch_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__search_isset) { + if (__search != nil) { + [outProtocol writeFieldBeginWithName: @"search" type: TType_STRUCT fieldID: 2]; + [__search write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"updateSearch_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",search:"]; + [ms appendFormat: @"%@", __search]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMUpdateSearch_result : NSObject { + int32_t __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=success, setter=setSuccess:) int32_t success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int32_t) success; +- (void) setSuccess: (int32_t) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMUpdateSearch_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = success; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [decoder decodeInt32ForKey: @"success"]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeInt32: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (int32_t) success { + return __success; +} + +- (void) setSuccess: (int32_t) success { + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setSuccess: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"UpdateSearch_result"]; + + if (__success_isset) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_I32 fieldID: 0]; + [outProtocol writeI32: __success]; + [outProtocol writeFieldEnd]; + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"UpdateSearch_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%i", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMexpungeSearch_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __guid; + + BOOL __authenticationToken_isset; + BOOL __guid_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +@end + +@implementation EDAMexpungeSearch_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __guid = [guid retain]; + __guid_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__guid release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"expungeSearch_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"expungeSearch_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMExpungeSearch_result : NSObject { + int32_t __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=success, setter=setSuccess:) int32_t success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int32_t) success; +- (void) setSuccess: (int32_t) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMExpungeSearch_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = success; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [decoder decodeInt32ForKey: @"success"]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeInt32: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (int32_t) success { + return __success; +} + +- (void) setSuccess: (int32_t) success { + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setSuccess: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"ExpungeSearch_result"]; + + if (__success_isset) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_I32 fieldID: 0]; + [outProtocol writeI32: __success]; + [outProtocol writeFieldEnd]; + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"ExpungeSearch_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%i", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMfindNotes_args : NSObject { + NSString * __authenticationToken; + EDAMNoteFilter * __filter; + int32_t __offset; + int32_t __maxNotes; + + BOOL __authenticationToken_isset; + BOOL __filter_isset; + BOOL __offset_isset; + BOOL __maxNotes_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=filter, setter=setFilter:) EDAMNoteFilter * filter; +@property (nonatomic, getter=offset, setter=setOffset:) int32_t offset; +@property (nonatomic, getter=maxNotes, setter=setMaxNotes:) int32_t maxNotes; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken filter: (EDAMNoteFilter *) filter offset: (int32_t) offset maxNotes: (int32_t) maxNotes; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMNoteFilter *) filter; +- (void) setFilter: (EDAMNoteFilter *) filter; +- (BOOL) filterIsSet; + +- (int32_t) offset; +- (void) setOffset: (int32_t) offset; +- (BOOL) offsetIsSet; + +- (int32_t) maxNotes; +- (void) setMaxNotes: (int32_t) maxNotes; +- (BOOL) maxNotesIsSet; + +@end + +@implementation EDAMfindNotes_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic filter; +@dynamic offset; +@dynamic maxNotes; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken filter: (EDAMNoteFilter *) filter offset: (int32_t) offset maxNotes: (int32_t) maxNotes +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __filter = [filter retain]; + __filter_isset = YES; + __offset = offset; + __offset_isset = YES; + __maxNotes = maxNotes; + __maxNotes_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"filter"]) + { + __filter = [[decoder decodeObjectForKey: @"filter"] retain]; + __filter_isset = YES; + } + if ([decoder containsValueForKey: @"offset"]) + { + __offset = [decoder decodeInt32ForKey: @"offset"]; + __offset_isset = YES; + } + if ([decoder containsValueForKey: @"maxNotes"]) + { + __maxNotes = [decoder decodeInt32ForKey: @"maxNotes"]; + __maxNotes_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__filter_isset) + { + [encoder encodeObject: __filter forKey: @"filter"]; + } + if (__offset_isset) + { + [encoder encodeInt32: __offset forKey: @"offset"]; + } + if (__maxNotes_isset) + { + [encoder encodeInt32: __maxNotes forKey: @"maxNotes"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__filter release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (EDAMNoteFilter *) filter { + return [[__filter retain] autorelease]; +} + +- (void) setFilter: (EDAMNoteFilter *) filter { + [filter retain]; + [__filter release]; + __filter = filter; + __filter_isset = YES; +} + +- (BOOL) filterIsSet { + return __filter_isset; +} + +- (void) unsetFilter { + [__filter release]; + __filter = nil; + __filter_isset = NO; +} + +- (int32_t) offset { + return __offset; +} + +- (void) setOffset: (int32_t) offset { + __offset = offset; + __offset_isset = YES; +} + +- (BOOL) offsetIsSet { + return __offset_isset; +} + +- (void) unsetOffset { + __offset_isset = NO; +} + +- (int32_t) maxNotes { + return __maxNotes; +} + +- (void) setMaxNotes: (int32_t) maxNotes { + __maxNotes = maxNotes; + __maxNotes_isset = YES; +} + +- (BOOL) maxNotesIsSet { + return __maxNotes_isset; +} + +- (void) unsetMaxNotes { + __maxNotes_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMNoteFilter *fieldValue = [[EDAMNoteFilter alloc] init]; + [fieldValue read: inProtocol]; + [self setFilter: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setOffset: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setMaxNotes: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"findNotes_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__filter_isset) { + if (__filter != nil) { + [outProtocol writeFieldBeginWithName: @"filter" type: TType_STRUCT fieldID: 2]; + [__filter write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + if (__offset_isset) { + [outProtocol writeFieldBeginWithName: @"offset" type: TType_I32 fieldID: 3]; + [outProtocol writeI32: __offset]; + [outProtocol writeFieldEnd]; + } + if (__maxNotes_isset) { + [outProtocol writeFieldBeginWithName: @"maxNotes" type: TType_I32 fieldID: 4]; + [outProtocol writeI32: __maxNotes]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"findNotes_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",filter:"]; + [ms appendFormat: @"%@", __filter]; + [ms appendString: @",offset:"]; + [ms appendFormat: @"%i", __offset]; + [ms appendString: @",maxNotes:"]; + [ms appendFormat: @"%i", __maxNotes]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMFindNotes_result : NSObject { + EDAMNoteList * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMNoteList * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (EDAMNoteList *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMNoteList *) success; +- (void) setSuccess: (EDAMNoteList *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMFindNotes_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (EDAMNoteList *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (EDAMNoteList *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMNoteList *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMNoteList *fieldValue = [[EDAMNoteList alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"FindNotes_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"FindNotes_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMfindNoteCounts_args : NSObject { + NSString * __authenticationToken; + EDAMNoteFilter * __filter; + BOOL __withTrash; + + BOOL __authenticationToken_isset; + BOOL __filter_isset; + BOOL __withTrash_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=filter, setter=setFilter:) EDAMNoteFilter * filter; +@property (nonatomic, getter=withTrash, setter=setWithTrash:) BOOL withTrash; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken filter: (EDAMNoteFilter *) filter withTrash: (BOOL) withTrash; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMNoteFilter *) filter; +- (void) setFilter: (EDAMNoteFilter *) filter; +- (BOOL) filterIsSet; + +- (BOOL) withTrash; +- (void) setWithTrash: (BOOL) withTrash; +- (BOOL) withTrashIsSet; + +@end + +@implementation EDAMfindNoteCounts_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic filter; +@dynamic withTrash; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken filter: (EDAMNoteFilter *) filter withTrash: (BOOL) withTrash +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __filter = [filter retain]; + __filter_isset = YES; + __withTrash = withTrash; + __withTrash_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"filter"]) + { + __filter = [[decoder decodeObjectForKey: @"filter"] retain]; + __filter_isset = YES; + } + if ([decoder containsValueForKey: @"withTrash"]) + { + __withTrash = [decoder decodeBoolForKey: @"withTrash"]; + __withTrash_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__filter_isset) + { + [encoder encodeObject: __filter forKey: @"filter"]; + } + if (__withTrash_isset) + { + [encoder encodeBool: __withTrash forKey: @"withTrash"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__filter release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (EDAMNoteFilter *) filter { + return [[__filter retain] autorelease]; +} + +- (void) setFilter: (EDAMNoteFilter *) filter { + [filter retain]; + [__filter release]; + __filter = filter; + __filter_isset = YES; +} + +- (BOOL) filterIsSet { + return __filter_isset; +} + +- (void) unsetFilter { + [__filter release]; + __filter = nil; + __filter_isset = NO; +} + +- (BOOL) withTrash { + return __withTrash; +} + +- (void) setWithTrash: (BOOL) withTrash { + __withTrash = withTrash; + __withTrash_isset = YES; +} + +- (BOOL) withTrashIsSet { + return __withTrash_isset; +} + +- (void) unsetWithTrash { + __withTrash_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMNoteFilter *fieldValue = [[EDAMNoteFilter alloc] init]; + [fieldValue read: inProtocol]; + [self setFilter: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setWithTrash: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"findNoteCounts_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__filter_isset) { + if (__filter != nil) { + [outProtocol writeFieldBeginWithName: @"filter" type: TType_STRUCT fieldID: 2]; + [__filter write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + if (__withTrash_isset) { + [outProtocol writeFieldBeginWithName: @"withTrash" type: TType_BOOL fieldID: 3]; + [outProtocol writeBool: __withTrash]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"findNoteCounts_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",filter:"]; + [ms appendFormat: @"%@", __filter]; + [ms appendString: @",withTrash:"]; + [ms appendFormat: @"%i", __withTrash]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMFindNoteCounts_result : NSObject { + EDAMNoteCollectionCounts * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMNoteCollectionCounts * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (EDAMNoteCollectionCounts *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMNoteCollectionCounts *) success; +- (void) setSuccess: (EDAMNoteCollectionCounts *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMFindNoteCounts_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (EDAMNoteCollectionCounts *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (EDAMNoteCollectionCounts *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMNoteCollectionCounts *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMNoteCollectionCounts *fieldValue = [[EDAMNoteCollectionCounts alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"FindNoteCounts_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"FindNoteCounts_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetNote_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __guid; + BOOL __withContent; + BOOL __withResourcesData; + BOOL __withResourcesRecognition; + BOOL __withResourcesAlternateData; + + BOOL __authenticationToken_isset; + BOOL __guid_isset; + BOOL __withContent_isset; + BOOL __withResourcesData_isset; + BOOL __withResourcesRecognition_isset; + BOOL __withResourcesAlternateData_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +@property (nonatomic, getter=withContent, setter=setWithContent:) BOOL withContent; +@property (nonatomic, getter=withResourcesData, setter=setWithResourcesData:) BOOL withResourcesData; +@property (nonatomic, getter=withResourcesRecognition, setter=setWithResourcesRecognition:) BOOL withResourcesRecognition; +@property (nonatomic, getter=withResourcesAlternateData, setter=setWithResourcesAlternateData:) BOOL withResourcesAlternateData; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid withContent: (BOOL) withContent withResourcesData: (BOOL) withResourcesData withResourcesRecognition: (BOOL) withResourcesRecognition withResourcesAlternateData: (BOOL) withResourcesAlternateData; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +- (BOOL) withContent; +- (void) setWithContent: (BOOL) withContent; +- (BOOL) withContentIsSet; + +- (BOOL) withResourcesData; +- (void) setWithResourcesData: (BOOL) withResourcesData; +- (BOOL) withResourcesDataIsSet; + +- (BOOL) withResourcesRecognition; +- (void) setWithResourcesRecognition: (BOOL) withResourcesRecognition; +- (BOOL) withResourcesRecognitionIsSet; + +- (BOOL) withResourcesAlternateData; +- (void) setWithResourcesAlternateData: (BOOL) withResourcesAlternateData; +- (BOOL) withResourcesAlternateDataIsSet; + +@end + +@implementation EDAMgetNote_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic guid; +@dynamic withContent; +@dynamic withResourcesData; +@dynamic withResourcesRecognition; +@dynamic withResourcesAlternateData; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid withContent: (BOOL) withContent withResourcesData: (BOOL) withResourcesData withResourcesRecognition: (BOOL) withResourcesRecognition withResourcesAlternateData: (BOOL) withResourcesAlternateData +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __guid = [guid retain]; + __guid_isset = YES; + __withContent = withContent; + __withContent_isset = YES; + __withResourcesData = withResourcesData; + __withResourcesData_isset = YES; + __withResourcesRecognition = withResourcesRecognition; + __withResourcesRecognition_isset = YES; + __withResourcesAlternateData = withResourcesAlternateData; + __withResourcesAlternateData_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + if ([decoder containsValueForKey: @"withContent"]) + { + __withContent = [decoder decodeBoolForKey: @"withContent"]; + __withContent_isset = YES; + } + if ([decoder containsValueForKey: @"withResourcesData"]) + { + __withResourcesData = [decoder decodeBoolForKey: @"withResourcesData"]; + __withResourcesData_isset = YES; + } + if ([decoder containsValueForKey: @"withResourcesRecognition"]) + { + __withResourcesRecognition = [decoder decodeBoolForKey: @"withResourcesRecognition"]; + __withResourcesRecognition_isset = YES; + } + if ([decoder containsValueForKey: @"withResourcesAlternateData"]) + { + __withResourcesAlternateData = [decoder decodeBoolForKey: @"withResourcesAlternateData"]; + __withResourcesAlternateData_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } + if (__withContent_isset) + { + [encoder encodeBool: __withContent forKey: @"withContent"]; + } + if (__withResourcesData_isset) + { + [encoder encodeBool: __withResourcesData forKey: @"withResourcesData"]; + } + if (__withResourcesRecognition_isset) + { + [encoder encodeBool: __withResourcesRecognition forKey: @"withResourcesRecognition"]; + } + if (__withResourcesAlternateData_isset) + { + [encoder encodeBool: __withResourcesAlternateData forKey: @"withResourcesAlternateData"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__guid release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (BOOL) withContent { + return __withContent; +} + +- (void) setWithContent: (BOOL) withContent { + __withContent = withContent; + __withContent_isset = YES; +} + +- (BOOL) withContentIsSet { + return __withContent_isset; +} + +- (void) unsetWithContent { + __withContent_isset = NO; +} + +- (BOOL) withResourcesData { + return __withResourcesData; +} + +- (void) setWithResourcesData: (BOOL) withResourcesData { + __withResourcesData = withResourcesData; + __withResourcesData_isset = YES; +} + +- (BOOL) withResourcesDataIsSet { + return __withResourcesData_isset; +} + +- (void) unsetWithResourcesData { + __withResourcesData_isset = NO; +} + +- (BOOL) withResourcesRecognition { + return __withResourcesRecognition; +} + +- (void) setWithResourcesRecognition: (BOOL) withResourcesRecognition { + __withResourcesRecognition = withResourcesRecognition; + __withResourcesRecognition_isset = YES; +} + +- (BOOL) withResourcesRecognitionIsSet { + return __withResourcesRecognition_isset; +} + +- (void) unsetWithResourcesRecognition { + __withResourcesRecognition_isset = NO; +} + +- (BOOL) withResourcesAlternateData { + return __withResourcesAlternateData; +} + +- (void) setWithResourcesAlternateData: (BOOL) withResourcesAlternateData { + __withResourcesAlternateData = withResourcesAlternateData; + __withResourcesAlternateData_isset = YES; +} + +- (BOOL) withResourcesAlternateDataIsSet { + return __withResourcesAlternateData_isset; +} + +- (void) unsetWithResourcesAlternateData { + __withResourcesAlternateData_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setWithContent: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setWithResourcesData: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 5: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setWithResourcesRecognition: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 6: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setWithResourcesAlternateData: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getNote_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + if (__withContent_isset) { + [outProtocol writeFieldBeginWithName: @"withContent" type: TType_BOOL fieldID: 3]; + [outProtocol writeBool: __withContent]; + [outProtocol writeFieldEnd]; + } + if (__withResourcesData_isset) { + [outProtocol writeFieldBeginWithName: @"withResourcesData" type: TType_BOOL fieldID: 4]; + [outProtocol writeBool: __withResourcesData]; + [outProtocol writeFieldEnd]; + } + if (__withResourcesRecognition_isset) { + [outProtocol writeFieldBeginWithName: @"withResourcesRecognition" type: TType_BOOL fieldID: 5]; + [outProtocol writeBool: __withResourcesRecognition]; + [outProtocol writeFieldEnd]; + } + if (__withResourcesAlternateData_isset) { + [outProtocol writeFieldBeginWithName: @"withResourcesAlternateData" type: TType_BOOL fieldID: 6]; + [outProtocol writeBool: __withResourcesAlternateData]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getNote_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @",withContent:"]; + [ms appendFormat: @"%i", __withContent]; + [ms appendString: @",withResourcesData:"]; + [ms appendFormat: @"%i", __withResourcesData]; + [ms appendString: @",withResourcesRecognition:"]; + [ms appendFormat: @"%i", __withResourcesRecognition]; + [ms appendString: @",withResourcesAlternateData:"]; + [ms appendFormat: @"%i", __withResourcesAlternateData]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetNote_result : NSObject { + EDAMNote * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMNote * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (EDAMNote *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMNote *) success; +- (void) setSuccess: (EDAMNote *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMGetNote_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (EDAMNote *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (EDAMNote *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMNote *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMNote *fieldValue = [[EDAMNote alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetNote_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetNote_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetNoteContent_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __guid; + + BOOL __authenticationToken_isset; + BOOL __guid_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +@end + +@implementation EDAMgetNoteContent_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __guid = [guid retain]; + __guid_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__guid release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getNoteContent_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getNoteContent_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetNoteContent_result : NSObject { + NSString * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) NSString * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (NSString *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) success; +- (void) setSuccess: (NSString *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMGetNoteContent_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (NSString *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (NSString *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (NSString *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setSuccess: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetNoteContent_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRING fieldID: 0]; + [outProtocol writeString: __success]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetNoteContent_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"\"%@\"", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetNoteSearchText_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __guid; + + BOOL __authenticationToken_isset; + BOOL __guid_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +@end + +@implementation EDAMgetNoteSearchText_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __guid = [guid retain]; + __guid_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__guid release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getNoteSearchText_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getNoteSearchText_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetNoteSearchText_result : NSObject { + NSString * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) NSString * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (NSString *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) success; +- (void) setSuccess: (NSString *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMGetNoteSearchText_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (NSString *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (NSString *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (NSString *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setSuccess: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetNoteSearchText_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRING fieldID: 0]; + [outProtocol writeString: __success]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetNoteSearchText_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"\"%@\"", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetNoteTagNames_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __guid; + + BOOL __authenticationToken_isset; + BOOL __guid_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +@end + +@implementation EDAMgetNoteTagNames_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __guid = [guid retain]; + __guid_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__guid release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getNoteTagNames_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getNoteTagNames_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetNoteTagNames_result : NSObject { + NSArray * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) NSArray * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (NSArray *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSArray *) success; +- (void) setSuccess: (NSArray *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMGetNoteTagNames_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (NSArray *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (NSArray *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (NSArray *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_LIST) { + int _size118; + [inProtocol readListBeginReturningElementType: NULL size: &_size118]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size118]; + int _i119; + for (_i119 = 0; _i119 < _size118; ++_i119) + { + NSString * _elem120 = [inProtocol readString]; + [fieldValue addObject: _elem120]; + } + [inProtocol readListEnd]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetNoteTagNames_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_LIST fieldID: 0]; + { + [outProtocol writeListBeginWithElementType: TType_STRING size: [__success count]]; + int i122; + for (i122 = 0; i122 < [__success count]; i122++) + { + [outProtocol writeString: [__success objectAtIndex: i122]]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetNoteTagNames_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMcreateNote_args : NSObject { + NSString * __authenticationToken; + EDAMNote * __note; + + BOOL __authenticationToken_isset; + BOOL __note_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=note, setter=setNote:) EDAMNote * note; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken note: (EDAMNote *) note; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMNote *) note; +- (void) setNote: (EDAMNote *) note; +- (BOOL) noteIsSet; + +@end + +@implementation EDAMcreateNote_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic note; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken note: (EDAMNote *) note +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __note = [note retain]; + __note_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"note"]) + { + __note = [[decoder decodeObjectForKey: @"note"] retain]; + __note_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__note_isset) + { + [encoder encodeObject: __note forKey: @"note"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__note release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (EDAMNote *) note { + return [[__note retain] autorelease]; +} + +- (void) setNote: (EDAMNote *) note { + [note retain]; + [__note release]; + __note = note; + __note_isset = YES; +} + +- (BOOL) noteIsSet { + return __note_isset; +} + +- (void) unsetNote { + [__note release]; + __note = nil; + __note_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMNote *fieldValue = [[EDAMNote alloc] init]; + [fieldValue read: inProtocol]; + [self setNote: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"createNote_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__note_isset) { + if (__note != nil) { + [outProtocol writeFieldBeginWithName: @"note" type: TType_STRUCT fieldID: 2]; + [__note write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"createNote_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",note:"]; + [ms appendFormat: @"%@", __note]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMCreateNote_result : NSObject { + EDAMNote * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMNote * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (EDAMNote *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMNote *) success; +- (void) setSuccess: (EDAMNote *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMCreateNote_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (EDAMNote *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (EDAMNote *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMNote *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMNote *fieldValue = [[EDAMNote alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"CreateNote_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"CreateNote_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMupdateNote_args : NSObject { + NSString * __authenticationToken; + EDAMNote * __note; + + BOOL __authenticationToken_isset; + BOOL __note_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=note, setter=setNote:) EDAMNote * note; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken note: (EDAMNote *) note; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMNote *) note; +- (void) setNote: (EDAMNote *) note; +- (BOOL) noteIsSet; + +@end + +@implementation EDAMupdateNote_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic note; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken note: (EDAMNote *) note +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __note = [note retain]; + __note_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"note"]) + { + __note = [[decoder decodeObjectForKey: @"note"] retain]; + __note_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__note_isset) + { + [encoder encodeObject: __note forKey: @"note"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__note release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (EDAMNote *) note { + return [[__note retain] autorelease]; +} + +- (void) setNote: (EDAMNote *) note { + [note retain]; + [__note release]; + __note = note; + __note_isset = YES; +} + +- (BOOL) noteIsSet { + return __note_isset; +} + +- (void) unsetNote { + [__note release]; + __note = nil; + __note_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMNote *fieldValue = [[EDAMNote alloc] init]; + [fieldValue read: inProtocol]; + [self setNote: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"updateNote_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__note_isset) { + if (__note != nil) { + [outProtocol writeFieldBeginWithName: @"note" type: TType_STRUCT fieldID: 2]; + [__note write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"updateNote_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",note:"]; + [ms appendFormat: @"%@", __note]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMUpdateNote_result : NSObject { + EDAMNote * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMNote * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (EDAMNote *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMNote *) success; +- (void) setSuccess: (EDAMNote *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMUpdateNote_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (EDAMNote *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (EDAMNote *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMNote *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMNote *fieldValue = [[EDAMNote alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"UpdateNote_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"UpdateNote_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMdeleteNote_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __guid; + + BOOL __authenticationToken_isset; + BOOL __guid_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +@end + +@implementation EDAMdeleteNote_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __guid = [guid retain]; + __guid_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__guid release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"deleteNote_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"deleteNote_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMDeleteNote_result : NSObject { + int32_t __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=success, setter=setSuccess:) int32_t success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int32_t) success; +- (void) setSuccess: (int32_t) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMDeleteNote_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = success; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [decoder decodeInt32ForKey: @"success"]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeInt32: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (int32_t) success { + return __success; +} + +- (void) setSuccess: (int32_t) success { + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setSuccess: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"DeleteNote_result"]; + + if (__success_isset) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_I32 fieldID: 0]; + [outProtocol writeI32: __success]; + [outProtocol writeFieldEnd]; + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"DeleteNote_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%i", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMexpungeNote_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __guid; + + BOOL __authenticationToken_isset; + BOOL __guid_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +@end + +@implementation EDAMexpungeNote_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __guid = [guid retain]; + __guid_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__guid release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"expungeNote_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"expungeNote_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMExpungeNote_result : NSObject { + int32_t __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=success, setter=setSuccess:) int32_t success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int32_t) success; +- (void) setSuccess: (int32_t) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMExpungeNote_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = success; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [decoder decodeInt32ForKey: @"success"]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeInt32: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (int32_t) success { + return __success; +} + +- (void) setSuccess: (int32_t) success { + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setSuccess: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"ExpungeNote_result"]; + + if (__success_isset) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_I32 fieldID: 0]; + [outProtocol writeI32: __success]; + [outProtocol writeFieldEnd]; + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"ExpungeNote_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%i", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMexpungeNotes_args : NSObject { + NSString * __authenticationToken; + NSArray * __noteGuids; + + BOOL __authenticationToken_isset; + BOOL __noteGuids_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=noteGuids, setter=setNoteGuids:) NSArray * noteGuids; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken noteGuids: (NSArray *) noteGuids; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (NSArray *) noteGuids; +- (void) setNoteGuids: (NSArray *) noteGuids; +- (BOOL) noteGuidsIsSet; + +@end + +@implementation EDAMexpungeNotes_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic noteGuids; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken noteGuids: (NSArray *) noteGuids +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __noteGuids = [noteGuids retain]; + __noteGuids_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"noteGuids"]) + { + __noteGuids = [[decoder decodeObjectForKey: @"noteGuids"] retain]; + __noteGuids_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__noteGuids_isset) + { + [encoder encodeObject: __noteGuids forKey: @"noteGuids"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__noteGuids release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSArray *) noteGuids { + return [[__noteGuids retain] autorelease]; +} + +- (void) setNoteGuids: (NSArray *) noteGuids { + [noteGuids retain]; + [__noteGuids release]; + __noteGuids = noteGuids; + __noteGuids_isset = YES; +} + +- (BOOL) noteGuidsIsSet { + return __noteGuids_isset; +} + +- (void) unsetNoteGuids { + [__noteGuids release]; + __noteGuids = nil; + __noteGuids_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_LIST) { + int _size123; + [inProtocol readListBeginReturningElementType: NULL size: &_size123]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size123]; + int _i124; + for (_i124 = 0; _i124 < _size123; ++_i124) + { + NSString * _elem125 = [inProtocol readString]; + [fieldValue addObject: _elem125]; + } + [inProtocol readListEnd]; + [self setNoteGuids: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"expungeNotes_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__noteGuids_isset) { + if (__noteGuids != nil) { + [outProtocol writeFieldBeginWithName: @"noteGuids" type: TType_LIST fieldID: 2]; + { + [outProtocol writeListBeginWithElementType: TType_STRING size: [__noteGuids count]]; + int i127; + for (i127 = 0; i127 < [__noteGuids count]; i127++) + { + [outProtocol writeString: [__noteGuids objectAtIndex: i127]]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"expungeNotes_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",noteGuids:"]; + [ms appendFormat: @"%@", __noteGuids]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMExpungeNotes_result : NSObject { + int32_t __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=success, setter=setSuccess:) int32_t success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int32_t) success; +- (void) setSuccess: (int32_t) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMExpungeNotes_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = success; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [decoder decodeInt32ForKey: @"success"]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeInt32: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (int32_t) success { + return __success; +} + +- (void) setSuccess: (int32_t) success { + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setSuccess: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"ExpungeNotes_result"]; + + if (__success_isset) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_I32 fieldID: 0]; + [outProtocol writeI32: __success]; + [outProtocol writeFieldEnd]; + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"ExpungeNotes_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%i", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMexpungeInactiveNotes_args : NSObject { + NSString * __authenticationToken; + + BOOL __authenticationToken_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +@end + +@implementation EDAMexpungeInactiveNotes_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"expungeInactiveNotes_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"expungeInactiveNotes_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMExpungeInactiveNotes_result : NSObject { + int32_t __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=success, setter=setSuccess:) int32_t success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int32_t) success; +- (void) setSuccess: (int32_t) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMExpungeInactiveNotes_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = success; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [decoder decodeInt32ForKey: @"success"]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeInt32: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__userException release]; + [__systemException release]; + [super dealloc]; +} + +- (int32_t) success { + return __success; +} + +- (void) setSuccess: (int32_t) success { + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setSuccess: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"ExpungeInactiveNotes_result"]; + + if (__success_isset) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_I32 fieldID: 0]; + [outProtocol writeI32: __success]; + [outProtocol writeFieldEnd]; + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"ExpungeInactiveNotes_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%i", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMcopyNote_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __noteGuid; + EDAMGuid __toNotebookGuid; + + BOOL __authenticationToken_isset; + BOOL __noteGuid_isset; + BOOL __toNotebookGuid_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=noteGuid, setter=setNoteGuid:) EDAMGuid noteGuid; +@property (nonatomic, retain, getter=toNotebookGuid, setter=setToNotebookGuid:) EDAMGuid toNotebookGuid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken noteGuid: (EDAMGuid) noteGuid toNotebookGuid: (EDAMGuid) toNotebookGuid; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) noteGuid; +- (void) setNoteGuid: (EDAMGuid) noteGuid; +- (BOOL) noteGuidIsSet; + +- (EDAMGuid) toNotebookGuid; +- (void) setToNotebookGuid: (EDAMGuid) toNotebookGuid; +- (BOOL) toNotebookGuidIsSet; + +@end + +@implementation EDAMcopyNote_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic noteGuid; +@dynamic toNotebookGuid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken noteGuid: (EDAMGuid) noteGuid toNotebookGuid: (EDAMGuid) toNotebookGuid +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __noteGuid = [noteGuid retain]; + __noteGuid_isset = YES; + __toNotebookGuid = [toNotebookGuid retain]; + __toNotebookGuid_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"noteGuid"]) + { + __noteGuid = [[decoder decodeObjectForKey: @"noteGuid"] retain]; + __noteGuid_isset = YES; + } + if ([decoder containsValueForKey: @"toNotebookGuid"]) + { + __toNotebookGuid = [[decoder decodeObjectForKey: @"toNotebookGuid"] retain]; + __toNotebookGuid_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__noteGuid_isset) + { + [encoder encodeObject: __noteGuid forKey: @"noteGuid"]; + } + if (__toNotebookGuid_isset) + { + [encoder encodeObject: __toNotebookGuid forKey: @"toNotebookGuid"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__noteGuid release]; + [__toNotebookGuid release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) noteGuid { + return [[__noteGuid retain] autorelease]; +} + +- (void) setNoteGuid: (NSString *) noteGuid { + [noteGuid retain]; + [__noteGuid release]; + __noteGuid = noteGuid; + __noteGuid_isset = YES; +} + +- (BOOL) noteGuidIsSet { + return __noteGuid_isset; +} + +- (void) unsetNoteGuid { + [__noteGuid release]; + __noteGuid = nil; + __noteGuid_isset = NO; +} + +- (NSString *) toNotebookGuid { + return [[__toNotebookGuid retain] autorelease]; +} + +- (void) setToNotebookGuid: (NSString *) toNotebookGuid { + [toNotebookGuid retain]; + [__toNotebookGuid release]; + __toNotebookGuid = toNotebookGuid; + __toNotebookGuid_isset = YES; +} + +- (BOOL) toNotebookGuidIsSet { + return __toNotebookGuid_isset; +} + +- (void) unsetToNotebookGuid { + [__toNotebookGuid release]; + __toNotebookGuid = nil; + __toNotebookGuid_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setNoteGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setToNotebookGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"copyNote_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__noteGuid_isset) { + if (__noteGuid != nil) { + [outProtocol writeFieldBeginWithName: @"noteGuid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __noteGuid]; + [outProtocol writeFieldEnd]; + } + } + if (__toNotebookGuid_isset) { + if (__toNotebookGuid != nil) { + [outProtocol writeFieldBeginWithName: @"toNotebookGuid" type: TType_STRING fieldID: 3]; + [outProtocol writeString: __toNotebookGuid]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"copyNote_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",noteGuid:"]; + [ms appendFormat: @"\"%@\"", __noteGuid]; + [ms appendString: @",toNotebookGuid:"]; + [ms appendFormat: @"\"%@\"", __toNotebookGuid]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMCopyNote_result : NSObject { + EDAMNote * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMNote * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (EDAMNote *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMNote *) success; +- (void) setSuccess: (EDAMNote *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMCopyNote_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (EDAMNote *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (EDAMNote *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMNote *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMNote *fieldValue = [[EDAMNote alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"CopyNote_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"CopyNote_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMlistNoteVersions_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __noteGuid; + + BOOL __authenticationToken_isset; + BOOL __noteGuid_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=noteGuid, setter=setNoteGuid:) EDAMGuid noteGuid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken noteGuid: (EDAMGuid) noteGuid; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) noteGuid; +- (void) setNoteGuid: (EDAMGuid) noteGuid; +- (BOOL) noteGuidIsSet; + +@end + +@implementation EDAMlistNoteVersions_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic noteGuid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken noteGuid: (EDAMGuid) noteGuid +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __noteGuid = [noteGuid retain]; + __noteGuid_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"noteGuid"]) + { + __noteGuid = [[decoder decodeObjectForKey: @"noteGuid"] retain]; + __noteGuid_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__noteGuid_isset) + { + [encoder encodeObject: __noteGuid forKey: @"noteGuid"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__noteGuid release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) noteGuid { + return [[__noteGuid retain] autorelease]; +} + +- (void) setNoteGuid: (NSString *) noteGuid { + [noteGuid retain]; + [__noteGuid release]; + __noteGuid = noteGuid; + __noteGuid_isset = YES; +} + +- (BOOL) noteGuidIsSet { + return __noteGuid_isset; +} + +- (void) unsetNoteGuid { + [__noteGuid release]; + __noteGuid = nil; + __noteGuid_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setNoteGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"listNoteVersions_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__noteGuid_isset) { + if (__noteGuid != nil) { + [outProtocol writeFieldBeginWithName: @"noteGuid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __noteGuid]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"listNoteVersions_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",noteGuid:"]; + [ms appendFormat: @"\"%@\"", __noteGuid]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMListNoteVersions_result : NSObject { + NSArray * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) NSArray * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (NSArray *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSArray *) success; +- (void) setSuccess: (NSArray *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMListNoteVersions_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (NSArray *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (NSArray *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (NSArray *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_LIST) { + int _size128; + [inProtocol readListBeginReturningElementType: NULL size: &_size128]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size128]; + int _i129; + for (_i129 = 0; _i129 < _size128; ++_i129) + { + EDAMNoteVersionId *_elem130 = [[EDAMNoteVersionId alloc] init]; + [_elem130 read: inProtocol]; + [fieldValue addObject: _elem130]; + [_elem130 release]; + } + [inProtocol readListEnd]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"ListNoteVersions_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_LIST fieldID: 0]; + { + [outProtocol writeListBeginWithElementType: TType_STRUCT size: [__success count]]; + int i132; + for (i132 = 0; i132 < [__success count]; i132++) + { + [[__success objectAtIndex: i132] write: outProtocol]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"ListNoteVersions_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetNoteVersion_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __noteGuid; + int32_t __updateSequenceNum; + BOOL __withResourcesData; + BOOL __withResourcesRecognition; + BOOL __withResourcesAlternateData; + + BOOL __authenticationToken_isset; + BOOL __noteGuid_isset; + BOOL __updateSequenceNum_isset; + BOOL __withResourcesData_isset; + BOOL __withResourcesRecognition_isset; + BOOL __withResourcesAlternateData_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=noteGuid, setter=setNoteGuid:) EDAMGuid noteGuid; +@property (nonatomic, getter=updateSequenceNum, setter=setUpdateSequenceNum:) int32_t updateSequenceNum; +@property (nonatomic, getter=withResourcesData, setter=setWithResourcesData:) BOOL withResourcesData; +@property (nonatomic, getter=withResourcesRecognition, setter=setWithResourcesRecognition:) BOOL withResourcesRecognition; +@property (nonatomic, getter=withResourcesAlternateData, setter=setWithResourcesAlternateData:) BOOL withResourcesAlternateData; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken noteGuid: (EDAMGuid) noteGuid updateSequenceNum: (int32_t) updateSequenceNum withResourcesData: (BOOL) withResourcesData withResourcesRecognition: (BOOL) withResourcesRecognition withResourcesAlternateData: (BOOL) withResourcesAlternateData; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) noteGuid; +- (void) setNoteGuid: (EDAMGuid) noteGuid; +- (BOOL) noteGuidIsSet; + +- (int32_t) updateSequenceNum; +- (void) setUpdateSequenceNum: (int32_t) updateSequenceNum; +- (BOOL) updateSequenceNumIsSet; + +- (BOOL) withResourcesData; +- (void) setWithResourcesData: (BOOL) withResourcesData; +- (BOOL) withResourcesDataIsSet; + +- (BOOL) withResourcesRecognition; +- (void) setWithResourcesRecognition: (BOOL) withResourcesRecognition; +- (BOOL) withResourcesRecognitionIsSet; + +- (BOOL) withResourcesAlternateData; +- (void) setWithResourcesAlternateData: (BOOL) withResourcesAlternateData; +- (BOOL) withResourcesAlternateDataIsSet; + +@end + +@implementation EDAMgetNoteVersion_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic noteGuid; +@dynamic updateSequenceNum; +@dynamic withResourcesData; +@dynamic withResourcesRecognition; +@dynamic withResourcesAlternateData; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken noteGuid: (EDAMGuid) noteGuid updateSequenceNum: (int32_t) updateSequenceNum withResourcesData: (BOOL) withResourcesData withResourcesRecognition: (BOOL) withResourcesRecognition withResourcesAlternateData: (BOOL) withResourcesAlternateData +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __noteGuid = [noteGuid retain]; + __noteGuid_isset = YES; + __updateSequenceNum = updateSequenceNum; + __updateSequenceNum_isset = YES; + __withResourcesData = withResourcesData; + __withResourcesData_isset = YES; + __withResourcesRecognition = withResourcesRecognition; + __withResourcesRecognition_isset = YES; + __withResourcesAlternateData = withResourcesAlternateData; + __withResourcesAlternateData_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"noteGuid"]) + { + __noteGuid = [[decoder decodeObjectForKey: @"noteGuid"] retain]; + __noteGuid_isset = YES; + } + if ([decoder containsValueForKey: @"updateSequenceNum"]) + { + __updateSequenceNum = [decoder decodeInt32ForKey: @"updateSequenceNum"]; + __updateSequenceNum_isset = YES; + } + if ([decoder containsValueForKey: @"withResourcesData"]) + { + __withResourcesData = [decoder decodeBoolForKey: @"withResourcesData"]; + __withResourcesData_isset = YES; + } + if ([decoder containsValueForKey: @"withResourcesRecognition"]) + { + __withResourcesRecognition = [decoder decodeBoolForKey: @"withResourcesRecognition"]; + __withResourcesRecognition_isset = YES; + } + if ([decoder containsValueForKey: @"withResourcesAlternateData"]) + { + __withResourcesAlternateData = [decoder decodeBoolForKey: @"withResourcesAlternateData"]; + __withResourcesAlternateData_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__noteGuid_isset) + { + [encoder encodeObject: __noteGuid forKey: @"noteGuid"]; + } + if (__updateSequenceNum_isset) + { + [encoder encodeInt32: __updateSequenceNum forKey: @"updateSequenceNum"]; + } + if (__withResourcesData_isset) + { + [encoder encodeBool: __withResourcesData forKey: @"withResourcesData"]; + } + if (__withResourcesRecognition_isset) + { + [encoder encodeBool: __withResourcesRecognition forKey: @"withResourcesRecognition"]; + } + if (__withResourcesAlternateData_isset) + { + [encoder encodeBool: __withResourcesAlternateData forKey: @"withResourcesAlternateData"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__noteGuid release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) noteGuid { + return [[__noteGuid retain] autorelease]; +} + +- (void) setNoteGuid: (NSString *) noteGuid { + [noteGuid retain]; + [__noteGuid release]; + __noteGuid = noteGuid; + __noteGuid_isset = YES; +} + +- (BOOL) noteGuidIsSet { + return __noteGuid_isset; +} + +- (void) unsetNoteGuid { + [__noteGuid release]; + __noteGuid = nil; + __noteGuid_isset = NO; +} + +- (int32_t) updateSequenceNum { + return __updateSequenceNum; +} + +- (void) setUpdateSequenceNum: (int32_t) updateSequenceNum { + __updateSequenceNum = updateSequenceNum; + __updateSequenceNum_isset = YES; +} + +- (BOOL) updateSequenceNumIsSet { + return __updateSequenceNum_isset; +} + +- (void) unsetUpdateSequenceNum { + __updateSequenceNum_isset = NO; +} + +- (BOOL) withResourcesData { + return __withResourcesData; +} + +- (void) setWithResourcesData: (BOOL) withResourcesData { + __withResourcesData = withResourcesData; + __withResourcesData_isset = YES; +} + +- (BOOL) withResourcesDataIsSet { + return __withResourcesData_isset; +} + +- (void) unsetWithResourcesData { + __withResourcesData_isset = NO; +} + +- (BOOL) withResourcesRecognition { + return __withResourcesRecognition; +} + +- (void) setWithResourcesRecognition: (BOOL) withResourcesRecognition { + __withResourcesRecognition = withResourcesRecognition; + __withResourcesRecognition_isset = YES; +} + +- (BOOL) withResourcesRecognitionIsSet { + return __withResourcesRecognition_isset; +} + +- (void) unsetWithResourcesRecognition { + __withResourcesRecognition_isset = NO; +} + +- (BOOL) withResourcesAlternateData { + return __withResourcesAlternateData; +} + +- (void) setWithResourcesAlternateData: (BOOL) withResourcesAlternateData { + __withResourcesAlternateData = withResourcesAlternateData; + __withResourcesAlternateData_isset = YES; +} + +- (BOOL) withResourcesAlternateDataIsSet { + return __withResourcesAlternateData_isset; +} + +- (void) unsetWithResourcesAlternateData { + __withResourcesAlternateData_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setNoteGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setUpdateSequenceNum: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setWithResourcesData: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 5: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setWithResourcesRecognition: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 6: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setWithResourcesAlternateData: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getNoteVersion_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__noteGuid_isset) { + if (__noteGuid != nil) { + [outProtocol writeFieldBeginWithName: @"noteGuid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __noteGuid]; + [outProtocol writeFieldEnd]; + } + } + if (__updateSequenceNum_isset) { + [outProtocol writeFieldBeginWithName: @"updateSequenceNum" type: TType_I32 fieldID: 3]; + [outProtocol writeI32: __updateSequenceNum]; + [outProtocol writeFieldEnd]; + } + if (__withResourcesData_isset) { + [outProtocol writeFieldBeginWithName: @"withResourcesData" type: TType_BOOL fieldID: 4]; + [outProtocol writeBool: __withResourcesData]; + [outProtocol writeFieldEnd]; + } + if (__withResourcesRecognition_isset) { + [outProtocol writeFieldBeginWithName: @"withResourcesRecognition" type: TType_BOOL fieldID: 5]; + [outProtocol writeBool: __withResourcesRecognition]; + [outProtocol writeFieldEnd]; + } + if (__withResourcesAlternateData_isset) { + [outProtocol writeFieldBeginWithName: @"withResourcesAlternateData" type: TType_BOOL fieldID: 6]; + [outProtocol writeBool: __withResourcesAlternateData]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getNoteVersion_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",noteGuid:"]; + [ms appendFormat: @"\"%@\"", __noteGuid]; + [ms appendString: @",updateSequenceNum:"]; + [ms appendFormat: @"%i", __updateSequenceNum]; + [ms appendString: @",withResourcesData:"]; + [ms appendFormat: @"%i", __withResourcesData]; + [ms appendString: @",withResourcesRecognition:"]; + [ms appendFormat: @"%i", __withResourcesRecognition]; + [ms appendString: @",withResourcesAlternateData:"]; + [ms appendFormat: @"%i", __withResourcesAlternateData]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetNoteVersion_result : NSObject { + EDAMNote * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMNote * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (EDAMNote *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMNote *) success; +- (void) setSuccess: (EDAMNote *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMGetNoteVersion_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (EDAMNote *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (EDAMNote *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMNote *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMNote *fieldValue = [[EDAMNote alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetNoteVersion_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetNoteVersion_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetResource_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __guid; + BOOL __withData; + BOOL __withRecognition; + BOOL __withAttributes; + BOOL __withAlternateData; + + BOOL __authenticationToken_isset; + BOOL __guid_isset; + BOOL __withData_isset; + BOOL __withRecognition_isset; + BOOL __withAttributes_isset; + BOOL __withAlternateData_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +@property (nonatomic, getter=withData, setter=setWithData:) BOOL withData; +@property (nonatomic, getter=withRecognition, setter=setWithRecognition:) BOOL withRecognition; +@property (nonatomic, getter=withAttributes, setter=setWithAttributes:) BOOL withAttributes; +@property (nonatomic, getter=withAlternateData, setter=setWithAlternateData:) BOOL withAlternateData; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid withData: (BOOL) withData withRecognition: (BOOL) withRecognition withAttributes: (BOOL) withAttributes withAlternateData: (BOOL) withAlternateData; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +- (BOOL) withData; +- (void) setWithData: (BOOL) withData; +- (BOOL) withDataIsSet; + +- (BOOL) withRecognition; +- (void) setWithRecognition: (BOOL) withRecognition; +- (BOOL) withRecognitionIsSet; + +- (BOOL) withAttributes; +- (void) setWithAttributes: (BOOL) withAttributes; +- (BOOL) withAttributesIsSet; + +- (BOOL) withAlternateData; +- (void) setWithAlternateData: (BOOL) withAlternateData; +- (BOOL) withAlternateDataIsSet; + +@end + +@implementation EDAMgetResource_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic guid; +@dynamic withData; +@dynamic withRecognition; +@dynamic withAttributes; +@dynamic withAlternateData; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid withData: (BOOL) withData withRecognition: (BOOL) withRecognition withAttributes: (BOOL) withAttributes withAlternateData: (BOOL) withAlternateData +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __guid = [guid retain]; + __guid_isset = YES; + __withData = withData; + __withData_isset = YES; + __withRecognition = withRecognition; + __withRecognition_isset = YES; + __withAttributes = withAttributes; + __withAttributes_isset = YES; + __withAlternateData = withAlternateData; + __withAlternateData_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + if ([decoder containsValueForKey: @"withData"]) + { + __withData = [decoder decodeBoolForKey: @"withData"]; + __withData_isset = YES; + } + if ([decoder containsValueForKey: @"withRecognition"]) + { + __withRecognition = [decoder decodeBoolForKey: @"withRecognition"]; + __withRecognition_isset = YES; + } + if ([decoder containsValueForKey: @"withAttributes"]) + { + __withAttributes = [decoder decodeBoolForKey: @"withAttributes"]; + __withAttributes_isset = YES; + } + if ([decoder containsValueForKey: @"withAlternateData"]) + { + __withAlternateData = [decoder decodeBoolForKey: @"withAlternateData"]; + __withAlternateData_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } + if (__withData_isset) + { + [encoder encodeBool: __withData forKey: @"withData"]; + } + if (__withRecognition_isset) + { + [encoder encodeBool: __withRecognition forKey: @"withRecognition"]; + } + if (__withAttributes_isset) + { + [encoder encodeBool: __withAttributes forKey: @"withAttributes"]; + } + if (__withAlternateData_isset) + { + [encoder encodeBool: __withAlternateData forKey: @"withAlternateData"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__guid release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (BOOL) withData { + return __withData; +} + +- (void) setWithData: (BOOL) withData { + __withData = withData; + __withData_isset = YES; +} + +- (BOOL) withDataIsSet { + return __withData_isset; +} + +- (void) unsetWithData { + __withData_isset = NO; +} + +- (BOOL) withRecognition { + return __withRecognition; +} + +- (void) setWithRecognition: (BOOL) withRecognition { + __withRecognition = withRecognition; + __withRecognition_isset = YES; +} + +- (BOOL) withRecognitionIsSet { + return __withRecognition_isset; +} + +- (void) unsetWithRecognition { + __withRecognition_isset = NO; +} + +- (BOOL) withAttributes { + return __withAttributes; +} + +- (void) setWithAttributes: (BOOL) withAttributes { + __withAttributes = withAttributes; + __withAttributes_isset = YES; +} + +- (BOOL) withAttributesIsSet { + return __withAttributes_isset; +} + +- (void) unsetWithAttributes { + __withAttributes_isset = NO; +} + +- (BOOL) withAlternateData { + return __withAlternateData; +} + +- (void) setWithAlternateData: (BOOL) withAlternateData { + __withAlternateData = withAlternateData; + __withAlternateData_isset = YES; +} + +- (BOOL) withAlternateDataIsSet { + return __withAlternateData_isset; +} + +- (void) unsetWithAlternateData { + __withAlternateData_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setWithData: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setWithRecognition: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 5: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setWithAttributes: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 6: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setWithAlternateData: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getResource_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + if (__withData_isset) { + [outProtocol writeFieldBeginWithName: @"withData" type: TType_BOOL fieldID: 3]; + [outProtocol writeBool: __withData]; + [outProtocol writeFieldEnd]; + } + if (__withRecognition_isset) { + [outProtocol writeFieldBeginWithName: @"withRecognition" type: TType_BOOL fieldID: 4]; + [outProtocol writeBool: __withRecognition]; + [outProtocol writeFieldEnd]; + } + if (__withAttributes_isset) { + [outProtocol writeFieldBeginWithName: @"withAttributes" type: TType_BOOL fieldID: 5]; + [outProtocol writeBool: __withAttributes]; + [outProtocol writeFieldEnd]; + } + if (__withAlternateData_isset) { + [outProtocol writeFieldBeginWithName: @"withAlternateData" type: TType_BOOL fieldID: 6]; + [outProtocol writeBool: __withAlternateData]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getResource_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @",withData:"]; + [ms appendFormat: @"%i", __withData]; + [ms appendString: @",withRecognition:"]; + [ms appendFormat: @"%i", __withRecognition]; + [ms appendString: @",withAttributes:"]; + [ms appendFormat: @"%i", __withAttributes]; + [ms appendString: @",withAlternateData:"]; + [ms appendFormat: @"%i", __withAlternateData]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetResource_result : NSObject { + EDAMResource * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMResource * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (EDAMResource *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMResource *) success; +- (void) setSuccess: (EDAMResource *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMGetResource_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (EDAMResource *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (EDAMResource *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMResource *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMResource *fieldValue = [[EDAMResource alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetResource_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetResource_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMupdateResource_args : NSObject { + NSString * __authenticationToken; + EDAMResource * __resource; + + BOOL __authenticationToken_isset; + BOOL __resource_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=resource, setter=setResource:) EDAMResource * resource; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken resource: (EDAMResource *) resource; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMResource *) resource; +- (void) setResource: (EDAMResource *) resource; +- (BOOL) resourceIsSet; + +@end + +@implementation EDAMupdateResource_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic resource; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken resource: (EDAMResource *) resource +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __resource = [resource retain]; + __resource_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"resource"]) + { + __resource = [[decoder decodeObjectForKey: @"resource"] retain]; + __resource_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__resource_isset) + { + [encoder encodeObject: __resource forKey: @"resource"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__resource release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (EDAMResource *) resource { + return [[__resource retain] autorelease]; +} + +- (void) setResource: (EDAMResource *) resource { + [resource retain]; + [__resource release]; + __resource = resource; + __resource_isset = YES; +} + +- (BOOL) resourceIsSet { + return __resource_isset; +} + +- (void) unsetResource { + [__resource release]; + __resource = nil; + __resource_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMResource *fieldValue = [[EDAMResource alloc] init]; + [fieldValue read: inProtocol]; + [self setResource: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"updateResource_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__resource_isset) { + if (__resource != nil) { + [outProtocol writeFieldBeginWithName: @"resource" type: TType_STRUCT fieldID: 2]; + [__resource write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"updateResource_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",resource:"]; + [ms appendFormat: @"%@", __resource]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMUpdateResource_result : NSObject { + int32_t __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=success, setter=setSuccess:) int32_t success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int32_t) success; +- (void) setSuccess: (int32_t) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMUpdateResource_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = success; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [decoder decodeInt32ForKey: @"success"]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeInt32: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (int32_t) success { + return __success; +} + +- (void) setSuccess: (int32_t) success { + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setSuccess: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"UpdateResource_result"]; + + if (__success_isset) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_I32 fieldID: 0]; + [outProtocol writeI32: __success]; + [outProtocol writeFieldEnd]; + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"UpdateResource_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%i", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetResourceData_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __guid; + + BOOL __authenticationToken_isset; + BOOL __guid_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +@end + +@implementation EDAMgetResourceData_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __guid = [guid retain]; + __guid_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__guid release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getResourceData_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getResourceData_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetResourceData_result : NSObject { + NSData * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) NSData * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (NSData *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSData *) success; +- (void) setSuccess: (NSData *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMGetResourceData_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (NSData *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (NSData *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (NSData *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRING) { + NSData * fieldValue = [inProtocol readBinary]; + [self setSuccess: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetResourceData_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRING fieldID: 0]; + [outProtocol writeBinary: __success]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetResourceData_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"\"%@\"", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetResourceByHash_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __noteGuid; + NSData * __contentHash; + BOOL __withData; + BOOL __withRecognition; + BOOL __withAlternateData; + + BOOL __authenticationToken_isset; + BOOL __noteGuid_isset; + BOOL __contentHash_isset; + BOOL __withData_isset; + BOOL __withRecognition_isset; + BOOL __withAlternateData_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=noteGuid, setter=setNoteGuid:) EDAMGuid noteGuid; +@property (nonatomic, retain, getter=contentHash, setter=setContentHash:) NSData * contentHash; +@property (nonatomic, getter=withData, setter=setWithData:) BOOL withData; +@property (nonatomic, getter=withRecognition, setter=setWithRecognition:) BOOL withRecognition; +@property (nonatomic, getter=withAlternateData, setter=setWithAlternateData:) BOOL withAlternateData; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken noteGuid: (EDAMGuid) noteGuid contentHash: (NSData *) contentHash withData: (BOOL) withData withRecognition: (BOOL) withRecognition withAlternateData: (BOOL) withAlternateData; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) noteGuid; +- (void) setNoteGuid: (EDAMGuid) noteGuid; +- (BOOL) noteGuidIsSet; + +- (NSData *) contentHash; +- (void) setContentHash: (NSData *) contentHash; +- (BOOL) contentHashIsSet; + +- (BOOL) withData; +- (void) setWithData: (BOOL) withData; +- (BOOL) withDataIsSet; + +- (BOOL) withRecognition; +- (void) setWithRecognition: (BOOL) withRecognition; +- (BOOL) withRecognitionIsSet; + +- (BOOL) withAlternateData; +- (void) setWithAlternateData: (BOOL) withAlternateData; +- (BOOL) withAlternateDataIsSet; + +@end + +@implementation EDAMgetResourceByHash_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic noteGuid; +@dynamic contentHash; +@dynamic withData; +@dynamic withRecognition; +@dynamic withAlternateData; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken noteGuid: (EDAMGuid) noteGuid contentHash: (NSData *) contentHash withData: (BOOL) withData withRecognition: (BOOL) withRecognition withAlternateData: (BOOL) withAlternateData +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __noteGuid = [noteGuid retain]; + __noteGuid_isset = YES; + __contentHash = [contentHash retain]; + __contentHash_isset = YES; + __withData = withData; + __withData_isset = YES; + __withRecognition = withRecognition; + __withRecognition_isset = YES; + __withAlternateData = withAlternateData; + __withAlternateData_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"noteGuid"]) + { + __noteGuid = [[decoder decodeObjectForKey: @"noteGuid"] retain]; + __noteGuid_isset = YES; + } + if ([decoder containsValueForKey: @"contentHash"]) + { + __contentHash = [[decoder decodeObjectForKey: @"contentHash"] retain]; + __contentHash_isset = YES; + } + if ([decoder containsValueForKey: @"withData"]) + { + __withData = [decoder decodeBoolForKey: @"withData"]; + __withData_isset = YES; + } + if ([decoder containsValueForKey: @"withRecognition"]) + { + __withRecognition = [decoder decodeBoolForKey: @"withRecognition"]; + __withRecognition_isset = YES; + } + if ([decoder containsValueForKey: @"withAlternateData"]) + { + __withAlternateData = [decoder decodeBoolForKey: @"withAlternateData"]; + __withAlternateData_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__noteGuid_isset) + { + [encoder encodeObject: __noteGuid forKey: @"noteGuid"]; + } + if (__contentHash_isset) + { + [encoder encodeObject: __contentHash forKey: @"contentHash"]; + } + if (__withData_isset) + { + [encoder encodeBool: __withData forKey: @"withData"]; + } + if (__withRecognition_isset) + { + [encoder encodeBool: __withRecognition forKey: @"withRecognition"]; + } + if (__withAlternateData_isset) + { + [encoder encodeBool: __withAlternateData forKey: @"withAlternateData"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__noteGuid release]; + [__contentHash release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) noteGuid { + return [[__noteGuid retain] autorelease]; +} + +- (void) setNoteGuid: (NSString *) noteGuid { + [noteGuid retain]; + [__noteGuid release]; + __noteGuid = noteGuid; + __noteGuid_isset = YES; +} + +- (BOOL) noteGuidIsSet { + return __noteGuid_isset; +} + +- (void) unsetNoteGuid { + [__noteGuid release]; + __noteGuid = nil; + __noteGuid_isset = NO; +} + +- (NSData *) contentHash { + return [[__contentHash retain] autorelease]; +} + +- (void) setContentHash: (NSData *) contentHash { + [contentHash retain]; + [__contentHash release]; + __contentHash = contentHash; + __contentHash_isset = YES; +} + +- (BOOL) contentHashIsSet { + return __contentHash_isset; +} + +- (void) unsetContentHash { + [__contentHash release]; + __contentHash = nil; + __contentHash_isset = NO; +} + +- (BOOL) withData { + return __withData; +} + +- (void) setWithData: (BOOL) withData { + __withData = withData; + __withData_isset = YES; +} + +- (BOOL) withDataIsSet { + return __withData_isset; +} + +- (void) unsetWithData { + __withData_isset = NO; +} + +- (BOOL) withRecognition { + return __withRecognition; +} + +- (void) setWithRecognition: (BOOL) withRecognition { + __withRecognition = withRecognition; + __withRecognition_isset = YES; +} + +- (BOOL) withRecognitionIsSet { + return __withRecognition_isset; +} + +- (void) unsetWithRecognition { + __withRecognition_isset = NO; +} + +- (BOOL) withAlternateData { + return __withAlternateData; +} + +- (void) setWithAlternateData: (BOOL) withAlternateData { + __withAlternateData = withAlternateData; + __withAlternateData_isset = YES; +} + +- (BOOL) withAlternateDataIsSet { + return __withAlternateData_isset; +} + +- (void) unsetWithAlternateData { + __withAlternateData_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setNoteGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRING) { + NSData * fieldValue = [inProtocol readBinary]; + [self setContentHash: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setWithData: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 5: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setWithRecognition: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 6: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setWithAlternateData: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getResourceByHash_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__noteGuid_isset) { + if (__noteGuid != nil) { + [outProtocol writeFieldBeginWithName: @"noteGuid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __noteGuid]; + [outProtocol writeFieldEnd]; + } + } + if (__contentHash_isset) { + if (__contentHash != nil) { + [outProtocol writeFieldBeginWithName: @"contentHash" type: TType_STRING fieldID: 3]; + [outProtocol writeBinary: __contentHash]; + [outProtocol writeFieldEnd]; + } + } + if (__withData_isset) { + [outProtocol writeFieldBeginWithName: @"withData" type: TType_BOOL fieldID: 4]; + [outProtocol writeBool: __withData]; + [outProtocol writeFieldEnd]; + } + if (__withRecognition_isset) { + [outProtocol writeFieldBeginWithName: @"withRecognition" type: TType_BOOL fieldID: 5]; + [outProtocol writeBool: __withRecognition]; + [outProtocol writeFieldEnd]; + } + if (__withAlternateData_isset) { + [outProtocol writeFieldBeginWithName: @"withAlternateData" type: TType_BOOL fieldID: 6]; + [outProtocol writeBool: __withAlternateData]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getResourceByHash_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",noteGuid:"]; + [ms appendFormat: @"\"%@\"", __noteGuid]; + [ms appendString: @",contentHash:"]; + [ms appendFormat: @"\"%@\"", __contentHash]; + [ms appendString: @",withData:"]; + [ms appendFormat: @"%i", __withData]; + [ms appendString: @",withRecognition:"]; + [ms appendFormat: @"%i", __withRecognition]; + [ms appendString: @",withAlternateData:"]; + [ms appendFormat: @"%i", __withAlternateData]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetResourceByHash_result : NSObject { + EDAMResource * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMResource * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (EDAMResource *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMResource *) success; +- (void) setSuccess: (EDAMResource *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMGetResourceByHash_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (EDAMResource *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (EDAMResource *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMResource *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMResource *fieldValue = [[EDAMResource alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetResourceByHash_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetResourceByHash_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetResourceRecognition_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __guid; + + BOOL __authenticationToken_isset; + BOOL __guid_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +@end + +@implementation EDAMgetResourceRecognition_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __guid = [guid retain]; + __guid_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__guid release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getResourceRecognition_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getResourceRecognition_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetResourceRecognition_result : NSObject { + NSData * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) NSData * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (NSData *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSData *) success; +- (void) setSuccess: (NSData *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMGetResourceRecognition_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (NSData *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (NSData *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (NSData *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRING) { + NSData * fieldValue = [inProtocol readBinary]; + [self setSuccess: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetResourceRecognition_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRING fieldID: 0]; + [outProtocol writeBinary: __success]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetResourceRecognition_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"\"%@\"", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetResourceAlternateData_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __guid; + + BOOL __authenticationToken_isset; + BOOL __guid_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +@end + +@implementation EDAMgetResourceAlternateData_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __guid = [guid retain]; + __guid_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__guid release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getResourceAlternateData_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getResourceAlternateData_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetResourceAlternateData_result : NSObject { + NSData * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) NSData * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (NSData *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSData *) success; +- (void) setSuccess: (NSData *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMGetResourceAlternateData_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (NSData *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (NSData *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (NSData *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRING) { + NSData * fieldValue = [inProtocol readBinary]; + [self setSuccess: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetResourceAlternateData_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRING fieldID: 0]; + [outProtocol writeBinary: __success]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetResourceAlternateData_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"\"%@\"", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetResourceAttributes_args : NSObject { + NSString * __authenticationToken; + EDAMGuid __guid; + + BOOL __authenticationToken_isset; + BOOL __guid_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +@end + +@implementation EDAMgetResourceAttributes_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic guid; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken guid: (EDAMGuid) guid +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __guid = [guid retain]; + __guid_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__guid release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getResourceAttributes_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getResourceAttributes_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetResourceAttributes_result : NSObject { + EDAMResourceAttributes * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMResourceAttributes * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (EDAMResourceAttributes *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMResourceAttributes *) success; +- (void) setSuccess: (EDAMResourceAttributes *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMGetResourceAttributes_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (EDAMResourceAttributes *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (EDAMResourceAttributes *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMResourceAttributes *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMResourceAttributes *fieldValue = [[EDAMResourceAttributes alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetResourceAttributes_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 3]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetResourceAttributes_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetAccountSize_args : NSObject { + NSString * __authenticationToken; + + BOOL __authenticationToken_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +@end + +@implementation EDAMgetAccountSize_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getAccountSize_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getAccountSize_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetAccountSize_result : NSObject { + int64_t __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=success, setter=setSuccess:) int64_t success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (int64_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int64_t) success; +- (void) setSuccess: (int64_t) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMGetAccountSize_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (int64_t) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = success; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [decoder decodeInt64ForKey: @"success"]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeInt64: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__userException release]; + [__systemException release]; + [super dealloc]; +} + +- (int64_t) success { + return __success; +} + +- (void) setSuccess: (int64_t) success { + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setSuccess: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetAccountSize_result"]; + + if (__success_isset) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_I64 fieldID: 0]; + [outProtocol writeI64: __success]; + [outProtocol writeFieldEnd]; + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetAccountSize_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%qi", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetAds_args : NSObject { + NSString * __authenticationToken; + EDAMAdParameters * __adParameters; + + BOOL __authenticationToken_isset; + BOOL __adParameters_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=adParameters, setter=setAdParameters:) EDAMAdParameters * adParameters; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken adParameters: (EDAMAdParameters *) adParameters; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMAdParameters *) adParameters; +- (void) setAdParameters: (EDAMAdParameters *) adParameters; +- (BOOL) adParametersIsSet; + +@end + +@implementation EDAMgetAds_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic adParameters; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken adParameters: (EDAMAdParameters *) adParameters +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __adParameters = [adParameters retain]; + __adParameters_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"adParameters"]) + { + __adParameters = [[decoder decodeObjectForKey: @"adParameters"] retain]; + __adParameters_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__adParameters_isset) + { + [encoder encodeObject: __adParameters forKey: @"adParameters"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__adParameters release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (EDAMAdParameters *) adParameters { + return [[__adParameters retain] autorelease]; +} + +- (void) setAdParameters: (EDAMAdParameters *) adParameters { + [adParameters retain]; + [__adParameters release]; + __adParameters = adParameters; + __adParameters_isset = YES; +} + +- (BOOL) adParametersIsSet { + return __adParameters_isset; +} + +- (void) unsetAdParameters { + [__adParameters release]; + __adParameters = nil; + __adParameters_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMAdParameters *fieldValue = [[EDAMAdParameters alloc] init]; + [fieldValue read: inProtocol]; + [self setAdParameters: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getAds_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__adParameters_isset) { + if (__adParameters != nil) { + [outProtocol writeFieldBeginWithName: @"adParameters" type: TType_STRUCT fieldID: 2]; + [__adParameters write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getAds_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",adParameters:"]; + [ms appendFormat: @"%@", __adParameters]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetAds_result : NSObject { + NSArray * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) NSArray * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (NSArray *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSArray *) success; +- (void) setSuccess: (NSArray *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMGetAds_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (NSArray *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [super dealloc]; +} + +- (NSArray *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (NSArray *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_LIST) { + int _size133; + [inProtocol readListBeginReturningElementType: NULL size: &_size133]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size133]; + int _i134; + for (_i134 = 0; _i134 < _size133; ++_i134) + { + EDAMAd *_elem135 = [[EDAMAd alloc] init]; + [_elem135 read: inProtocol]; + [fieldValue addObject: _elem135]; + [_elem135 release]; + } + [inProtocol readListEnd]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetAds_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_LIST fieldID: 0]; + { + [outProtocol writeListBeginWithElementType: TType_STRUCT size: [__success count]]; + int i137; + for (i137 = 0; i137 < [__success count]; i137++) + { + [[__success objectAtIndex: i137] write: outProtocol]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetAds_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetRandomAd_args : NSObject { + NSString * __authenticationToken; + EDAMAdParameters * __adParameters; + + BOOL __authenticationToken_isset; + BOOL __adParameters_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=adParameters, setter=setAdParameters:) EDAMAdParameters * adParameters; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken adParameters: (EDAMAdParameters *) adParameters; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMAdParameters *) adParameters; +- (void) setAdParameters: (EDAMAdParameters *) adParameters; +- (BOOL) adParametersIsSet; + +@end + +@implementation EDAMgetRandomAd_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic adParameters; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken adParameters: (EDAMAdParameters *) adParameters +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __adParameters = [adParameters retain]; + __adParameters_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"adParameters"]) + { + __adParameters = [[decoder decodeObjectForKey: @"adParameters"] retain]; + __adParameters_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__adParameters_isset) + { + [encoder encodeObject: __adParameters forKey: @"adParameters"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__adParameters release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (EDAMAdParameters *) adParameters { + return [[__adParameters retain] autorelease]; +} + +- (void) setAdParameters: (EDAMAdParameters *) adParameters { + [adParameters retain]; + [__adParameters release]; + __adParameters = adParameters; + __adParameters_isset = YES; +} + +- (BOOL) adParametersIsSet { + return __adParameters_isset; +} + +- (void) unsetAdParameters { + [__adParameters release]; + __adParameters = nil; + __adParameters_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMAdParameters *fieldValue = [[EDAMAdParameters alloc] init]; + [fieldValue read: inProtocol]; + [self setAdParameters: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getRandomAd_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__adParameters_isset) { + if (__adParameters != nil) { + [outProtocol writeFieldBeginWithName: @"adParameters" type: TType_STRUCT fieldID: 2]; + [__adParameters write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getRandomAd_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",adParameters:"]; + [ms appendFormat: @"%@", __adParameters]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetRandomAd_result : NSObject { + EDAMAd * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMAd * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (EDAMAd *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMAd *) success; +- (void) setSuccess: (EDAMAd *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMGetRandomAd_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (EDAMAd *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [super dealloc]; +} + +- (EDAMAd *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMAd *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMAd *fieldValue = [[EDAMAd alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetRandomAd_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetRandomAd_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetPublicNotebook_args : NSObject { + EDAMUserID __userId; + NSString * __publicUri; + + BOOL __userId_isset; + BOOL __publicUri_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=userId, setter=setUserId:) EDAMUserID userId; +@property (nonatomic, retain, getter=publicUri, setter=setPublicUri:) NSString * publicUri; +#endif + +- (id) initWithUserId: (EDAMUserID) userId publicUri: (NSString *) publicUri; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMUserID) userId; +- (void) setUserId: (EDAMUserID) userId; +- (BOOL) userIdIsSet; + +- (NSString *) publicUri; +- (void) setPublicUri: (NSString *) publicUri; +- (BOOL) publicUriIsSet; + +@end + +@implementation EDAMgetPublicNotebook_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic userId; +@dynamic publicUri; +#endif + +- (id) initWithUserId: (EDAMUserID) userId publicUri: (NSString *) publicUri +{ + self = [super init]; + __userId = userId; + __userId_isset = YES; + __publicUri = [publicUri retain]; + __publicUri_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"userId"]) + { + __userId = [decoder decodeInt32ForKey: @"userId"]; + __userId_isset = YES; + } + if ([decoder containsValueForKey: @"publicUri"]) + { + __publicUri = [[decoder decodeObjectForKey: @"publicUri"] retain]; + __publicUri_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__userId_isset) + { + [encoder encodeInt32: __userId forKey: @"userId"]; + } + if (__publicUri_isset) + { + [encoder encodeObject: __publicUri forKey: @"publicUri"]; + } +} + +- (void) dealloc +{ + [__publicUri release]; + [super dealloc]; +} + +- (int32_t) userId { + return __userId; +} + +- (void) setUserId: (int32_t) userId { + __userId = userId; + __userId_isset = YES; +} + +- (BOOL) userIdIsSet { + return __userId_isset; +} + +- (void) unsetUserId { + __userId_isset = NO; +} + +- (NSString *) publicUri { + return [[__publicUri retain] autorelease]; +} + +- (void) setPublicUri: (NSString *) publicUri { + [publicUri retain]; + [__publicUri release]; + __publicUri = publicUri; + __publicUri_isset = YES; +} + +- (BOOL) publicUriIsSet { + return __publicUri_isset; +} + +- (void) unsetPublicUri { + [__publicUri release]; + __publicUri = nil; + __publicUri_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setUserId: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setPublicUri: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getPublicNotebook_args"]; + if (__userId_isset) { + [outProtocol writeFieldBeginWithName: @"userId" type: TType_I32 fieldID: 1]; + [outProtocol writeI32: __userId]; + [outProtocol writeFieldEnd]; + } + if (__publicUri_isset) { + if (__publicUri != nil) { + [outProtocol writeFieldBeginWithName: @"publicUri" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __publicUri]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getPublicNotebook_args("]; + [ms appendString: @"userId:"]; + [ms appendFormat: @"%i", __userId]; + [ms appendString: @",publicUri:"]; + [ms appendFormat: @"\"%@\"", __publicUri]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetPublicNotebook_result : NSObject { + EDAMNotebook * __success; + EDAMSystemException * __systemException; + EDAMNotFoundException * __notFoundException; + + BOOL __success_isset; + BOOL __systemException_isset; + BOOL __notFoundException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMNotebook * success; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +#endif + +- (id) initWithSuccess: (EDAMNotebook *) success systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMNotebook *) success; +- (void) setSuccess: (EDAMNotebook *) success; +- (BOOL) successIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +@end + +@implementation EDAMGetPublicNotebook_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic systemException; +@dynamic notFoundException; +#endif + +- (id) initWithSuccess: (EDAMNotebook *) success systemException: (EDAMSystemException *) systemException notFoundException: (EDAMNotFoundException *) notFoundException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__systemException release]; + [__notFoundException release]; + [super dealloc]; +} + +- (EDAMNotebook *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMNotebook *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMNotebook *fieldValue = [[EDAMNotebook alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetPublicNotebook_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 1]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 2]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetPublicNotebook_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMcreateSharedNotebook_args : NSObject { + NSString * __authenticationToken; + EDAMSharedNotebook * __sharedNotebook; + + BOOL __authenticationToken_isset; + BOOL __sharedNotebook_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=sharedNotebook, setter=setSharedNotebook:) EDAMSharedNotebook * sharedNotebook; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken sharedNotebook: (EDAMSharedNotebook *) sharedNotebook; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMSharedNotebook *) sharedNotebook; +- (void) setSharedNotebook: (EDAMSharedNotebook *) sharedNotebook; +- (BOOL) sharedNotebookIsSet; + +@end + +@implementation EDAMcreateSharedNotebook_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic sharedNotebook; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken sharedNotebook: (EDAMSharedNotebook *) sharedNotebook +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __sharedNotebook = [sharedNotebook retain]; + __sharedNotebook_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"sharedNotebook"]) + { + __sharedNotebook = [[decoder decodeObjectForKey: @"sharedNotebook"] retain]; + __sharedNotebook_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__sharedNotebook_isset) + { + [encoder encodeObject: __sharedNotebook forKey: @"sharedNotebook"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__sharedNotebook release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (EDAMSharedNotebook *) sharedNotebook { + return [[__sharedNotebook retain] autorelease]; +} + +- (void) setSharedNotebook: (EDAMSharedNotebook *) sharedNotebook { + [sharedNotebook retain]; + [__sharedNotebook release]; + __sharedNotebook = sharedNotebook; + __sharedNotebook_isset = YES; +} + +- (BOOL) sharedNotebookIsSet { + return __sharedNotebook_isset; +} + +- (void) unsetSharedNotebook { + [__sharedNotebook release]; + __sharedNotebook = nil; + __sharedNotebook_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSharedNotebook *fieldValue = [[EDAMSharedNotebook alloc] init]; + [fieldValue read: inProtocol]; + [self setSharedNotebook: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"createSharedNotebook_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__sharedNotebook_isset) { + if (__sharedNotebook != nil) { + [outProtocol writeFieldBeginWithName: @"sharedNotebook" type: TType_STRUCT fieldID: 2]; + [__sharedNotebook write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"createSharedNotebook_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",sharedNotebook:"]; + [ms appendFormat: @"%@", __sharedNotebook]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMCreateSharedNotebook_result : NSObject { + EDAMSharedNotebook * __success; + EDAMUserException * __userException; + EDAMNotFoundException * __notFoundException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __notFoundException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMSharedNotebook * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (EDAMSharedNotebook *) success userException: (EDAMUserException *) userException notFoundException: (EDAMNotFoundException *) notFoundException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMSharedNotebook *) success; +- (void) setSuccess: (EDAMSharedNotebook *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMCreateSharedNotebook_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic notFoundException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (EDAMSharedNotebook *) success userException: (EDAMUserException *) userException notFoundException: (EDAMNotFoundException *) notFoundException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__notFoundException release]; + [__systemException release]; + [super dealloc]; +} + +- (EDAMSharedNotebook *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMSharedNotebook *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMSharedNotebook *fieldValue = [[EDAMSharedNotebook alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"CreateSharedNotebook_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 2]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 3]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"CreateSharedNotebook_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMlistSharedNotebooks_args : NSObject { + NSString * __authenticationToken; + + BOOL __authenticationToken_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +@end + +@implementation EDAMlistSharedNotebooks_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"listSharedNotebooks_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"listSharedNotebooks_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMListSharedNotebooks_result : NSObject { + NSArray * __success; + EDAMUserException * __userException; + EDAMNotFoundException * __notFoundException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __notFoundException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) NSArray * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (NSArray *) success userException: (EDAMUserException *) userException notFoundException: (EDAMNotFoundException *) notFoundException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSArray *) success; +- (void) setSuccess: (NSArray *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMListSharedNotebooks_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic notFoundException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (NSArray *) success userException: (EDAMUserException *) userException notFoundException: (EDAMNotFoundException *) notFoundException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__notFoundException release]; + [__systemException release]; + [super dealloc]; +} + +- (NSArray *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (NSArray *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_LIST) { + int _size138; + [inProtocol readListBeginReturningElementType: NULL size: &_size138]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size138]; + int _i139; + for (_i139 = 0; _i139 < _size138; ++_i139) + { + EDAMSharedNotebook *_elem140 = [[EDAMSharedNotebook alloc] init]; + [_elem140 read: inProtocol]; + [fieldValue addObject: _elem140]; + [_elem140 release]; + } + [inProtocol readListEnd]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"ListSharedNotebooks_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_LIST fieldID: 0]; + { + [outProtocol writeListBeginWithElementType: TType_STRUCT size: [__success count]]; + int i142; + for (i142 = 0; i142 < [__success count]; i142++) + { + [[__success objectAtIndex: i142] write: outProtocol]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 2]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 3]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"ListSharedNotebooks_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMexpungeSharedNotebooks_args : NSObject { + NSString * __authenticationToken; + NSArray * __sharedNotebookIds; + + BOOL __authenticationToken_isset; + BOOL __sharedNotebookIds_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=sharedNotebookIds, setter=setSharedNotebookIds:) NSArray * sharedNotebookIds; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken sharedNotebookIds: (NSArray *) sharedNotebookIds; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (NSArray *) sharedNotebookIds; +- (void) setSharedNotebookIds: (NSArray *) sharedNotebookIds; +- (BOOL) sharedNotebookIdsIsSet; + +@end + +@implementation EDAMexpungeSharedNotebooks_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic sharedNotebookIds; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken sharedNotebookIds: (NSArray *) sharedNotebookIds +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __sharedNotebookIds = [sharedNotebookIds retain]; + __sharedNotebookIds_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"sharedNotebookIds"]) + { + __sharedNotebookIds = [[decoder decodeObjectForKey: @"sharedNotebookIds"] retain]; + __sharedNotebookIds_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__sharedNotebookIds_isset) + { + [encoder encodeObject: __sharedNotebookIds forKey: @"sharedNotebookIds"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__sharedNotebookIds release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (NSArray *) sharedNotebookIds { + return [[__sharedNotebookIds retain] autorelease]; +} + +- (void) setSharedNotebookIds: (NSArray *) sharedNotebookIds { + [sharedNotebookIds retain]; + [__sharedNotebookIds release]; + __sharedNotebookIds = sharedNotebookIds; + __sharedNotebookIds_isset = YES; +} + +- (BOOL) sharedNotebookIdsIsSet { + return __sharedNotebookIds_isset; +} + +- (void) unsetSharedNotebookIds { + [__sharedNotebookIds release]; + __sharedNotebookIds = nil; + __sharedNotebookIds_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_LIST) { + int _size143; + [inProtocol readListBeginReturningElementType: NULL size: &_size143]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size143]; + int _i144; + for (_i144 = 0; _i144 < _size143; ++_i144) + { + int64_t _elem145 = [inProtocol readI64]; + [fieldValue addObject: [NSNumber numberWithLongLong: _elem145]]; + } + [inProtocol readListEnd]; + [self setSharedNotebookIds: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"expungeSharedNotebooks_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__sharedNotebookIds_isset) { + if (__sharedNotebookIds != nil) { + [outProtocol writeFieldBeginWithName: @"sharedNotebookIds" type: TType_LIST fieldID: 2]; + { + [outProtocol writeListBeginWithElementType: TType_I64 size: [__sharedNotebookIds count]]; + int i147; + for (i147 = 0; i147 < [__sharedNotebookIds count]; i147++) + { + [outProtocol writeI64: [[__sharedNotebookIds objectAtIndex: i147] longLongValue]]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"expungeSharedNotebooks_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",sharedNotebookIds:"]; + [ms appendFormat: @"%@", __sharedNotebookIds]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMExpungeSharedNotebooks_result : NSObject { + int32_t __success; + EDAMUserException * __userException; + EDAMNotFoundException * __notFoundException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __notFoundException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=success, setter=setSuccess:) int32_t success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException notFoundException: (EDAMNotFoundException *) notFoundException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int32_t) success; +- (void) setSuccess: (int32_t) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMExpungeSharedNotebooks_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic notFoundException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException notFoundException: (EDAMNotFoundException *) notFoundException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = success; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [decoder decodeInt32ForKey: @"success"]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeInt32: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__userException release]; + [__notFoundException release]; + [__systemException release]; + [super dealloc]; +} + +- (int32_t) success { + return __success; +} + +- (void) setSuccess: (int32_t) success { + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setSuccess: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"ExpungeSharedNotebooks_result"]; + + if (__success_isset) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_I32 fieldID: 0]; + [outProtocol writeI32: __success]; + [outProtocol writeFieldEnd]; + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 2]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 3]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"ExpungeSharedNotebooks_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%i", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMcreateLinkedNotebook_args : NSObject { + NSString * __authenticationToken; + EDAMLinkedNotebook * __linkedNotebook; + + BOOL __authenticationToken_isset; + BOOL __linkedNotebook_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=linkedNotebook, setter=setLinkedNotebook:) EDAMLinkedNotebook * linkedNotebook; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken linkedNotebook: (EDAMLinkedNotebook *) linkedNotebook; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMLinkedNotebook *) linkedNotebook; +- (void) setLinkedNotebook: (EDAMLinkedNotebook *) linkedNotebook; +- (BOOL) linkedNotebookIsSet; + +@end + +@implementation EDAMcreateLinkedNotebook_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic linkedNotebook; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken linkedNotebook: (EDAMLinkedNotebook *) linkedNotebook +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __linkedNotebook = [linkedNotebook retain]; + __linkedNotebook_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"linkedNotebook"]) + { + __linkedNotebook = [[decoder decodeObjectForKey: @"linkedNotebook"] retain]; + __linkedNotebook_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__linkedNotebook_isset) + { + [encoder encodeObject: __linkedNotebook forKey: @"linkedNotebook"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__linkedNotebook release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (EDAMLinkedNotebook *) linkedNotebook { + return [[__linkedNotebook retain] autorelease]; +} + +- (void) setLinkedNotebook: (EDAMLinkedNotebook *) linkedNotebook { + [linkedNotebook retain]; + [__linkedNotebook release]; + __linkedNotebook = linkedNotebook; + __linkedNotebook_isset = YES; +} + +- (BOOL) linkedNotebookIsSet { + return __linkedNotebook_isset; +} + +- (void) unsetLinkedNotebook { + [__linkedNotebook release]; + __linkedNotebook = nil; + __linkedNotebook_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMLinkedNotebook *fieldValue = [[EDAMLinkedNotebook alloc] init]; + [fieldValue read: inProtocol]; + [self setLinkedNotebook: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"createLinkedNotebook_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__linkedNotebook_isset) { + if (__linkedNotebook != nil) { + [outProtocol writeFieldBeginWithName: @"linkedNotebook" type: TType_STRUCT fieldID: 2]; + [__linkedNotebook write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"createLinkedNotebook_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",linkedNotebook:"]; + [ms appendFormat: @"%@", __linkedNotebook]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMCreateLinkedNotebook_result : NSObject { + EDAMLinkedNotebook * __success; + EDAMUserException * __userException; + EDAMNotFoundException * __notFoundException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __notFoundException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMLinkedNotebook * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (EDAMLinkedNotebook *) success userException: (EDAMUserException *) userException notFoundException: (EDAMNotFoundException *) notFoundException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMLinkedNotebook *) success; +- (void) setSuccess: (EDAMLinkedNotebook *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMCreateLinkedNotebook_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic notFoundException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (EDAMLinkedNotebook *) success userException: (EDAMUserException *) userException notFoundException: (EDAMNotFoundException *) notFoundException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__notFoundException release]; + [__systemException release]; + [super dealloc]; +} + +- (EDAMLinkedNotebook *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMLinkedNotebook *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMLinkedNotebook *fieldValue = [[EDAMLinkedNotebook alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"CreateLinkedNotebook_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 2]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 3]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"CreateLinkedNotebook_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMupdateLinkedNotebook_args : NSObject { + NSString * __authenticationToken; + EDAMLinkedNotebook * __linkedNotebook; + + BOOL __authenticationToken_isset; + BOOL __linkedNotebook_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=linkedNotebook, setter=setLinkedNotebook:) EDAMLinkedNotebook * linkedNotebook; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken linkedNotebook: (EDAMLinkedNotebook *) linkedNotebook; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMLinkedNotebook *) linkedNotebook; +- (void) setLinkedNotebook: (EDAMLinkedNotebook *) linkedNotebook; +- (BOOL) linkedNotebookIsSet; + +@end + +@implementation EDAMupdateLinkedNotebook_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic linkedNotebook; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken linkedNotebook: (EDAMLinkedNotebook *) linkedNotebook +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __linkedNotebook = [linkedNotebook retain]; + __linkedNotebook_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"linkedNotebook"]) + { + __linkedNotebook = [[decoder decodeObjectForKey: @"linkedNotebook"] retain]; + __linkedNotebook_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__linkedNotebook_isset) + { + [encoder encodeObject: __linkedNotebook forKey: @"linkedNotebook"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__linkedNotebook release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (EDAMLinkedNotebook *) linkedNotebook { + return [[__linkedNotebook retain] autorelease]; +} + +- (void) setLinkedNotebook: (EDAMLinkedNotebook *) linkedNotebook { + [linkedNotebook retain]; + [__linkedNotebook release]; + __linkedNotebook = linkedNotebook; + __linkedNotebook_isset = YES; +} + +- (BOOL) linkedNotebookIsSet { + return __linkedNotebook_isset; +} + +- (void) unsetLinkedNotebook { + [__linkedNotebook release]; + __linkedNotebook = nil; + __linkedNotebook_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMLinkedNotebook *fieldValue = [[EDAMLinkedNotebook alloc] init]; + [fieldValue read: inProtocol]; + [self setLinkedNotebook: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"updateLinkedNotebook_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__linkedNotebook_isset) { + if (__linkedNotebook != nil) { + [outProtocol writeFieldBeginWithName: @"linkedNotebook" type: TType_STRUCT fieldID: 2]; + [__linkedNotebook write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"updateLinkedNotebook_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",linkedNotebook:"]; + [ms appendFormat: @"%@", __linkedNotebook]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMUpdateLinkedNotebook_result : NSObject { + EDAMLinkedNotebook * __success; + EDAMUserException * __userException; + EDAMNotFoundException * __notFoundException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __notFoundException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMLinkedNotebook * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (EDAMLinkedNotebook *) success userException: (EDAMUserException *) userException notFoundException: (EDAMNotFoundException *) notFoundException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMLinkedNotebook *) success; +- (void) setSuccess: (EDAMLinkedNotebook *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMUpdateLinkedNotebook_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic notFoundException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (EDAMLinkedNotebook *) success userException: (EDAMUserException *) userException notFoundException: (EDAMNotFoundException *) notFoundException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__notFoundException release]; + [__systemException release]; + [super dealloc]; +} + +- (EDAMLinkedNotebook *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMLinkedNotebook *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMLinkedNotebook *fieldValue = [[EDAMLinkedNotebook alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"UpdateLinkedNotebook_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 2]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 3]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"UpdateLinkedNotebook_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMlistLinkedNotebooks_args : NSObject { + NSString * __authenticationToken; + + BOOL __authenticationToken_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +@end + +@implementation EDAMlistLinkedNotebooks_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"listLinkedNotebooks_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"listLinkedNotebooks_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMListLinkedNotebooks_result : NSObject { + NSArray * __success; + EDAMUserException * __userException; + EDAMNotFoundException * __notFoundException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __notFoundException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) NSArray * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (NSArray *) success userException: (EDAMUserException *) userException notFoundException: (EDAMNotFoundException *) notFoundException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSArray *) success; +- (void) setSuccess: (NSArray *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMListLinkedNotebooks_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic notFoundException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (NSArray *) success userException: (EDAMUserException *) userException notFoundException: (EDAMNotFoundException *) notFoundException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__notFoundException release]; + [__systemException release]; + [super dealloc]; +} + +- (NSArray *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (NSArray *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_LIST) { + int _size148; + [inProtocol readListBeginReturningElementType: NULL size: &_size148]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size148]; + int _i149; + for (_i149 = 0; _i149 < _size148; ++_i149) + { + EDAMLinkedNotebook *_elem150 = [[EDAMLinkedNotebook alloc] init]; + [_elem150 read: inProtocol]; + [fieldValue addObject: _elem150]; + [_elem150 release]; + } + [inProtocol readListEnd]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"ListLinkedNotebooks_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_LIST fieldID: 0]; + { + [outProtocol writeListBeginWithElementType: TType_STRUCT size: [__success count]]; + int i152; + for (i152 = 0; i152 < [__success count]; i152++) + { + [[__success objectAtIndex: i152] write: outProtocol]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 2]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 3]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"ListLinkedNotebooks_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMexpungeLinkedNotebook_args : NSObject { + NSString * __authenticationToken; + int64_t __linkedNotebookId; + + BOOL __authenticationToken_isset; + BOOL __linkedNotebookId_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, getter=linkedNotebookId, setter=setLinkedNotebookId:) int64_t linkedNotebookId; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken linkedNotebookId: (int64_t) linkedNotebookId; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (int64_t) linkedNotebookId; +- (void) setLinkedNotebookId: (int64_t) linkedNotebookId; +- (BOOL) linkedNotebookIdIsSet; + +@end + +@implementation EDAMexpungeLinkedNotebook_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic linkedNotebookId; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken linkedNotebookId: (int64_t) linkedNotebookId +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __linkedNotebookId = linkedNotebookId; + __linkedNotebookId_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"linkedNotebookId"]) + { + __linkedNotebookId = [decoder decodeInt64ForKey: @"linkedNotebookId"]; + __linkedNotebookId_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__linkedNotebookId_isset) + { + [encoder encodeInt64: __linkedNotebookId forKey: @"linkedNotebookId"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (int64_t) linkedNotebookId { + return __linkedNotebookId; +} + +- (void) setLinkedNotebookId: (int64_t) linkedNotebookId { + __linkedNotebookId = linkedNotebookId; + __linkedNotebookId_isset = YES; +} + +- (BOOL) linkedNotebookIdIsSet { + return __linkedNotebookId_isset; +} + +- (void) unsetLinkedNotebookId { + __linkedNotebookId_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setLinkedNotebookId: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"expungeLinkedNotebook_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__linkedNotebookId_isset) { + [outProtocol writeFieldBeginWithName: @"linkedNotebookId" type: TType_I64 fieldID: 2]; + [outProtocol writeI64: __linkedNotebookId]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"expungeLinkedNotebook_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",linkedNotebookId:"]; + [ms appendFormat: @"%qi", __linkedNotebookId]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMExpungeLinkedNotebook_result : NSObject { + int32_t __success; + EDAMUserException * __userException; + EDAMNotFoundException * __notFoundException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __notFoundException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=success, setter=setSuccess:) int32_t success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException notFoundException: (EDAMNotFoundException *) notFoundException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int32_t) success; +- (void) setSuccess: (int32_t) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMExpungeLinkedNotebook_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic notFoundException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (int32_t) success userException: (EDAMUserException *) userException notFoundException: (EDAMNotFoundException *) notFoundException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = success; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [decoder decodeInt32ForKey: @"success"]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeInt32: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__userException release]; + [__notFoundException release]; + [__systemException release]; + [super dealloc]; +} + +- (int32_t) success { + return __success; +} + +- (void) setSuccess: (int32_t) success { + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setSuccess: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"ExpungeLinkedNotebook_result"]; + + if (__success_isset) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_I32 fieldID: 0]; + [outProtocol writeI32: __success]; + [outProtocol writeFieldEnd]; + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 2]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 3]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"ExpungeLinkedNotebook_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%i", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMauthenticateToSharedNotebook_args : NSObject { + NSString * __shareKey; + NSString * __authenticationToken; + + BOOL __shareKey_isset; + BOOL __authenticationToken_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=shareKey, setter=setShareKey:) NSString * shareKey; +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +#endif + +- (id) initWithShareKey: (NSString *) shareKey authenticationToken: (NSString *) authenticationToken; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) shareKey; +- (void) setShareKey: (NSString *) shareKey; +- (BOOL) shareKeyIsSet; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +@end + +@implementation EDAMauthenticateToSharedNotebook_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic shareKey; +@dynamic authenticationToken; +#endif + +- (id) initWithShareKey: (NSString *) shareKey authenticationToken: (NSString *) authenticationToken +{ + self = [super init]; + __shareKey = [shareKey retain]; + __shareKey_isset = YES; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"shareKey"]) + { + __shareKey = [[decoder decodeObjectForKey: @"shareKey"] retain]; + __shareKey_isset = YES; + } + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__shareKey_isset) + { + [encoder encodeObject: __shareKey forKey: @"shareKey"]; + } + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } +} + +- (void) dealloc +{ + [__shareKey release]; + [__authenticationToken release]; + [super dealloc]; +} + +- (NSString *) shareKey { + return [[__shareKey retain] autorelease]; +} + +- (void) setShareKey: (NSString *) shareKey { + [shareKey retain]; + [__shareKey release]; + __shareKey = shareKey; + __shareKey_isset = YES; +} + +- (BOOL) shareKeyIsSet { + return __shareKey_isset; +} + +- (void) unsetShareKey { + [__shareKey release]; + __shareKey = nil; + __shareKey_isset = NO; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setShareKey: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"authenticateToSharedNotebook_args"]; + if (__shareKey_isset) { + if (__shareKey != nil) { + [outProtocol writeFieldBeginWithName: @"shareKey" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __shareKey]; + [outProtocol writeFieldEnd]; + } + } + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"authenticateToSharedNotebook_args("]; + [ms appendString: @"shareKey:"]; + [ms appendFormat: @"\"%@\"", __shareKey]; + [ms appendString: @",authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMAuthenticateToSharedNotebook_result : NSObject { + EDAMAuthenticationResult * __success; + EDAMUserException * __userException; + EDAMNotFoundException * __notFoundException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __notFoundException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMAuthenticationResult * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (EDAMAuthenticationResult *) success userException: (EDAMUserException *) userException notFoundException: (EDAMNotFoundException *) notFoundException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMAuthenticationResult *) success; +- (void) setSuccess: (EDAMAuthenticationResult *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMAuthenticateToSharedNotebook_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic notFoundException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (EDAMAuthenticationResult *) success userException: (EDAMUserException *) userException notFoundException: (EDAMNotFoundException *) notFoundException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__notFoundException release]; + [__systemException release]; + [super dealloc]; +} + +- (EDAMAuthenticationResult *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMAuthenticationResult *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMAuthenticationResult *fieldValue = [[EDAMAuthenticationResult alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"AuthenticateToSharedNotebook_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 2]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 3]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"AuthenticateToSharedNotebook_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetSharedNotebookByAuth_args : NSObject { + NSString * __authenticationToken; + + BOOL __authenticationToken_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +@end + +@implementation EDAMgetSharedNotebookByAuth_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getSharedNotebookByAuth_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getSharedNotebookByAuth_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetSharedNotebookByAuth_result : NSObject { + EDAMSharedNotebook * __success; + EDAMUserException * __userException; + EDAMNotFoundException * __notFoundException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __notFoundException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMSharedNotebook * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (EDAMSharedNotebook *) success userException: (EDAMUserException *) userException notFoundException: (EDAMNotFoundException *) notFoundException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMSharedNotebook *) success; +- (void) setSuccess: (EDAMSharedNotebook *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMGetSharedNotebookByAuth_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic notFoundException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (EDAMSharedNotebook *) success userException: (EDAMUserException *) userException notFoundException: (EDAMNotFoundException *) notFoundException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__notFoundException release]; + [__systemException release]; + [super dealloc]; +} + +- (EDAMSharedNotebook *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMSharedNotebook *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMSharedNotebook *fieldValue = [[EDAMSharedNotebook alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetSharedNotebookByAuth_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 2]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 3]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetSharedNotebookByAuth_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMemailNote_args : NSObject { + NSString * __authenticationToken; + EDAMNoteEmailParameters * __parameters; + + BOOL __authenticationToken_isset; + BOOL __parameters_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, retain, getter=parameters, setter=setParameters:) EDAMNoteEmailParameters * parameters; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken parameters: (EDAMNoteEmailParameters *) parameters; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMNoteEmailParameters *) parameters; +- (void) setParameters: (EDAMNoteEmailParameters *) parameters; +- (BOOL) parametersIsSet; + +@end + +@implementation EDAMemailNote_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +@dynamic parameters; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken parameters: (EDAMNoteEmailParameters *) parameters +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __parameters = [parameters retain]; + __parameters_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"parameters"]) + { + __parameters = [[decoder decodeObjectForKey: @"parameters"] retain]; + __parameters_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__parameters_isset) + { + [encoder encodeObject: __parameters forKey: @"parameters"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__parameters release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (EDAMNoteEmailParameters *) parameters { + return [[__parameters retain] autorelease]; +} + +- (void) setParameters: (EDAMNoteEmailParameters *) parameters { + [parameters retain]; + [__parameters release]; + __parameters = parameters; + __parameters_isset = YES; +} + +- (BOOL) parametersIsSet { + return __parameters_isset; +} + +- (void) unsetParameters { + [__parameters release]; + __parameters = nil; + __parameters_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMNoteEmailParameters *fieldValue = [[EDAMNoteEmailParameters alloc] init]; + [fieldValue read: inProtocol]; + [self setParameters: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"emailNote_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__parameters_isset) { + if (__parameters != nil) { + [outProtocol writeFieldBeginWithName: @"parameters" type: TType_STRUCT fieldID: 2]; + [__parameters write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"emailNote_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",parameters:"]; + [ms appendFormat: @"%@", __parameters]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMEmailNote_result : NSObject { + EDAMUserException * __userException; + EDAMNotFoundException * __notFoundException; + EDAMSystemException * __systemException; + + BOOL __userException_isset; + BOOL __notFoundException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithUserException: (EDAMUserException *) userException notFoundException: (EDAMNotFoundException *) notFoundException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMEmailNote_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic userException; +@dynamic notFoundException; +@dynamic systemException; +#endif + +- (id) initWithUserException: (EDAMUserException *) userException notFoundException: (EDAMNotFoundException *) notFoundException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __userException = [userException retain]; + __userException_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__userException release]; + [__notFoundException release]; + [__systemException release]; + [super dealloc]; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"EmailNote_result"]; + + if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 2]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 3]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"EmailNote_result("]; + [ms appendString: @"userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMNoteStoreClient +- (id) initWithProtocol: (id ) protocol +{ + return [self initWithInProtocol: protocol outProtocol: protocol]; +} + +- (id) initWithInProtocol: (id ) anInProtocol outProtocol: (id ) anOutProtocol +{ + [super init]; + inProtocol = [anInProtocol retain]; + outProtocol = [anOutProtocol retain]; + return self; +} + +- (void) dealloc +{ + [inProtocol release]; + [outProtocol release]; + [super dealloc]; +} + +- (void) send_getSyncState: (NSString *) authenticationToken +{ + [outProtocol writeMessageBeginWithName: @"getSyncState" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getSyncState_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMSyncState *) recv_getSyncState +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetSyncState_result * result = [[[EDAMGetSyncState_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getSyncState failed: unknown result"]; +} + +- (EDAMSyncState *) getSyncState: (NSString *) authenticationToken +{ + [self send_getSyncState: authenticationToken]; + return [self recv_getSyncState]; +} + +- (void) send_getSyncChunk: (NSString *) authenticationToken : (int32_t) afterUSN : (int32_t) maxEntries : (BOOL) fullSyncOnly +{ + [outProtocol writeMessageBeginWithName: @"getSyncChunk" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getSyncChunk_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldBeginWithName: @"afterUSN" type: TType_I32 fieldID: 2]; + [outProtocol writeI32: afterUSN]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldBeginWithName: @"maxEntries" type: TType_I32 fieldID: 3]; + [outProtocol writeI32: maxEntries]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldBeginWithName: @"fullSyncOnly" type: TType_BOOL fieldID: 4]; + [outProtocol writeBool: fullSyncOnly]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMSyncChunk *) recv_getSyncChunk +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetSyncChunk_result * result = [[[EDAMGetSyncChunk_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getSyncChunk failed: unknown result"]; +} + +- (EDAMSyncChunk *) getSyncChunk: (NSString *) authenticationToken : (int32_t) afterUSN : (int32_t) maxEntries : (BOOL) fullSyncOnly +{ + [self send_getSyncChunk: authenticationToken : afterUSN : maxEntries : fullSyncOnly]; + return [self recv_getSyncChunk]; +} + +- (void) send_listNotebooks: (NSString *) authenticationToken +{ + [outProtocol writeMessageBeginWithName: @"listNotebooks" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"listNotebooks_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (NSArray *) recv_listNotebooks +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMListNotebooks_result * result = [[[EDAMListNotebooks_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"listNotebooks failed: unknown result"]; +} + +- (NSArray *) listNotebooks: (NSString *) authenticationToken +{ + [self send_listNotebooks: authenticationToken]; + return [self recv_listNotebooks]; +} + +- (void) send_getNotebook: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [outProtocol writeMessageBeginWithName: @"getNotebook" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getNotebook_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: guid]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMNotebook *) recv_getNotebook +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetNotebook_result * result = [[[EDAMGetNotebook_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getNotebook failed: unknown result"]; +} + +- (EDAMNotebook *) getNotebook: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [self send_getNotebook: authenticationToken : guid]; + return [self recv_getNotebook]; +} + +- (void) send_getDefaultNotebook: (NSString *) authenticationToken +{ + [outProtocol writeMessageBeginWithName: @"getDefaultNotebook" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getDefaultNotebook_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMNotebook *) recv_getDefaultNotebook +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetDefaultNotebook_result * result = [[[EDAMGetDefaultNotebook_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getDefaultNotebook failed: unknown result"]; +} + +- (EDAMNotebook *) getDefaultNotebook: (NSString *) authenticationToken +{ + [self send_getDefaultNotebook: authenticationToken]; + return [self recv_getDefaultNotebook]; +} + +- (void) send_createNotebook: (NSString *) authenticationToken : (EDAMNotebook *) notebook +{ + [outProtocol writeMessageBeginWithName: @"createNotebook" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"createNotebook_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (notebook != nil) { + [outProtocol writeFieldBeginWithName: @"notebook" type: TType_STRUCT fieldID: 2]; + [notebook write: outProtocol]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMNotebook *) recv_createNotebook +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMCreateNotebook_result * result = [[[EDAMCreateNotebook_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"createNotebook failed: unknown result"]; +} + +- (EDAMNotebook *) createNotebook: (NSString *) authenticationToken : (EDAMNotebook *) notebook +{ + [self send_createNotebook: authenticationToken : notebook]; + return [self recv_createNotebook]; +} + +- (void) send_updateNotebook: (NSString *) authenticationToken : (EDAMNotebook *) notebook +{ + [outProtocol writeMessageBeginWithName: @"updateNotebook" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"updateNotebook_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (notebook != nil) { + [outProtocol writeFieldBeginWithName: @"notebook" type: TType_STRUCT fieldID: 2]; + [notebook write: outProtocol]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (int32_t) recv_updateNotebook +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMUpdateNotebook_result * result = [[[EDAMUpdateNotebook_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"updateNotebook failed: unknown result"]; +} + +- (int32_t) updateNotebook: (NSString *) authenticationToken : (EDAMNotebook *) notebook +{ + [self send_updateNotebook: authenticationToken : notebook]; + return [self recv_updateNotebook]; +} + +- (void) send_expungeNotebook: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [outProtocol writeMessageBeginWithName: @"expungeNotebook" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"expungeNotebook_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: guid]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (int32_t) recv_expungeNotebook +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMExpungeNotebook_result * result = [[[EDAMExpungeNotebook_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"expungeNotebook failed: unknown result"]; +} + +- (int32_t) expungeNotebook: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [self send_expungeNotebook: authenticationToken : guid]; + return [self recv_expungeNotebook]; +} + +- (void) send_listTags: (NSString *) authenticationToken +{ + [outProtocol writeMessageBeginWithName: @"listTags" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"listTags_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (NSArray *) recv_listTags +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMListTags_result * result = [[[EDAMListTags_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"listTags failed: unknown result"]; +} + +- (NSArray *) listTags: (NSString *) authenticationToken +{ + [self send_listTags: authenticationToken]; + return [self recv_listTags]; +} + +- (void) send_listTagsByNotebook: (NSString *) authenticationToken : (EDAMGuid) notebookGuid +{ + [outProtocol writeMessageBeginWithName: @"listTagsByNotebook" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"listTagsByNotebook_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (notebookGuid != nil) { + [outProtocol writeFieldBeginWithName: @"notebookGuid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: notebookGuid]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (NSArray *) recv_listTagsByNotebook +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMListTagsByNotebook_result * result = [[[EDAMListTagsByNotebook_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"listTagsByNotebook failed: unknown result"]; +} + +- (NSArray *) listTagsByNotebook: (NSString *) authenticationToken : (EDAMGuid) notebookGuid +{ + [self send_listTagsByNotebook: authenticationToken : notebookGuid]; + return [self recv_listTagsByNotebook]; +} + +- (void) send_getTag: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [outProtocol writeMessageBeginWithName: @"getTag" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getTag_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: guid]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMTag *) recv_getTag +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetTag_result * result = [[[EDAMGetTag_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getTag failed: unknown result"]; +} + +- (EDAMTag *) getTag: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [self send_getTag: authenticationToken : guid]; + return [self recv_getTag]; +} + +- (void) send_createTag: (NSString *) authenticationToken : (EDAMTag *) tag +{ + [outProtocol writeMessageBeginWithName: @"createTag" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"createTag_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (tag != nil) { + [outProtocol writeFieldBeginWithName: @"tag" type: TType_STRUCT fieldID: 2]; + [tag write: outProtocol]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMTag *) recv_createTag +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMCreateTag_result * result = [[[EDAMCreateTag_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"createTag failed: unknown result"]; +} + +- (EDAMTag *) createTag: (NSString *) authenticationToken : (EDAMTag *) tag +{ + [self send_createTag: authenticationToken : tag]; + return [self recv_createTag]; +} + +- (void) send_updateTag: (NSString *) authenticationToken : (EDAMTag *) tag +{ + [outProtocol writeMessageBeginWithName: @"updateTag" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"updateTag_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (tag != nil) { + [outProtocol writeFieldBeginWithName: @"tag" type: TType_STRUCT fieldID: 2]; + [tag write: outProtocol]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (int32_t) recv_updateTag +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMUpdateTag_result * result = [[[EDAMUpdateTag_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"updateTag failed: unknown result"]; +} + +- (int32_t) updateTag: (NSString *) authenticationToken : (EDAMTag *) tag +{ + [self send_updateTag: authenticationToken : tag]; + return [self recv_updateTag]; +} + +- (void) send_untagAll: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [outProtocol writeMessageBeginWithName: @"untagAll" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"untagAll_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: guid]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (void) recv_untagAll +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMUntagAll_result * result = [[[EDAMUntagAll_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + return; +} + +- (void) untagAll: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [self send_untagAll: authenticationToken : guid]; + [self recv_untagAll]; +} + +- (void) send_expungeTag: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [outProtocol writeMessageBeginWithName: @"expungeTag" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"expungeTag_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: guid]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (int32_t) recv_expungeTag +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMExpungeTag_result * result = [[[EDAMExpungeTag_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"expungeTag failed: unknown result"]; +} + +- (int32_t) expungeTag: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [self send_expungeTag: authenticationToken : guid]; + return [self recv_expungeTag]; +} + +- (void) send_listSearches: (NSString *) authenticationToken +{ + [outProtocol writeMessageBeginWithName: @"listSearches" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"listSearches_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (NSArray *) recv_listSearches +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMListSearches_result * result = [[[EDAMListSearches_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"listSearches failed: unknown result"]; +} + +- (NSArray *) listSearches: (NSString *) authenticationToken +{ + [self send_listSearches: authenticationToken]; + return [self recv_listSearches]; +} + +- (void) send_getSearch: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [outProtocol writeMessageBeginWithName: @"getSearch" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getSearch_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: guid]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMSavedSearch *) recv_getSearch +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetSearch_result * result = [[[EDAMGetSearch_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getSearch failed: unknown result"]; +} + +- (EDAMSavedSearch *) getSearch: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [self send_getSearch: authenticationToken : guid]; + return [self recv_getSearch]; +} + +- (void) send_createSearch: (NSString *) authenticationToken : (EDAMSavedSearch *) search +{ + [outProtocol writeMessageBeginWithName: @"createSearch" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"createSearch_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (search != nil) { + [outProtocol writeFieldBeginWithName: @"search" type: TType_STRUCT fieldID: 2]; + [search write: outProtocol]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMSavedSearch *) recv_createSearch +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMCreateSearch_result * result = [[[EDAMCreateSearch_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"createSearch failed: unknown result"]; +} + +- (EDAMSavedSearch *) createSearch: (NSString *) authenticationToken : (EDAMSavedSearch *) search +{ + [self send_createSearch: authenticationToken : search]; + return [self recv_createSearch]; +} + +- (void) send_updateSearch: (NSString *) authenticationToken : (EDAMSavedSearch *) search +{ + [outProtocol writeMessageBeginWithName: @"updateSearch" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"updateSearch_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (search != nil) { + [outProtocol writeFieldBeginWithName: @"search" type: TType_STRUCT fieldID: 2]; + [search write: outProtocol]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (int32_t) recv_updateSearch +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMUpdateSearch_result * result = [[[EDAMUpdateSearch_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"updateSearch failed: unknown result"]; +} + +- (int32_t) updateSearch: (NSString *) authenticationToken : (EDAMSavedSearch *) search +{ + [self send_updateSearch: authenticationToken : search]; + return [self recv_updateSearch]; +} + +- (void) send_expungeSearch: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [outProtocol writeMessageBeginWithName: @"expungeSearch" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"expungeSearch_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: guid]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (int32_t) recv_expungeSearch +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMExpungeSearch_result * result = [[[EDAMExpungeSearch_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"expungeSearch failed: unknown result"]; +} + +- (int32_t) expungeSearch: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [self send_expungeSearch: authenticationToken : guid]; + return [self recv_expungeSearch]; +} + +- (void) send_findNotes: (NSString *) authenticationToken : (EDAMNoteFilter *) filter : (int32_t) offset : (int32_t) maxNotes +{ + [outProtocol writeMessageBeginWithName: @"findNotes" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"findNotes_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (filter != nil) { + [outProtocol writeFieldBeginWithName: @"filter" type: TType_STRUCT fieldID: 2]; + [filter write: outProtocol]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldBeginWithName: @"offset" type: TType_I32 fieldID: 3]; + [outProtocol writeI32: offset]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldBeginWithName: @"maxNotes" type: TType_I32 fieldID: 4]; + [outProtocol writeI32: maxNotes]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMNoteList *) recv_findNotes +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMFindNotes_result * result = [[[EDAMFindNotes_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"findNotes failed: unknown result"]; +} + +- (EDAMNoteList *) findNotes: (NSString *) authenticationToken : (EDAMNoteFilter *) filter : (int32_t) offset : (int32_t) maxNotes +{ + [self send_findNotes: authenticationToken : filter : offset : maxNotes]; + return [self recv_findNotes]; +} + +- (void) send_findNoteCounts: (NSString *) authenticationToken : (EDAMNoteFilter *) filter : (BOOL) withTrash +{ + [outProtocol writeMessageBeginWithName: @"findNoteCounts" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"findNoteCounts_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (filter != nil) { + [outProtocol writeFieldBeginWithName: @"filter" type: TType_STRUCT fieldID: 2]; + [filter write: outProtocol]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldBeginWithName: @"withTrash" type: TType_BOOL fieldID: 3]; + [outProtocol writeBool: withTrash]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMNoteCollectionCounts *) recv_findNoteCounts +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMFindNoteCounts_result * result = [[[EDAMFindNoteCounts_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"findNoteCounts failed: unknown result"]; +} + +- (EDAMNoteCollectionCounts *) findNoteCounts: (NSString *) authenticationToken : (EDAMNoteFilter *) filter : (BOOL) withTrash +{ + [self send_findNoteCounts: authenticationToken : filter : withTrash]; + return [self recv_findNoteCounts]; +} + +- (void) send_getNote: (NSString *) authenticationToken : (EDAMGuid) guid : (BOOL) withContent : (BOOL) withResourcesData : (BOOL) withResourcesRecognition : (BOOL) withResourcesAlternateData +{ + [outProtocol writeMessageBeginWithName: @"getNote" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getNote_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: guid]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldBeginWithName: @"withContent" type: TType_BOOL fieldID: 3]; + [outProtocol writeBool: withContent]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldBeginWithName: @"withResourcesData" type: TType_BOOL fieldID: 4]; + [outProtocol writeBool: withResourcesData]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldBeginWithName: @"withResourcesRecognition" type: TType_BOOL fieldID: 5]; + [outProtocol writeBool: withResourcesRecognition]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldBeginWithName: @"withResourcesAlternateData" type: TType_BOOL fieldID: 6]; + [outProtocol writeBool: withResourcesAlternateData]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMNote *) recv_getNote +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetNote_result * result = [[[EDAMGetNote_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getNote failed: unknown result"]; +} + +- (EDAMNote *) getNote: (NSString *) authenticationToken : (EDAMGuid) guid : (BOOL) withContent : (BOOL) withResourcesData : (BOOL) withResourcesRecognition : (BOOL) withResourcesAlternateData +{ + [self send_getNote: authenticationToken : guid : withContent : withResourcesData : withResourcesRecognition : withResourcesAlternateData]; + return [self recv_getNote]; +} + +- (void) send_getNoteContent: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [outProtocol writeMessageBeginWithName: @"getNoteContent" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getNoteContent_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: guid]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (NSString *) recv_getNoteContent +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetNoteContent_result * result = [[[EDAMGetNoteContent_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getNoteContent failed: unknown result"]; +} + +- (NSString *) getNoteContent: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [self send_getNoteContent: authenticationToken : guid]; + return [self recv_getNoteContent]; +} + +- (void) send_getNoteSearchText: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [outProtocol writeMessageBeginWithName: @"getNoteSearchText" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getNoteSearchText_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: guid]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (NSString *) recv_getNoteSearchText +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetNoteSearchText_result * result = [[[EDAMGetNoteSearchText_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getNoteSearchText failed: unknown result"]; +} + +- (NSString *) getNoteSearchText: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [self send_getNoteSearchText: authenticationToken : guid]; + return [self recv_getNoteSearchText]; +} + +- (void) send_getNoteTagNames: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [outProtocol writeMessageBeginWithName: @"getNoteTagNames" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getNoteTagNames_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: guid]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (NSArray *) recv_getNoteTagNames +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetNoteTagNames_result * result = [[[EDAMGetNoteTagNames_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getNoteTagNames failed: unknown result"]; +} + +- (NSArray *) getNoteTagNames: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [self send_getNoteTagNames: authenticationToken : guid]; + return [self recv_getNoteTagNames]; +} + +- (void) send_createNote: (NSString *) authenticationToken : (EDAMNote *) note +{ + [outProtocol writeMessageBeginWithName: @"createNote" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"createNote_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (note != nil) { + [outProtocol writeFieldBeginWithName: @"note" type: TType_STRUCT fieldID: 2]; + [note write: outProtocol]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMNote *) recv_createNote +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMCreateNote_result * result = [[[EDAMCreateNote_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"createNote failed: unknown result"]; +} + +- (EDAMNote *) createNote: (NSString *) authenticationToken : (EDAMNote *) note +{ + [self send_createNote: authenticationToken : note]; + return [self recv_createNote]; +} + +- (void) send_updateNote: (NSString *) authenticationToken : (EDAMNote *) note +{ + [outProtocol writeMessageBeginWithName: @"updateNote" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"updateNote_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (note != nil) { + [outProtocol writeFieldBeginWithName: @"note" type: TType_STRUCT fieldID: 2]; + [note write: outProtocol]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMNote *) recv_updateNote +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMUpdateNote_result * result = [[[EDAMUpdateNote_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"updateNote failed: unknown result"]; +} + +- (EDAMNote *) updateNote: (NSString *) authenticationToken : (EDAMNote *) note +{ + [self send_updateNote: authenticationToken : note]; + return [self recv_updateNote]; +} + +- (void) send_deleteNote: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [outProtocol writeMessageBeginWithName: @"deleteNote" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"deleteNote_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: guid]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (int32_t) recv_deleteNote +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMDeleteNote_result * result = [[[EDAMDeleteNote_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"deleteNote failed: unknown result"]; +} + +- (int32_t) deleteNote: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [self send_deleteNote: authenticationToken : guid]; + return [self recv_deleteNote]; +} + +- (void) send_expungeNote: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [outProtocol writeMessageBeginWithName: @"expungeNote" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"expungeNote_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: guid]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (int32_t) recv_expungeNote +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMExpungeNote_result * result = [[[EDAMExpungeNote_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"expungeNote failed: unknown result"]; +} + +- (int32_t) expungeNote: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [self send_expungeNote: authenticationToken : guid]; + return [self recv_expungeNote]; +} + +- (void) send_expungeNotes: (NSString *) authenticationToken : (NSArray *) noteGuids +{ + [outProtocol writeMessageBeginWithName: @"expungeNotes" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"expungeNotes_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (noteGuids != nil) { + [outProtocol writeFieldBeginWithName: @"noteGuids" type: TType_LIST fieldID: 2]; + { + [outProtocol writeListBeginWithElementType: TType_STRING size: [noteGuids count]]; + int i154; + for (i154 = 0; i154 < [noteGuids count]; i154++) + { + [outProtocol writeString: [noteGuids objectAtIndex: i154]]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (int32_t) recv_expungeNotes +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMExpungeNotes_result * result = [[[EDAMExpungeNotes_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"expungeNotes failed: unknown result"]; +} + +- (int32_t) expungeNotes: (NSString *) authenticationToken : (NSArray *) noteGuids +{ + [self send_expungeNotes: authenticationToken : noteGuids]; + return [self recv_expungeNotes]; +} + +- (void) send_expungeInactiveNotes: (NSString *) authenticationToken +{ + [outProtocol writeMessageBeginWithName: @"expungeInactiveNotes" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"expungeInactiveNotes_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (int32_t) recv_expungeInactiveNotes +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMExpungeInactiveNotes_result * result = [[[EDAMExpungeInactiveNotes_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"expungeInactiveNotes failed: unknown result"]; +} + +- (int32_t) expungeInactiveNotes: (NSString *) authenticationToken +{ + [self send_expungeInactiveNotes: authenticationToken]; + return [self recv_expungeInactiveNotes]; +} + +- (void) send_copyNote: (NSString *) authenticationToken : (EDAMGuid) noteGuid : (EDAMGuid) toNotebookGuid +{ + [outProtocol writeMessageBeginWithName: @"copyNote" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"copyNote_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (noteGuid != nil) { + [outProtocol writeFieldBeginWithName: @"noteGuid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: noteGuid]; + [outProtocol writeFieldEnd]; + } + if (toNotebookGuid != nil) { + [outProtocol writeFieldBeginWithName: @"toNotebookGuid" type: TType_STRING fieldID: 3]; + [outProtocol writeString: toNotebookGuid]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMNote *) recv_copyNote +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMCopyNote_result * result = [[[EDAMCopyNote_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"copyNote failed: unknown result"]; +} + +- (EDAMNote *) copyNote: (NSString *) authenticationToken : (EDAMGuid) noteGuid : (EDAMGuid) toNotebookGuid +{ + [self send_copyNote: authenticationToken : noteGuid : toNotebookGuid]; + return [self recv_copyNote]; +} + +- (void) send_listNoteVersions: (NSString *) authenticationToken : (EDAMGuid) noteGuid +{ + [outProtocol writeMessageBeginWithName: @"listNoteVersions" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"listNoteVersions_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (noteGuid != nil) { + [outProtocol writeFieldBeginWithName: @"noteGuid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: noteGuid]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (NSArray *) recv_listNoteVersions +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMListNoteVersions_result * result = [[[EDAMListNoteVersions_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"listNoteVersions failed: unknown result"]; +} + +- (NSArray *) listNoteVersions: (NSString *) authenticationToken : (EDAMGuid) noteGuid +{ + [self send_listNoteVersions: authenticationToken : noteGuid]; + return [self recv_listNoteVersions]; +} + +- (void) send_getNoteVersion: (NSString *) authenticationToken : (EDAMGuid) noteGuid : (int32_t) updateSequenceNum : (BOOL) withResourcesData : (BOOL) withResourcesRecognition : (BOOL) withResourcesAlternateData +{ + [outProtocol writeMessageBeginWithName: @"getNoteVersion" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getNoteVersion_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (noteGuid != nil) { + [outProtocol writeFieldBeginWithName: @"noteGuid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: noteGuid]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldBeginWithName: @"updateSequenceNum" type: TType_I32 fieldID: 3]; + [outProtocol writeI32: updateSequenceNum]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldBeginWithName: @"withResourcesData" type: TType_BOOL fieldID: 4]; + [outProtocol writeBool: withResourcesData]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldBeginWithName: @"withResourcesRecognition" type: TType_BOOL fieldID: 5]; + [outProtocol writeBool: withResourcesRecognition]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldBeginWithName: @"withResourcesAlternateData" type: TType_BOOL fieldID: 6]; + [outProtocol writeBool: withResourcesAlternateData]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMNote *) recv_getNoteVersion +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetNoteVersion_result * result = [[[EDAMGetNoteVersion_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getNoteVersion failed: unknown result"]; +} + +- (EDAMNote *) getNoteVersion: (NSString *) authenticationToken : (EDAMGuid) noteGuid : (int32_t) updateSequenceNum : (BOOL) withResourcesData : (BOOL) withResourcesRecognition : (BOOL) withResourcesAlternateData +{ + [self send_getNoteVersion: authenticationToken : noteGuid : updateSequenceNum : withResourcesData : withResourcesRecognition : withResourcesAlternateData]; + return [self recv_getNoteVersion]; +} + +- (void) send_getResource: (NSString *) authenticationToken : (EDAMGuid) guid : (BOOL) withData : (BOOL) withRecognition : (BOOL) withAttributes : (BOOL) withAlternateData +{ + [outProtocol writeMessageBeginWithName: @"getResource" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getResource_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: guid]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldBeginWithName: @"withData" type: TType_BOOL fieldID: 3]; + [outProtocol writeBool: withData]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldBeginWithName: @"withRecognition" type: TType_BOOL fieldID: 4]; + [outProtocol writeBool: withRecognition]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldBeginWithName: @"withAttributes" type: TType_BOOL fieldID: 5]; + [outProtocol writeBool: withAttributes]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldBeginWithName: @"withAlternateData" type: TType_BOOL fieldID: 6]; + [outProtocol writeBool: withAlternateData]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMResource *) recv_getResource +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetResource_result * result = [[[EDAMGetResource_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getResource failed: unknown result"]; +} + +- (EDAMResource *) getResource: (NSString *) authenticationToken : (EDAMGuid) guid : (BOOL) withData : (BOOL) withRecognition : (BOOL) withAttributes : (BOOL) withAlternateData +{ + [self send_getResource: authenticationToken : guid : withData : withRecognition : withAttributes : withAlternateData]; + return [self recv_getResource]; +} + +- (void) send_updateResource: (NSString *) authenticationToken : (EDAMResource *) resource +{ + [outProtocol writeMessageBeginWithName: @"updateResource" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"updateResource_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (resource != nil) { + [outProtocol writeFieldBeginWithName: @"resource" type: TType_STRUCT fieldID: 2]; + [resource write: outProtocol]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (int32_t) recv_updateResource +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMUpdateResource_result * result = [[[EDAMUpdateResource_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"updateResource failed: unknown result"]; +} + +- (int32_t) updateResource: (NSString *) authenticationToken : (EDAMResource *) resource +{ + [self send_updateResource: authenticationToken : resource]; + return [self recv_updateResource]; +} + +- (void) send_getResourceData: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [outProtocol writeMessageBeginWithName: @"getResourceData" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getResourceData_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: guid]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (NSData *) recv_getResourceData +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetResourceData_result * result = [[[EDAMGetResourceData_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getResourceData failed: unknown result"]; +} + +- (NSData *) getResourceData: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [self send_getResourceData: authenticationToken : guid]; + return [self recv_getResourceData]; +} + +- (void) send_getResourceByHash: (NSString *) authenticationToken : (EDAMGuid) noteGuid : (NSData *) contentHash : (BOOL) withData : (BOOL) withRecognition : (BOOL) withAlternateData +{ + [outProtocol writeMessageBeginWithName: @"getResourceByHash" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getResourceByHash_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (noteGuid != nil) { + [outProtocol writeFieldBeginWithName: @"noteGuid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: noteGuid]; + [outProtocol writeFieldEnd]; + } + if (contentHash != nil) { + [outProtocol writeFieldBeginWithName: @"contentHash" type: TType_STRING fieldID: 3]; + [outProtocol writeBinary: contentHash]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldBeginWithName: @"withData" type: TType_BOOL fieldID: 4]; + [outProtocol writeBool: withData]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldBeginWithName: @"withRecognition" type: TType_BOOL fieldID: 5]; + [outProtocol writeBool: withRecognition]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldBeginWithName: @"withAlternateData" type: TType_BOOL fieldID: 6]; + [outProtocol writeBool: withAlternateData]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMResource *) recv_getResourceByHash +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetResourceByHash_result * result = [[[EDAMGetResourceByHash_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getResourceByHash failed: unknown result"]; +} + +- (EDAMResource *) getResourceByHash: (NSString *) authenticationToken : (EDAMGuid) noteGuid : (NSData *) contentHash : (BOOL) withData : (BOOL) withRecognition : (BOOL) withAlternateData +{ + [self send_getResourceByHash: authenticationToken : noteGuid : contentHash : withData : withRecognition : withAlternateData]; + return [self recv_getResourceByHash]; +} + +- (void) send_getResourceRecognition: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [outProtocol writeMessageBeginWithName: @"getResourceRecognition" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getResourceRecognition_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: guid]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (NSData *) recv_getResourceRecognition +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetResourceRecognition_result * result = [[[EDAMGetResourceRecognition_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getResourceRecognition failed: unknown result"]; +} + +- (NSData *) getResourceRecognition: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [self send_getResourceRecognition: authenticationToken : guid]; + return [self recv_getResourceRecognition]; +} + +- (void) send_getResourceAlternateData: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [outProtocol writeMessageBeginWithName: @"getResourceAlternateData" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getResourceAlternateData_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: guid]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (NSData *) recv_getResourceAlternateData +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetResourceAlternateData_result * result = [[[EDAMGetResourceAlternateData_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getResourceAlternateData failed: unknown result"]; +} + +- (NSData *) getResourceAlternateData: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [self send_getResourceAlternateData: authenticationToken : guid]; + return [self recv_getResourceAlternateData]; +} + +- (void) send_getResourceAttributes: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [outProtocol writeMessageBeginWithName: @"getResourceAttributes" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getResourceAttributes_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: guid]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMResourceAttributes *) recv_getResourceAttributes +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetResourceAttributes_result * result = [[[EDAMGetResourceAttributes_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getResourceAttributes failed: unknown result"]; +} + +- (EDAMResourceAttributes *) getResourceAttributes: (NSString *) authenticationToken : (EDAMGuid) guid +{ + [self send_getResourceAttributes: authenticationToken : guid]; + return [self recv_getResourceAttributes]; +} + +- (void) send_getAccountSize: (NSString *) authenticationToken +{ + [outProtocol writeMessageBeginWithName: @"getAccountSize" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getAccountSize_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (int64_t) recv_getAccountSize +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetAccountSize_result * result = [[[EDAMGetAccountSize_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getAccountSize failed: unknown result"]; +} + +- (int64_t) getAccountSize: (NSString *) authenticationToken +{ + [self send_getAccountSize: authenticationToken]; + return [self recv_getAccountSize]; +} + +- (void) send_getAds: (NSString *) authenticationToken : (EDAMAdParameters *) adParameters +{ + [outProtocol writeMessageBeginWithName: @"getAds" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getAds_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (adParameters != nil) { + [outProtocol writeFieldBeginWithName: @"adParameters" type: TType_STRUCT fieldID: 2]; + [adParameters write: outProtocol]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (NSArray *) recv_getAds +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetAds_result * result = [[[EDAMGetAds_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getAds failed: unknown result"]; +} + +- (NSArray *) getAds: (NSString *) authenticationToken : (EDAMAdParameters *) adParameters +{ + [self send_getAds: authenticationToken : adParameters]; + return [self recv_getAds]; +} + +- (void) send_getRandomAd: (NSString *) authenticationToken : (EDAMAdParameters *) adParameters +{ + [outProtocol writeMessageBeginWithName: @"getRandomAd" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getRandomAd_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (adParameters != nil) { + [outProtocol writeFieldBeginWithName: @"adParameters" type: TType_STRUCT fieldID: 2]; + [adParameters write: outProtocol]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMAd *) recv_getRandomAd +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetRandomAd_result * result = [[[EDAMGetRandomAd_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getRandomAd failed: unknown result"]; +} + +- (EDAMAd *) getRandomAd: (NSString *) authenticationToken : (EDAMAdParameters *) adParameters +{ + [self send_getRandomAd: authenticationToken : adParameters]; + return [self recv_getRandomAd]; +} + +- (void) send_getPublicNotebook: (EDAMUserID) userId : (NSString *) publicUri +{ + [outProtocol writeMessageBeginWithName: @"getPublicNotebook" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getPublicNotebook_args"]; + [outProtocol writeFieldBeginWithName: @"userId" type: TType_I32 fieldID: 1]; + [outProtocol writeI32: userId]; + [outProtocol writeFieldEnd]; + if (publicUri != nil) { + [outProtocol writeFieldBeginWithName: @"publicUri" type: TType_STRING fieldID: 2]; + [outProtocol writeString: publicUri]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMNotebook *) recv_getPublicNotebook +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetPublicNotebook_result * result = [[[EDAMGetPublicNotebook_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getPublicNotebook failed: unknown result"]; +} + +- (EDAMNotebook *) getPublicNotebook: (EDAMUserID) userId : (NSString *) publicUri +{ + [self send_getPublicNotebook: userId : publicUri]; + return [self recv_getPublicNotebook]; +} + +- (void) send_createSharedNotebook: (NSString *) authenticationToken : (EDAMSharedNotebook *) sharedNotebook +{ + [outProtocol writeMessageBeginWithName: @"createSharedNotebook" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"createSharedNotebook_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (sharedNotebook != nil) { + [outProtocol writeFieldBeginWithName: @"sharedNotebook" type: TType_STRUCT fieldID: 2]; + [sharedNotebook write: outProtocol]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMSharedNotebook *) recv_createSharedNotebook +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMCreateSharedNotebook_result * result = [[[EDAMCreateSharedNotebook_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"createSharedNotebook failed: unknown result"]; +} + +- (EDAMSharedNotebook *) createSharedNotebook: (NSString *) authenticationToken : (EDAMSharedNotebook *) sharedNotebook +{ + [self send_createSharedNotebook: authenticationToken : sharedNotebook]; + return [self recv_createSharedNotebook]; +} + +- (void) send_listSharedNotebooks: (NSString *) authenticationToken +{ + [outProtocol writeMessageBeginWithName: @"listSharedNotebooks" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"listSharedNotebooks_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (NSArray *) recv_listSharedNotebooks +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMListSharedNotebooks_result * result = [[[EDAMListSharedNotebooks_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"listSharedNotebooks failed: unknown result"]; +} + +- (NSArray *) listSharedNotebooks: (NSString *) authenticationToken +{ + [self send_listSharedNotebooks: authenticationToken]; + return [self recv_listSharedNotebooks]; +} + +- (void) send_expungeSharedNotebooks: (NSString *) authenticationToken : (NSArray *) sharedNotebookIds +{ + [outProtocol writeMessageBeginWithName: @"expungeSharedNotebooks" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"expungeSharedNotebooks_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (sharedNotebookIds != nil) { + [outProtocol writeFieldBeginWithName: @"sharedNotebookIds" type: TType_LIST fieldID: 2]; + { + [outProtocol writeListBeginWithElementType: TType_I64 size: [sharedNotebookIds count]]; + int i156; + for (i156 = 0; i156 < [sharedNotebookIds count]; i156++) + { + [outProtocol writeI64: [[sharedNotebookIds objectAtIndex: i156] longLongValue]]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (int32_t) recv_expungeSharedNotebooks +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMExpungeSharedNotebooks_result * result = [[[EDAMExpungeSharedNotebooks_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"expungeSharedNotebooks failed: unknown result"]; +} + +- (int32_t) expungeSharedNotebooks: (NSString *) authenticationToken : (NSArray *) sharedNotebookIds +{ + [self send_expungeSharedNotebooks: authenticationToken : sharedNotebookIds]; + return [self recv_expungeSharedNotebooks]; +} + +- (void) send_createLinkedNotebook: (NSString *) authenticationToken : (EDAMLinkedNotebook *) linkedNotebook +{ + [outProtocol writeMessageBeginWithName: @"createLinkedNotebook" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"createLinkedNotebook_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (linkedNotebook != nil) { + [outProtocol writeFieldBeginWithName: @"linkedNotebook" type: TType_STRUCT fieldID: 2]; + [linkedNotebook write: outProtocol]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMLinkedNotebook *) recv_createLinkedNotebook +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMCreateLinkedNotebook_result * result = [[[EDAMCreateLinkedNotebook_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"createLinkedNotebook failed: unknown result"]; +} + +- (EDAMLinkedNotebook *) createLinkedNotebook: (NSString *) authenticationToken : (EDAMLinkedNotebook *) linkedNotebook +{ + [self send_createLinkedNotebook: authenticationToken : linkedNotebook]; + return [self recv_createLinkedNotebook]; +} + +- (void) send_updateLinkedNotebook: (NSString *) authenticationToken : (EDAMLinkedNotebook *) linkedNotebook +{ + [outProtocol writeMessageBeginWithName: @"updateLinkedNotebook" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"updateLinkedNotebook_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (linkedNotebook != nil) { + [outProtocol writeFieldBeginWithName: @"linkedNotebook" type: TType_STRUCT fieldID: 2]; + [linkedNotebook write: outProtocol]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMLinkedNotebook *) recv_updateLinkedNotebook +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMUpdateLinkedNotebook_result * result = [[[EDAMUpdateLinkedNotebook_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"updateLinkedNotebook failed: unknown result"]; +} + +- (EDAMLinkedNotebook *) updateLinkedNotebook: (NSString *) authenticationToken : (EDAMLinkedNotebook *) linkedNotebook +{ + [self send_updateLinkedNotebook: authenticationToken : linkedNotebook]; + return [self recv_updateLinkedNotebook]; +} + +- (void) send_listLinkedNotebooks: (NSString *) authenticationToken +{ + [outProtocol writeMessageBeginWithName: @"listLinkedNotebooks" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"listLinkedNotebooks_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (NSArray *) recv_listLinkedNotebooks +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMListLinkedNotebooks_result * result = [[[EDAMListLinkedNotebooks_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"listLinkedNotebooks failed: unknown result"]; +} + +- (NSArray *) listLinkedNotebooks: (NSString *) authenticationToken +{ + [self send_listLinkedNotebooks: authenticationToken]; + return [self recv_listLinkedNotebooks]; +} + +- (void) send_expungeLinkedNotebook: (NSString *) authenticationToken : (int64_t) linkedNotebookId +{ + [outProtocol writeMessageBeginWithName: @"expungeLinkedNotebook" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"expungeLinkedNotebook_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldBeginWithName: @"linkedNotebookId" type: TType_I64 fieldID: 2]; + [outProtocol writeI64: linkedNotebookId]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (int32_t) recv_expungeLinkedNotebook +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMExpungeLinkedNotebook_result * result = [[[EDAMExpungeLinkedNotebook_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"expungeLinkedNotebook failed: unknown result"]; +} + +- (int32_t) expungeLinkedNotebook: (NSString *) authenticationToken : (int64_t) linkedNotebookId +{ + [self send_expungeLinkedNotebook: authenticationToken : linkedNotebookId]; + return [self recv_expungeLinkedNotebook]; +} + +- (void) send_authenticateToSharedNotebook: (NSString *) shareKey : (NSString *) authenticationToken +{ + [outProtocol writeMessageBeginWithName: @"authenticateToSharedNotebook" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"authenticateToSharedNotebook_args"]; + if (shareKey != nil) { + [outProtocol writeFieldBeginWithName: @"shareKey" type: TType_STRING fieldID: 1]; + [outProtocol writeString: shareKey]; + [outProtocol writeFieldEnd]; + } + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 2]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMAuthenticationResult *) recv_authenticateToSharedNotebook +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMAuthenticateToSharedNotebook_result * result = [[[EDAMAuthenticateToSharedNotebook_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"authenticateToSharedNotebook failed: unknown result"]; +} + +- (EDAMAuthenticationResult *) authenticateToSharedNotebook: (NSString *) shareKey : (NSString *) authenticationToken +{ + [self send_authenticateToSharedNotebook: shareKey : authenticationToken]; + return [self recv_authenticateToSharedNotebook]; +} + +- (void) send_getSharedNotebookByAuth: (NSString *) authenticationToken +{ + [outProtocol writeMessageBeginWithName: @"getSharedNotebookByAuth" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getSharedNotebookByAuth_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMSharedNotebook *) recv_getSharedNotebookByAuth +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetSharedNotebookByAuth_result * result = [[[EDAMGetSharedNotebookByAuth_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getSharedNotebookByAuth failed: unknown result"]; +} + +- (EDAMSharedNotebook *) getSharedNotebookByAuth: (NSString *) authenticationToken +{ + [self send_getSharedNotebookByAuth: authenticationToken]; + return [self recv_getSharedNotebookByAuth]; +} + +- (void) send_emailNote: (NSString *) authenticationToken : (EDAMNoteEmailParameters *) parameters +{ + [outProtocol writeMessageBeginWithName: @"emailNote" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"emailNote_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + if (parameters != nil) { + [outProtocol writeFieldBeginWithName: @"parameters" type: TType_STRUCT fieldID: 2]; + [parameters write: outProtocol]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (void) recv_emailNote +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMEmailNote_result * result = [[[EDAMEmailNote_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + return; +} + +- (void) emailNote: (NSString *) authenticationToken : (EDAMNoteEmailParameters *) parameters +{ + [self send_emailNote: authenticationToken : parameters]; + [self recv_emailNote]; +} + +@end + +@implementation EDAMNoteStoreProcessor + +- (id) initWithNoteStore: (id ) service +{ + self = [super init]; + if (!self) { + return nil; + } + mService = [service retain]; + mMethodMap = [[NSMutableDictionary dictionary] retain]; + { + SEL s = @selector(process_getSyncState_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getSyncState"]; + } + { + SEL s = @selector(process_getSyncChunk_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getSyncChunk"]; + } + { + SEL s = @selector(process_listNotebooks_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"listNotebooks"]; + } + { + SEL s = @selector(process_getNotebook_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getNotebook"]; + } + { + SEL s = @selector(process_getDefaultNotebook_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getDefaultNotebook"]; + } + { + SEL s = @selector(process_createNotebook_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"createNotebook"]; + } + { + SEL s = @selector(process_updateNotebook_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"updateNotebook"]; + } + { + SEL s = @selector(process_expungeNotebook_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"expungeNotebook"]; + } + { + SEL s = @selector(process_listTags_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"listTags"]; + } + { + SEL s = @selector(process_listTagsByNotebook_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"listTagsByNotebook"]; + } + { + SEL s = @selector(process_getTag_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getTag"]; + } + { + SEL s = @selector(process_createTag_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"createTag"]; + } + { + SEL s = @selector(process_updateTag_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"updateTag"]; + } + { + SEL s = @selector(process_untagAll_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"untagAll"]; + } + { + SEL s = @selector(process_expungeTag_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"expungeTag"]; + } + { + SEL s = @selector(process_listSearches_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"listSearches"]; + } + { + SEL s = @selector(process_getSearch_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getSearch"]; + } + { + SEL s = @selector(process_createSearch_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"createSearch"]; + } + { + SEL s = @selector(process_updateSearch_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"updateSearch"]; + } + { + SEL s = @selector(process_expungeSearch_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"expungeSearch"]; + } + { + SEL s = @selector(process_findNotes_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"findNotes"]; + } + { + SEL s = @selector(process_findNoteCounts_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"findNoteCounts"]; + } + { + SEL s = @selector(process_getNote_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getNote"]; + } + { + SEL s = @selector(process_getNoteContent_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getNoteContent"]; + } + { + SEL s = @selector(process_getNoteSearchText_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getNoteSearchText"]; + } + { + SEL s = @selector(process_getNoteTagNames_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getNoteTagNames"]; + } + { + SEL s = @selector(process_createNote_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"createNote"]; + } + { + SEL s = @selector(process_updateNote_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"updateNote"]; + } + { + SEL s = @selector(process_deleteNote_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"deleteNote"]; + } + { + SEL s = @selector(process_expungeNote_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"expungeNote"]; + } + { + SEL s = @selector(process_expungeNotes_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"expungeNotes"]; + } + { + SEL s = @selector(process_expungeInactiveNotes_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"expungeInactiveNotes"]; + } + { + SEL s = @selector(process_copyNote_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"copyNote"]; + } + { + SEL s = @selector(process_listNoteVersions_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"listNoteVersions"]; + } + { + SEL s = @selector(process_getNoteVersion_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getNoteVersion"]; + } + { + SEL s = @selector(process_getResource_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getResource"]; + } + { + SEL s = @selector(process_updateResource_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"updateResource"]; + } + { + SEL s = @selector(process_getResourceData_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getResourceData"]; + } + { + SEL s = @selector(process_getResourceByHash_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getResourceByHash"]; + } + { + SEL s = @selector(process_getResourceRecognition_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getResourceRecognition"]; + } + { + SEL s = @selector(process_getResourceAlternateData_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getResourceAlternateData"]; + } + { + SEL s = @selector(process_getResourceAttributes_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getResourceAttributes"]; + } + { + SEL s = @selector(process_getAccountSize_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getAccountSize"]; + } + { + SEL s = @selector(process_getAds_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getAds"]; + } + { + SEL s = @selector(process_getRandomAd_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getRandomAd"]; + } + { + SEL s = @selector(process_getPublicNotebook_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getPublicNotebook"]; + } + { + SEL s = @selector(process_createSharedNotebook_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"createSharedNotebook"]; + } + { + SEL s = @selector(process_listSharedNotebooks_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"listSharedNotebooks"]; + } + { + SEL s = @selector(process_expungeSharedNotebooks_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"expungeSharedNotebooks"]; + } + { + SEL s = @selector(process_createLinkedNotebook_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"createLinkedNotebook"]; + } + { + SEL s = @selector(process_updateLinkedNotebook_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"updateLinkedNotebook"]; + } + { + SEL s = @selector(process_listLinkedNotebooks_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"listLinkedNotebooks"]; + } + { + SEL s = @selector(process_expungeLinkedNotebook_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"expungeLinkedNotebook"]; + } + { + SEL s = @selector(process_authenticateToSharedNotebook_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"authenticateToSharedNotebook"]; + } + { + SEL s = @selector(process_getSharedNotebookByAuth_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getSharedNotebookByAuth"]; + } + { + SEL s = @selector(process_emailNote_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"emailNote"]; + } + return self; +} + +- (id) service +{ + return [[mService retain] autorelease]; +} + +- (BOOL) processOnInputProtocol: (id ) inProtocol + outputProtocol: (id ) outProtocol +{ + NSString * messageName; + int messageType; + int seqID; + [inProtocol readMessageBeginReturningName: &messageName + type: &messageType + sequenceID: &seqID]; + NSInvocation * invocation = [mMethodMap valueForKey: messageName]; + if (invocation == nil) { + [TProtocolUtil skipType: TType_STRUCT onProtocol: inProtocol]; + [inProtocol readMessageEnd]; + TApplicationException * x = [TApplicationException exceptionWithType: TApplicationException_UNKNOWN_METHOD reason: [NSString stringWithFormat: @"Invalid method name: '%@'", messageName]]; + [outProtocol writeMessageBeginWithName: messageName + type: TMessageType_EXCEPTION + sequenceID: seqID]; + [x write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + return YES; + } + // NSInvocation does not conform to NSCopying protocol + NSInvocation * i = [NSInvocation invocationWithMethodSignature: [invocation methodSignature]]; + [i setSelector: [invocation selector]]; + [i setArgument: &seqID atIndex: 2]; + [i setArgument: &inProtocol atIndex: 3]; + [i setArgument: &outProtocol atIndex: 4]; + [i setTarget: self]; + [i invoke]; + return YES; +} + +- (void) process_getSyncState_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetSyncState_args * args = [[EDAMgetSyncState_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetSyncState_result * result = [[EDAMGetSyncState_result alloc] init]; + [result setSuccess: [mService getSyncState: [args authenticationToken]]]; + [outProtocol writeMessageBeginWithName: @"getSyncState" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getSyncChunk_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetSyncChunk_args * args = [[EDAMgetSyncChunk_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetSyncChunk_result * result = [[EDAMGetSyncChunk_result alloc] init]; + [result setSuccess: [mService getSyncChunk: [args authenticationToken]: [args afterUSN]: [args maxEntries]: [args fullSyncOnly]]]; + [outProtocol writeMessageBeginWithName: @"getSyncChunk" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_listNotebooks_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMlistNotebooks_args * args = [[EDAMlistNotebooks_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMListNotebooks_result * result = [[EDAMListNotebooks_result alloc] init]; + [result setSuccess: [mService listNotebooks: [args authenticationToken]]]; + [outProtocol writeMessageBeginWithName: @"listNotebooks" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getNotebook_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetNotebook_args * args = [[EDAMgetNotebook_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetNotebook_result * result = [[EDAMGetNotebook_result alloc] init]; + [result setSuccess: [mService getNotebook: [args authenticationToken]: [args guid]]]; + [outProtocol writeMessageBeginWithName: @"getNotebook" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getDefaultNotebook_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetDefaultNotebook_args * args = [[EDAMgetDefaultNotebook_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetDefaultNotebook_result * result = [[EDAMGetDefaultNotebook_result alloc] init]; + [result setSuccess: [mService getDefaultNotebook: [args authenticationToken]]]; + [outProtocol writeMessageBeginWithName: @"getDefaultNotebook" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_createNotebook_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMcreateNotebook_args * args = [[EDAMcreateNotebook_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMCreateNotebook_result * result = [[EDAMCreateNotebook_result alloc] init]; + [result setSuccess: [mService createNotebook: [args authenticationToken]: [args notebook]]]; + [outProtocol writeMessageBeginWithName: @"createNotebook" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_updateNotebook_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMupdateNotebook_args * args = [[EDAMupdateNotebook_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMUpdateNotebook_result * result = [[EDAMUpdateNotebook_result alloc] init]; + [result setSuccess: [mService updateNotebook: [args authenticationToken]: [args notebook]]]; + [outProtocol writeMessageBeginWithName: @"updateNotebook" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_expungeNotebook_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMexpungeNotebook_args * args = [[EDAMexpungeNotebook_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMExpungeNotebook_result * result = [[EDAMExpungeNotebook_result alloc] init]; + [result setSuccess: [mService expungeNotebook: [args authenticationToken]: [args guid]]]; + [outProtocol writeMessageBeginWithName: @"expungeNotebook" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_listTags_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMlistTags_args * args = [[EDAMlistTags_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMListTags_result * result = [[EDAMListTags_result alloc] init]; + [result setSuccess: [mService listTags: [args authenticationToken]]]; + [outProtocol writeMessageBeginWithName: @"listTags" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_listTagsByNotebook_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMlistTagsByNotebook_args * args = [[EDAMlistTagsByNotebook_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMListTagsByNotebook_result * result = [[EDAMListTagsByNotebook_result alloc] init]; + [result setSuccess: [mService listTagsByNotebook: [args authenticationToken]: [args notebookGuid]]]; + [outProtocol writeMessageBeginWithName: @"listTagsByNotebook" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getTag_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetTag_args * args = [[EDAMgetTag_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetTag_result * result = [[EDAMGetTag_result alloc] init]; + [result setSuccess: [mService getTag: [args authenticationToken]: [args guid]]]; + [outProtocol writeMessageBeginWithName: @"getTag" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_createTag_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMcreateTag_args * args = [[EDAMcreateTag_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMCreateTag_result * result = [[EDAMCreateTag_result alloc] init]; + [result setSuccess: [mService createTag: [args authenticationToken]: [args tag]]]; + [outProtocol writeMessageBeginWithName: @"createTag" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_updateTag_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMupdateTag_args * args = [[EDAMupdateTag_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMUpdateTag_result * result = [[EDAMUpdateTag_result alloc] init]; + [result setSuccess: [mService updateTag: [args authenticationToken]: [args tag]]]; + [outProtocol writeMessageBeginWithName: @"updateTag" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_untagAll_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMuntagAll_args * args = [[EDAMuntagAll_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMUntagAll_result * result = [[EDAMUntagAll_result alloc] init]; + [mService untagAll: [args authenticationToken]: [args guid]]; + [outProtocol writeMessageBeginWithName: @"untagAll" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_expungeTag_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMexpungeTag_args * args = [[EDAMexpungeTag_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMExpungeTag_result * result = [[EDAMExpungeTag_result alloc] init]; + [result setSuccess: [mService expungeTag: [args authenticationToken]: [args guid]]]; + [outProtocol writeMessageBeginWithName: @"expungeTag" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_listSearches_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMlistSearches_args * args = [[EDAMlistSearches_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMListSearches_result * result = [[EDAMListSearches_result alloc] init]; + [result setSuccess: [mService listSearches: [args authenticationToken]]]; + [outProtocol writeMessageBeginWithName: @"listSearches" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getSearch_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetSearch_args * args = [[EDAMgetSearch_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetSearch_result * result = [[EDAMGetSearch_result alloc] init]; + [result setSuccess: [mService getSearch: [args authenticationToken]: [args guid]]]; + [outProtocol writeMessageBeginWithName: @"getSearch" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_createSearch_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMcreateSearch_args * args = [[EDAMcreateSearch_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMCreateSearch_result * result = [[EDAMCreateSearch_result alloc] init]; + [result setSuccess: [mService createSearch: [args authenticationToken]: [args search]]]; + [outProtocol writeMessageBeginWithName: @"createSearch" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_updateSearch_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMupdateSearch_args * args = [[EDAMupdateSearch_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMUpdateSearch_result * result = [[EDAMUpdateSearch_result alloc] init]; + [result setSuccess: [mService updateSearch: [args authenticationToken]: [args search]]]; + [outProtocol writeMessageBeginWithName: @"updateSearch" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_expungeSearch_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMexpungeSearch_args * args = [[EDAMexpungeSearch_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMExpungeSearch_result * result = [[EDAMExpungeSearch_result alloc] init]; + [result setSuccess: [mService expungeSearch: [args authenticationToken]: [args guid]]]; + [outProtocol writeMessageBeginWithName: @"expungeSearch" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_findNotes_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMfindNotes_args * args = [[EDAMfindNotes_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMFindNotes_result * result = [[EDAMFindNotes_result alloc] init]; + [result setSuccess: [mService findNotes: [args authenticationToken]: [args filter]: [args offset]: [args maxNotes]]]; + [outProtocol writeMessageBeginWithName: @"findNotes" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_findNoteCounts_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMfindNoteCounts_args * args = [[EDAMfindNoteCounts_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMFindNoteCounts_result * result = [[EDAMFindNoteCounts_result alloc] init]; + [result setSuccess: [mService findNoteCounts: [args authenticationToken]: [args filter]: [args withTrash]]]; + [outProtocol writeMessageBeginWithName: @"findNoteCounts" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getNote_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetNote_args * args = [[EDAMgetNote_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetNote_result * result = [[EDAMGetNote_result alloc] init]; + [result setSuccess: [mService getNote: [args authenticationToken]: [args guid]: [args withContent]: [args withResourcesData]: [args withResourcesRecognition]: [args withResourcesAlternateData]]]; + [outProtocol writeMessageBeginWithName: @"getNote" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getNoteContent_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetNoteContent_args * args = [[EDAMgetNoteContent_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetNoteContent_result * result = [[EDAMGetNoteContent_result alloc] init]; + [result setSuccess: [mService getNoteContent: [args authenticationToken]: [args guid]]]; + [outProtocol writeMessageBeginWithName: @"getNoteContent" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getNoteSearchText_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetNoteSearchText_args * args = [[EDAMgetNoteSearchText_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetNoteSearchText_result * result = [[EDAMGetNoteSearchText_result alloc] init]; + [result setSuccess: [mService getNoteSearchText: [args authenticationToken]: [args guid]]]; + [outProtocol writeMessageBeginWithName: @"getNoteSearchText" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getNoteTagNames_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetNoteTagNames_args * args = [[EDAMgetNoteTagNames_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetNoteTagNames_result * result = [[EDAMGetNoteTagNames_result alloc] init]; + [result setSuccess: [mService getNoteTagNames: [args authenticationToken]: [args guid]]]; + [outProtocol writeMessageBeginWithName: @"getNoteTagNames" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_createNote_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMcreateNote_args * args = [[EDAMcreateNote_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMCreateNote_result * result = [[EDAMCreateNote_result alloc] init]; + [result setSuccess: [mService createNote: [args authenticationToken]: [args note]]]; + [outProtocol writeMessageBeginWithName: @"createNote" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_updateNote_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMupdateNote_args * args = [[EDAMupdateNote_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMUpdateNote_result * result = [[EDAMUpdateNote_result alloc] init]; + [result setSuccess: [mService updateNote: [args authenticationToken]: [args note]]]; + [outProtocol writeMessageBeginWithName: @"updateNote" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_deleteNote_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMdeleteNote_args * args = [[EDAMdeleteNote_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMDeleteNote_result * result = [[EDAMDeleteNote_result alloc] init]; + [result setSuccess: [mService deleteNote: [args authenticationToken]: [args guid]]]; + [outProtocol writeMessageBeginWithName: @"deleteNote" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_expungeNote_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMexpungeNote_args * args = [[EDAMexpungeNote_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMExpungeNote_result * result = [[EDAMExpungeNote_result alloc] init]; + [result setSuccess: [mService expungeNote: [args authenticationToken]: [args guid]]]; + [outProtocol writeMessageBeginWithName: @"expungeNote" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_expungeNotes_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMexpungeNotes_args * args = [[EDAMexpungeNotes_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMExpungeNotes_result * result = [[EDAMExpungeNotes_result alloc] init]; + [result setSuccess: [mService expungeNotes: [args authenticationToken]: [args noteGuids]]]; + [outProtocol writeMessageBeginWithName: @"expungeNotes" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_expungeInactiveNotes_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMexpungeInactiveNotes_args * args = [[EDAMexpungeInactiveNotes_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMExpungeInactiveNotes_result * result = [[EDAMExpungeInactiveNotes_result alloc] init]; + [result setSuccess: [mService expungeInactiveNotes: [args authenticationToken]]]; + [outProtocol writeMessageBeginWithName: @"expungeInactiveNotes" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_copyNote_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMcopyNote_args * args = [[EDAMcopyNote_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMCopyNote_result * result = [[EDAMCopyNote_result alloc] init]; + [result setSuccess: [mService copyNote: [args authenticationToken]: [args noteGuid]: [args toNotebookGuid]]]; + [outProtocol writeMessageBeginWithName: @"copyNote" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_listNoteVersions_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMlistNoteVersions_args * args = [[EDAMlistNoteVersions_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMListNoteVersions_result * result = [[EDAMListNoteVersions_result alloc] init]; + [result setSuccess: [mService listNoteVersions: [args authenticationToken]: [args noteGuid]]]; + [outProtocol writeMessageBeginWithName: @"listNoteVersions" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getNoteVersion_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetNoteVersion_args * args = [[EDAMgetNoteVersion_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetNoteVersion_result * result = [[EDAMGetNoteVersion_result alloc] init]; + [result setSuccess: [mService getNoteVersion: [args authenticationToken]: [args noteGuid]: [args updateSequenceNum]: [args withResourcesData]: [args withResourcesRecognition]: [args withResourcesAlternateData]]]; + [outProtocol writeMessageBeginWithName: @"getNoteVersion" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getResource_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetResource_args * args = [[EDAMgetResource_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetResource_result * result = [[EDAMGetResource_result alloc] init]; + [result setSuccess: [mService getResource: [args authenticationToken]: [args guid]: [args withData]: [args withRecognition]: [args withAttributes]: [args withAlternateData]]]; + [outProtocol writeMessageBeginWithName: @"getResource" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_updateResource_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMupdateResource_args * args = [[EDAMupdateResource_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMUpdateResource_result * result = [[EDAMUpdateResource_result alloc] init]; + [result setSuccess: [mService updateResource: [args authenticationToken]: [args resource]]]; + [outProtocol writeMessageBeginWithName: @"updateResource" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getResourceData_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetResourceData_args * args = [[EDAMgetResourceData_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetResourceData_result * result = [[EDAMGetResourceData_result alloc] init]; + [result setSuccess: [mService getResourceData: [args authenticationToken]: [args guid]]]; + [outProtocol writeMessageBeginWithName: @"getResourceData" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getResourceByHash_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetResourceByHash_args * args = [[EDAMgetResourceByHash_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetResourceByHash_result * result = [[EDAMGetResourceByHash_result alloc] init]; + [result setSuccess: [mService getResourceByHash: [args authenticationToken]: [args noteGuid]: [args contentHash]: [args withData]: [args withRecognition]: [args withAlternateData]]]; + [outProtocol writeMessageBeginWithName: @"getResourceByHash" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getResourceRecognition_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetResourceRecognition_args * args = [[EDAMgetResourceRecognition_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetResourceRecognition_result * result = [[EDAMGetResourceRecognition_result alloc] init]; + [result setSuccess: [mService getResourceRecognition: [args authenticationToken]: [args guid]]]; + [outProtocol writeMessageBeginWithName: @"getResourceRecognition" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getResourceAlternateData_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetResourceAlternateData_args * args = [[EDAMgetResourceAlternateData_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetResourceAlternateData_result * result = [[EDAMGetResourceAlternateData_result alloc] init]; + [result setSuccess: [mService getResourceAlternateData: [args authenticationToken]: [args guid]]]; + [outProtocol writeMessageBeginWithName: @"getResourceAlternateData" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getResourceAttributes_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetResourceAttributes_args * args = [[EDAMgetResourceAttributes_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetResourceAttributes_result * result = [[EDAMGetResourceAttributes_result alloc] init]; + [result setSuccess: [mService getResourceAttributes: [args authenticationToken]: [args guid]]]; + [outProtocol writeMessageBeginWithName: @"getResourceAttributes" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getAccountSize_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetAccountSize_args * args = [[EDAMgetAccountSize_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetAccountSize_result * result = [[EDAMGetAccountSize_result alloc] init]; + [result setSuccess: [mService getAccountSize: [args authenticationToken]]]; + [outProtocol writeMessageBeginWithName: @"getAccountSize" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getAds_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetAds_args * args = [[EDAMgetAds_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetAds_result * result = [[EDAMGetAds_result alloc] init]; + [result setSuccess: [mService getAds: [args authenticationToken]: [args adParameters]]]; + [outProtocol writeMessageBeginWithName: @"getAds" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getRandomAd_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetRandomAd_args * args = [[EDAMgetRandomAd_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetRandomAd_result * result = [[EDAMGetRandomAd_result alloc] init]; + [result setSuccess: [mService getRandomAd: [args authenticationToken]: [args adParameters]]]; + [outProtocol writeMessageBeginWithName: @"getRandomAd" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getPublicNotebook_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetPublicNotebook_args * args = [[EDAMgetPublicNotebook_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetPublicNotebook_result * result = [[EDAMGetPublicNotebook_result alloc] init]; + [result setSuccess: [mService getPublicNotebook: [args userId]: [args publicUri]]]; + [outProtocol writeMessageBeginWithName: @"getPublicNotebook" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_createSharedNotebook_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMcreateSharedNotebook_args * args = [[EDAMcreateSharedNotebook_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMCreateSharedNotebook_result * result = [[EDAMCreateSharedNotebook_result alloc] init]; + [result setSuccess: [mService createSharedNotebook: [args authenticationToken]: [args sharedNotebook]]]; + [outProtocol writeMessageBeginWithName: @"createSharedNotebook" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_listSharedNotebooks_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMlistSharedNotebooks_args * args = [[EDAMlistSharedNotebooks_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMListSharedNotebooks_result * result = [[EDAMListSharedNotebooks_result alloc] init]; + [result setSuccess: [mService listSharedNotebooks: [args authenticationToken]]]; + [outProtocol writeMessageBeginWithName: @"listSharedNotebooks" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_expungeSharedNotebooks_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMexpungeSharedNotebooks_args * args = [[EDAMexpungeSharedNotebooks_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMExpungeSharedNotebooks_result * result = [[EDAMExpungeSharedNotebooks_result alloc] init]; + [result setSuccess: [mService expungeSharedNotebooks: [args authenticationToken]: [args sharedNotebookIds]]]; + [outProtocol writeMessageBeginWithName: @"expungeSharedNotebooks" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_createLinkedNotebook_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMcreateLinkedNotebook_args * args = [[EDAMcreateLinkedNotebook_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMCreateLinkedNotebook_result * result = [[EDAMCreateLinkedNotebook_result alloc] init]; + [result setSuccess: [mService createLinkedNotebook: [args authenticationToken]: [args linkedNotebook]]]; + [outProtocol writeMessageBeginWithName: @"createLinkedNotebook" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_updateLinkedNotebook_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMupdateLinkedNotebook_args * args = [[EDAMupdateLinkedNotebook_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMUpdateLinkedNotebook_result * result = [[EDAMUpdateLinkedNotebook_result alloc] init]; + [result setSuccess: [mService updateLinkedNotebook: [args authenticationToken]: [args linkedNotebook]]]; + [outProtocol writeMessageBeginWithName: @"updateLinkedNotebook" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_listLinkedNotebooks_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMlistLinkedNotebooks_args * args = [[EDAMlistLinkedNotebooks_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMListLinkedNotebooks_result * result = [[EDAMListLinkedNotebooks_result alloc] init]; + [result setSuccess: [mService listLinkedNotebooks: [args authenticationToken]]]; + [outProtocol writeMessageBeginWithName: @"listLinkedNotebooks" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_expungeLinkedNotebook_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMexpungeLinkedNotebook_args * args = [[EDAMexpungeLinkedNotebook_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMExpungeLinkedNotebook_result * result = [[EDAMExpungeLinkedNotebook_result alloc] init]; + [result setSuccess: [mService expungeLinkedNotebook: [args authenticationToken]: [args linkedNotebookId]]]; + [outProtocol writeMessageBeginWithName: @"expungeLinkedNotebook" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_authenticateToSharedNotebook_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMauthenticateToSharedNotebook_args * args = [[EDAMauthenticateToSharedNotebook_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMAuthenticateToSharedNotebook_result * result = [[EDAMAuthenticateToSharedNotebook_result alloc] init]; + [result setSuccess: [mService authenticateToSharedNotebook: [args shareKey]: [args authenticationToken]]]; + [outProtocol writeMessageBeginWithName: @"authenticateToSharedNotebook" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getSharedNotebookByAuth_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetSharedNotebookByAuth_args * args = [[EDAMgetSharedNotebookByAuth_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetSharedNotebookByAuth_result * result = [[EDAMGetSharedNotebookByAuth_result alloc] init]; + [result setSuccess: [mService getSharedNotebookByAuth: [args authenticationToken]]]; + [outProtocol writeMessageBeginWithName: @"getSharedNotebookByAuth" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_emailNote_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMemailNote_args * args = [[EDAMemailNote_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMEmailNote_result * result = [[EDAMEmailNote_result alloc] init]; + [mService emailNote: [args authenticationToken]: [args parameters]]; + [outProtocol writeMessageBeginWithName: @"emailNote" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) dealloc +{ + [mService release]; + [mMethodMap release]; + [super dealloc]; +} + +@end + diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/Types.h b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/Types.h new file mode 100644 index 00000000..b8894955 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/Types.h @@ -0,0 +1,1338 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ + +#import + +#import "TProtocol.h" +#import "TApplicationException.h" +#import "TProtocolUtil.h" +#import "TProcessor.h" + +#import "EDAMLimits.h" + +enum EDAMPrivilegeLevel { + PrivilegeLevel_NORMAL = 1, + PrivilegeLevel_PREMIUM = 3, + PrivilegeLevel_MANAGER = 7, + PrivilegeLevel_SUPPORT = 8, + PrivilegeLevel_ADMIN = 9 +}; + +enum EDAMQueryFormat { + QueryFormat_USER = 1, + QueryFormat_SEXP = 2 +}; + +enum EDAMNoteSortOrder { + NoteSortOrder_CREATED = 1, + NoteSortOrder_UPDATED = 2, + NoteSortOrder_RELEVANCE = 3, + NoteSortOrder_UPDATE_SEQUENCE_NUMBER = 4, + NoteSortOrder_TITLE = 5 +}; + +enum EDAMPremiumOrderStatus { + PremiumOrderStatus_NONE = 0, + PremiumOrderStatus_PENDING = 1, + PremiumOrderStatus_ACTIVE = 2, + PremiumOrderStatus_FAILED = 3, + PremiumOrderStatus_CANCELLATION_PENDING = 4, + PremiumOrderStatus_CANCELED = 5 +}; + +typedef int32_t EDAMUserID; + +typedef NSString * EDAMGuid; + +typedef int64_t EDAMTimestamp; + +@interface EDAMData : NSObject { + NSData * __bodyHash; + int32_t __size; + NSData * __body; + + BOOL __bodyHash_isset; + BOOL __size_isset; + BOOL __body_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=bodyHash, setter=setBodyHash:) NSData * bodyHash; +@property (nonatomic, getter=size, setter=setSize:) int32_t size; +@property (nonatomic, retain, getter=body, setter=setBody:) NSData * body; +#endif + +- (id) initWithBodyHash: (NSData *) bodyHash size: (int32_t) size body: (NSData *) body; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSData *) bodyHash; +- (void) setBodyHash: (NSData *) bodyHash; +- (BOOL) bodyHashIsSet; + +- (int32_t) size; +- (void) setSize: (int32_t) size; +- (BOOL) sizeIsSet; + +- (NSData *) body; +- (void) setBody: (NSData *) body; +- (BOOL) bodyIsSet; + +@end + +@interface EDAMUserAttributes : NSObject { + NSString * __defaultLocationName; + double __defaultLatitude; + double __defaultLongitude; + BOOL __preactivation; + NSArray * __viewedPromotions; + NSString * __incomingEmailAddress; + NSArray * __recentMailedAddresses; + NSString * __comments; + EDAMTimestamp __dateAgreedToTermsOfService; + int32_t __maxReferrals; + int32_t __referralCount; + NSString * __refererCode; + EDAMTimestamp __sentEmailDate; + int32_t __sentEmailCount; + int32_t __dailyEmailLimit; + EDAMTimestamp __emailOptOutDate; + EDAMTimestamp __partnerEmailOptInDate; + NSString * __preferredLanguage; + NSString * __preferredCountry; + BOOL __clipFullPage; + NSString * __twitterUserName; + NSString * __twitterId; + NSString * __groupName; + NSString * __recognitionLanguage; + int64_t __customerProfileId; + NSString * __referralProof; + + BOOL __defaultLocationName_isset; + BOOL __defaultLatitude_isset; + BOOL __defaultLongitude_isset; + BOOL __preactivation_isset; + BOOL __viewedPromotions_isset; + BOOL __incomingEmailAddress_isset; + BOOL __recentMailedAddresses_isset; + BOOL __comments_isset; + BOOL __dateAgreedToTermsOfService_isset; + BOOL __maxReferrals_isset; + BOOL __referralCount_isset; + BOOL __refererCode_isset; + BOOL __sentEmailDate_isset; + BOOL __sentEmailCount_isset; + BOOL __dailyEmailLimit_isset; + BOOL __emailOptOutDate_isset; + BOOL __partnerEmailOptInDate_isset; + BOOL __preferredLanguage_isset; + BOOL __preferredCountry_isset; + BOOL __clipFullPage_isset; + BOOL __twitterUserName_isset; + BOOL __twitterId_isset; + BOOL __groupName_isset; + BOOL __recognitionLanguage_isset; + BOOL __customerProfileId_isset; + BOOL __referralProof_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=defaultLocationName, setter=setDefaultLocationName:) NSString * defaultLocationName; +@property (nonatomic, getter=defaultLatitude, setter=setDefaultLatitude:) double defaultLatitude; +@property (nonatomic, getter=defaultLongitude, setter=setDefaultLongitude:) double defaultLongitude; +@property (nonatomic, getter=preactivation, setter=setPreactivation:) BOOL preactivation; +@property (nonatomic, retain, getter=viewedPromotions, setter=setViewedPromotions:) NSArray * viewedPromotions; +@property (nonatomic, retain, getter=incomingEmailAddress, setter=setIncomingEmailAddress:) NSString * incomingEmailAddress; +@property (nonatomic, retain, getter=recentMailedAddresses, setter=setRecentMailedAddresses:) NSArray * recentMailedAddresses; +@property (nonatomic, retain, getter=comments, setter=setComments:) NSString * comments; +@property (nonatomic, getter=dateAgreedToTermsOfService, setter=setDateAgreedToTermsOfService:) EDAMTimestamp dateAgreedToTermsOfService; +@property (nonatomic, getter=maxReferrals, setter=setMaxReferrals:) int32_t maxReferrals; +@property (nonatomic, getter=referralCount, setter=setReferralCount:) int32_t referralCount; +@property (nonatomic, retain, getter=refererCode, setter=setRefererCode:) NSString * refererCode; +@property (nonatomic, getter=sentEmailDate, setter=setSentEmailDate:) EDAMTimestamp sentEmailDate; +@property (nonatomic, getter=sentEmailCount, setter=setSentEmailCount:) int32_t sentEmailCount; +@property (nonatomic, getter=dailyEmailLimit, setter=setDailyEmailLimit:) int32_t dailyEmailLimit; +@property (nonatomic, getter=emailOptOutDate, setter=setEmailOptOutDate:) EDAMTimestamp emailOptOutDate; +@property (nonatomic, getter=partnerEmailOptInDate, setter=setPartnerEmailOptInDate:) EDAMTimestamp partnerEmailOptInDate; +@property (nonatomic, retain, getter=preferredLanguage, setter=setPreferredLanguage:) NSString * preferredLanguage; +@property (nonatomic, retain, getter=preferredCountry, setter=setPreferredCountry:) NSString * preferredCountry; +@property (nonatomic, getter=clipFullPage, setter=setClipFullPage:) BOOL clipFullPage; +@property (nonatomic, retain, getter=twitterUserName, setter=setTwitterUserName:) NSString * twitterUserName; +@property (nonatomic, retain, getter=twitterId, setter=setTwitterId:) NSString * twitterId; +@property (nonatomic, retain, getter=groupName, setter=setGroupName:) NSString * groupName; +@property (nonatomic, retain, getter=recognitionLanguage, setter=setRecognitionLanguage:) NSString * recognitionLanguage; +@property (nonatomic, getter=customerProfileId, setter=setCustomerProfileId:) int64_t customerProfileId; +@property (nonatomic, retain, getter=referralProof, setter=setReferralProof:) NSString * referralProof; +#endif + +- (id) initWithDefaultLocationName: (NSString *) defaultLocationName defaultLatitude: (double) defaultLatitude defaultLongitude: (double) defaultLongitude preactivation: (BOOL) preactivation viewedPromotions: (NSArray *) viewedPromotions incomingEmailAddress: (NSString *) incomingEmailAddress recentMailedAddresses: (NSArray *) recentMailedAddresses comments: (NSString *) comments dateAgreedToTermsOfService: (EDAMTimestamp) dateAgreedToTermsOfService maxReferrals: (int32_t) maxReferrals referralCount: (int32_t) referralCount refererCode: (NSString *) refererCode sentEmailDate: (EDAMTimestamp) sentEmailDate sentEmailCount: (int32_t) sentEmailCount dailyEmailLimit: (int32_t) dailyEmailLimit emailOptOutDate: (EDAMTimestamp) emailOptOutDate partnerEmailOptInDate: (EDAMTimestamp) partnerEmailOptInDate preferredLanguage: (NSString *) preferredLanguage preferredCountry: (NSString *) preferredCountry clipFullPage: (BOOL) clipFullPage twitterUserName: (NSString *) twitterUserName twitterId: (NSString *) twitterId groupName: (NSString *) groupName recognitionLanguage: (NSString *) recognitionLanguage customerProfileId: (int64_t) customerProfileId referralProof: (NSString *) referralProof; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) defaultLocationName; +- (void) setDefaultLocationName: (NSString *) defaultLocationName; +- (BOOL) defaultLocationNameIsSet; + +- (double) defaultLatitude; +- (void) setDefaultLatitude: (double) defaultLatitude; +- (BOOL) defaultLatitudeIsSet; + +- (double) defaultLongitude; +- (void) setDefaultLongitude: (double) defaultLongitude; +- (BOOL) defaultLongitudeIsSet; + +- (BOOL) preactivation; +- (void) setPreactivation: (BOOL) preactivation; +- (BOOL) preactivationIsSet; + +- (NSArray *) viewedPromotions; +- (void) setViewedPromotions: (NSArray *) viewedPromotions; +- (BOOL) viewedPromotionsIsSet; + +- (NSString *) incomingEmailAddress; +- (void) setIncomingEmailAddress: (NSString *) incomingEmailAddress; +- (BOOL) incomingEmailAddressIsSet; + +- (NSArray *) recentMailedAddresses; +- (void) setRecentMailedAddresses: (NSArray *) recentMailedAddresses; +- (BOOL) recentMailedAddressesIsSet; + +- (NSString *) comments; +- (void) setComments: (NSString *) comments; +- (BOOL) commentsIsSet; + +- (EDAMTimestamp) dateAgreedToTermsOfService; +- (void) setDateAgreedToTermsOfService: (EDAMTimestamp) dateAgreedToTermsOfService; +- (BOOL) dateAgreedToTermsOfServiceIsSet; + +- (int32_t) maxReferrals; +- (void) setMaxReferrals: (int32_t) maxReferrals; +- (BOOL) maxReferralsIsSet; + +- (int32_t) referralCount; +- (void) setReferralCount: (int32_t) referralCount; +- (BOOL) referralCountIsSet; + +- (NSString *) refererCode; +- (void) setRefererCode: (NSString *) refererCode; +- (BOOL) refererCodeIsSet; + +- (EDAMTimestamp) sentEmailDate; +- (void) setSentEmailDate: (EDAMTimestamp) sentEmailDate; +- (BOOL) sentEmailDateIsSet; + +- (int32_t) sentEmailCount; +- (void) setSentEmailCount: (int32_t) sentEmailCount; +- (BOOL) sentEmailCountIsSet; + +- (int32_t) dailyEmailLimit; +- (void) setDailyEmailLimit: (int32_t) dailyEmailLimit; +- (BOOL) dailyEmailLimitIsSet; + +- (EDAMTimestamp) emailOptOutDate; +- (void) setEmailOptOutDate: (EDAMTimestamp) emailOptOutDate; +- (BOOL) emailOptOutDateIsSet; + +- (EDAMTimestamp) partnerEmailOptInDate; +- (void) setPartnerEmailOptInDate: (EDAMTimestamp) partnerEmailOptInDate; +- (BOOL) partnerEmailOptInDateIsSet; + +- (NSString *) preferredLanguage; +- (void) setPreferredLanguage: (NSString *) preferredLanguage; +- (BOOL) preferredLanguageIsSet; + +- (NSString *) preferredCountry; +- (void) setPreferredCountry: (NSString *) preferredCountry; +- (BOOL) preferredCountryIsSet; + +- (BOOL) clipFullPage; +- (void) setClipFullPage: (BOOL) clipFullPage; +- (BOOL) clipFullPageIsSet; + +- (NSString *) twitterUserName; +- (void) setTwitterUserName: (NSString *) twitterUserName; +- (BOOL) twitterUserNameIsSet; + +- (NSString *) twitterId; +- (void) setTwitterId: (NSString *) twitterId; +- (BOOL) twitterIdIsSet; + +- (NSString *) groupName; +- (void) setGroupName: (NSString *) groupName; +- (BOOL) groupNameIsSet; + +- (NSString *) recognitionLanguage; +- (void) setRecognitionLanguage: (NSString *) recognitionLanguage; +- (BOOL) recognitionLanguageIsSet; + +- (int64_t) customerProfileId; +- (void) setCustomerProfileId: (int64_t) customerProfileId; +- (BOOL) customerProfileIdIsSet; + +- (NSString *) referralProof; +- (void) setReferralProof: (NSString *) referralProof; +- (BOOL) referralProofIsSet; + +@end + +@interface EDAMAccounting : NSObject { + int64_t __uploadLimit; + EDAMTimestamp __uploadLimitEnd; + int64_t __uploadLimitNextMonth; + int __premiumServiceStatus; + NSString * __premiumOrderNumber; + NSString * __premiumCommerceService; + EDAMTimestamp __premiumServiceStart; + NSString * __premiumServiceSKU; + EDAMTimestamp __lastSuccessfulCharge; + EDAMTimestamp __lastFailedCharge; + NSString * __lastFailedChargeReason; + EDAMTimestamp __nextPaymentDue; + EDAMTimestamp __premiumLockUntil; + EDAMTimestamp __updated; + NSString * __premiumSubscriptionNumber; + EDAMTimestamp __lastRequestedCharge; + + BOOL __uploadLimit_isset; + BOOL __uploadLimitEnd_isset; + BOOL __uploadLimitNextMonth_isset; + BOOL __premiumServiceStatus_isset; + BOOL __premiumOrderNumber_isset; + BOOL __premiumCommerceService_isset; + BOOL __premiumServiceStart_isset; + BOOL __premiumServiceSKU_isset; + BOOL __lastSuccessfulCharge_isset; + BOOL __lastFailedCharge_isset; + BOOL __lastFailedChargeReason_isset; + BOOL __nextPaymentDue_isset; + BOOL __premiumLockUntil_isset; + BOOL __updated_isset; + BOOL __premiumSubscriptionNumber_isset; + BOOL __lastRequestedCharge_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=uploadLimit, setter=setUploadLimit:) int64_t uploadLimit; +@property (nonatomic, getter=uploadLimitEnd, setter=setUploadLimitEnd:) EDAMTimestamp uploadLimitEnd; +@property (nonatomic, getter=uploadLimitNextMonth, setter=setUploadLimitNextMonth:) int64_t uploadLimitNextMonth; +@property (nonatomic, getter=premiumServiceStatus, setter=setPremiumServiceStatus:) int premiumServiceStatus; +@property (nonatomic, retain, getter=premiumOrderNumber, setter=setPremiumOrderNumber:) NSString * premiumOrderNumber; +@property (nonatomic, retain, getter=premiumCommerceService, setter=setPremiumCommerceService:) NSString * premiumCommerceService; +@property (nonatomic, getter=premiumServiceStart, setter=setPremiumServiceStart:) EDAMTimestamp premiumServiceStart; +@property (nonatomic, retain, getter=premiumServiceSKU, setter=setPremiumServiceSKU:) NSString * premiumServiceSKU; +@property (nonatomic, getter=lastSuccessfulCharge, setter=setLastSuccessfulCharge:) EDAMTimestamp lastSuccessfulCharge; +@property (nonatomic, getter=lastFailedCharge, setter=setLastFailedCharge:) EDAMTimestamp lastFailedCharge; +@property (nonatomic, retain, getter=lastFailedChargeReason, setter=setLastFailedChargeReason:) NSString * lastFailedChargeReason; +@property (nonatomic, getter=nextPaymentDue, setter=setNextPaymentDue:) EDAMTimestamp nextPaymentDue; +@property (nonatomic, getter=premiumLockUntil, setter=setPremiumLockUntil:) EDAMTimestamp premiumLockUntil; +@property (nonatomic, getter=updated, setter=setUpdated:) EDAMTimestamp updated; +@property (nonatomic, retain, getter=premiumSubscriptionNumber, setter=setPremiumSubscriptionNumber:) NSString * premiumSubscriptionNumber; +@property (nonatomic, getter=lastRequestedCharge, setter=setLastRequestedCharge:) EDAMTimestamp lastRequestedCharge; +#endif + +- (id) initWithUploadLimit: (int64_t) uploadLimit uploadLimitEnd: (EDAMTimestamp) uploadLimitEnd uploadLimitNextMonth: (int64_t) uploadLimitNextMonth premiumServiceStatus: (int) premiumServiceStatus premiumOrderNumber: (NSString *) premiumOrderNumber premiumCommerceService: (NSString *) premiumCommerceService premiumServiceStart: (EDAMTimestamp) premiumServiceStart premiumServiceSKU: (NSString *) premiumServiceSKU lastSuccessfulCharge: (EDAMTimestamp) lastSuccessfulCharge lastFailedCharge: (EDAMTimestamp) lastFailedCharge lastFailedChargeReason: (NSString *) lastFailedChargeReason nextPaymentDue: (EDAMTimestamp) nextPaymentDue premiumLockUntil: (EDAMTimestamp) premiumLockUntil updated: (EDAMTimestamp) updated premiumSubscriptionNumber: (NSString *) premiumSubscriptionNumber lastRequestedCharge: (EDAMTimestamp) lastRequestedCharge; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int64_t) uploadLimit; +- (void) setUploadLimit: (int64_t) uploadLimit; +- (BOOL) uploadLimitIsSet; + +- (EDAMTimestamp) uploadLimitEnd; +- (void) setUploadLimitEnd: (EDAMTimestamp) uploadLimitEnd; +- (BOOL) uploadLimitEndIsSet; + +- (int64_t) uploadLimitNextMonth; +- (void) setUploadLimitNextMonth: (int64_t) uploadLimitNextMonth; +- (BOOL) uploadLimitNextMonthIsSet; + +- (int) premiumServiceStatus; +- (void) setPremiumServiceStatus: (int) premiumServiceStatus; +- (BOOL) premiumServiceStatusIsSet; + +- (NSString *) premiumOrderNumber; +- (void) setPremiumOrderNumber: (NSString *) premiumOrderNumber; +- (BOOL) premiumOrderNumberIsSet; + +- (NSString *) premiumCommerceService; +- (void) setPremiumCommerceService: (NSString *) premiumCommerceService; +- (BOOL) premiumCommerceServiceIsSet; + +- (EDAMTimestamp) premiumServiceStart; +- (void) setPremiumServiceStart: (EDAMTimestamp) premiumServiceStart; +- (BOOL) premiumServiceStartIsSet; + +- (NSString *) premiumServiceSKU; +- (void) setPremiumServiceSKU: (NSString *) premiumServiceSKU; +- (BOOL) premiumServiceSKUIsSet; + +- (EDAMTimestamp) lastSuccessfulCharge; +- (void) setLastSuccessfulCharge: (EDAMTimestamp) lastSuccessfulCharge; +- (BOOL) lastSuccessfulChargeIsSet; + +- (EDAMTimestamp) lastFailedCharge; +- (void) setLastFailedCharge: (EDAMTimestamp) lastFailedCharge; +- (BOOL) lastFailedChargeIsSet; + +- (NSString *) lastFailedChargeReason; +- (void) setLastFailedChargeReason: (NSString *) lastFailedChargeReason; +- (BOOL) lastFailedChargeReasonIsSet; + +- (EDAMTimestamp) nextPaymentDue; +- (void) setNextPaymentDue: (EDAMTimestamp) nextPaymentDue; +- (BOOL) nextPaymentDueIsSet; + +- (EDAMTimestamp) premiumLockUntil; +- (void) setPremiumLockUntil: (EDAMTimestamp) premiumLockUntil; +- (BOOL) premiumLockUntilIsSet; + +- (EDAMTimestamp) updated; +- (void) setUpdated: (EDAMTimestamp) updated; +- (BOOL) updatedIsSet; + +- (NSString *) premiumSubscriptionNumber; +- (void) setPremiumSubscriptionNumber: (NSString *) premiumSubscriptionNumber; +- (BOOL) premiumSubscriptionNumberIsSet; + +- (EDAMTimestamp) lastRequestedCharge; +- (void) setLastRequestedCharge: (EDAMTimestamp) lastRequestedCharge; +- (BOOL) lastRequestedChargeIsSet; + +@end + +@interface EDAMUser : NSObject { + EDAMUserID __id; + NSString * __username; + NSString * __email; + NSString * __name; + NSString * __timezone; + int __privilege; + EDAMTimestamp __created; + EDAMTimestamp __updated; + EDAMTimestamp __deleted; + BOOL __active; + NSString * __shardId; + EDAMUserAttributes * __attributes; + EDAMAccounting * __accounting; + + BOOL __id_isset; + BOOL __username_isset; + BOOL __email_isset; + BOOL __name_isset; + BOOL __timezone_isset; + BOOL __privilege_isset; + BOOL __created_isset; + BOOL __updated_isset; + BOOL __deleted_isset; + BOOL __active_isset; + BOOL __shardId_isset; + BOOL __attributes_isset; + BOOL __accounting_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=id, setter=setId:) EDAMUserID id; +@property (nonatomic, retain, getter=username, setter=setUsername:) NSString * username; +@property (nonatomic, retain, getter=email, setter=setEmail:) NSString * email; +@property (nonatomic, retain, getter=name, setter=setName:) NSString * name; +@property (nonatomic, retain, getter=timezone, setter=setTimezone:) NSString * timezone; +@property (nonatomic, getter=privilege, setter=setPrivilege:) int privilege; +@property (nonatomic, getter=created, setter=setCreated:) EDAMTimestamp created; +@property (nonatomic, getter=updated, setter=setUpdated:) EDAMTimestamp updated; +@property (nonatomic, getter=deleted, setter=setDeleted:) EDAMTimestamp deleted; +@property (nonatomic, getter=active, setter=setActive:) BOOL active; +@property (nonatomic, retain, getter=shardId, setter=setShardId:) NSString * shardId; +@property (nonatomic, retain, getter=attributes, setter=setAttributes:) EDAMUserAttributes * attributes; +@property (nonatomic, retain, getter=accounting, setter=setAccounting:) EDAMAccounting * accounting; +#endif + +- (id) initWithId: (EDAMUserID) id username: (NSString *) username email: (NSString *) email name: (NSString *) name timezone: (NSString *) timezone privilege: (int) privilege created: (EDAMTimestamp) created updated: (EDAMTimestamp) updated deleted: (EDAMTimestamp) deleted active: (BOOL) active shardId: (NSString *) shardId attributes: (EDAMUserAttributes *) attributes accounting: (EDAMAccounting *) accounting; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMUserID) id; +- (void) setId: (EDAMUserID) id; +- (BOOL) idIsSet; + +- (NSString *) username; +- (void) setUsername: (NSString *) username; +- (BOOL) usernameIsSet; + +- (NSString *) email; +- (void) setEmail: (NSString *) email; +- (BOOL) emailIsSet; + +- (NSString *) name; +- (void) setName: (NSString *) name; +- (BOOL) nameIsSet; + +- (NSString *) timezone; +- (void) setTimezone: (NSString *) timezone; +- (BOOL) timezoneIsSet; + +- (int) privilege; +- (void) setPrivilege: (int) privilege; +- (BOOL) privilegeIsSet; + +- (EDAMTimestamp) created; +- (void) setCreated: (EDAMTimestamp) created; +- (BOOL) createdIsSet; + +- (EDAMTimestamp) updated; +- (void) setUpdated: (EDAMTimestamp) updated; +- (BOOL) updatedIsSet; + +- (EDAMTimestamp) deleted; +- (void) setDeleted: (EDAMTimestamp) deleted; +- (BOOL) deletedIsSet; + +- (BOOL) active; +- (void) setActive: (BOOL) active; +- (BOOL) activeIsSet; + +- (NSString *) shardId; +- (void) setShardId: (NSString *) shardId; +- (BOOL) shardIdIsSet; + +- (EDAMUserAttributes *) attributes; +- (void) setAttributes: (EDAMUserAttributes *) attributes; +- (BOOL) attributesIsSet; + +- (EDAMAccounting *) accounting; +- (void) setAccounting: (EDAMAccounting *) accounting; +- (BOOL) accountingIsSet; + +@end + +@interface EDAMTag : NSObject { + EDAMGuid __guid; + NSString * __name; + EDAMGuid __parentGuid; + int32_t __updateSequenceNum; + + BOOL __guid_isset; + BOOL __name_isset; + BOOL __parentGuid_isset; + BOOL __updateSequenceNum_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +@property (nonatomic, retain, getter=name, setter=setName:) NSString * name; +@property (nonatomic, retain, getter=parentGuid, setter=setParentGuid:) EDAMGuid parentGuid; +@property (nonatomic, getter=updateSequenceNum, setter=setUpdateSequenceNum:) int32_t updateSequenceNum; +#endif + +- (id) initWithGuid: (EDAMGuid) guid name: (NSString *) name parentGuid: (EDAMGuid) parentGuid updateSequenceNum: (int32_t) updateSequenceNum; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +- (NSString *) name; +- (void) setName: (NSString *) name; +- (BOOL) nameIsSet; + +- (EDAMGuid) parentGuid; +- (void) setParentGuid: (EDAMGuid) parentGuid; +- (BOOL) parentGuidIsSet; + +- (int32_t) updateSequenceNum; +- (void) setUpdateSequenceNum: (int32_t) updateSequenceNum; +- (BOOL) updateSequenceNumIsSet; + +@end + +@interface EDAMResourceAttributes : NSObject { + NSString * __sourceURL; + EDAMTimestamp __timestamp; + double __latitude; + double __longitude; + double __altitude; + NSString * __cameraMake; + NSString * __cameraModel; + BOOL __clientWillIndex; + NSString * __recoType; + NSString * __fileName; + BOOL __attachment; + + BOOL __sourceURL_isset; + BOOL __timestamp_isset; + BOOL __latitude_isset; + BOOL __longitude_isset; + BOOL __altitude_isset; + BOOL __cameraMake_isset; + BOOL __cameraModel_isset; + BOOL __clientWillIndex_isset; + BOOL __recoType_isset; + BOOL __fileName_isset; + BOOL __attachment_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=sourceURL, setter=setSourceURL:) NSString * sourceURL; +@property (nonatomic, getter=timestamp, setter=setTimestamp:) EDAMTimestamp timestamp; +@property (nonatomic, getter=latitude, setter=setLatitude:) double latitude; +@property (nonatomic, getter=longitude, setter=setLongitude:) double longitude; +@property (nonatomic, getter=altitude, setter=setAltitude:) double altitude; +@property (nonatomic, retain, getter=cameraMake, setter=setCameraMake:) NSString * cameraMake; +@property (nonatomic, retain, getter=cameraModel, setter=setCameraModel:) NSString * cameraModel; +@property (nonatomic, getter=clientWillIndex, setter=setClientWillIndex:) BOOL clientWillIndex; +@property (nonatomic, retain, getter=recoType, setter=setRecoType:) NSString * recoType; +@property (nonatomic, retain, getter=fileName, setter=setFileName:) NSString * fileName; +@property (nonatomic, getter=attachment, setter=setAttachment:) BOOL attachment; +#endif + +- (id) initWithSourceURL: (NSString *) sourceURL timestamp: (EDAMTimestamp) timestamp latitude: (double) latitude longitude: (double) longitude altitude: (double) altitude cameraMake: (NSString *) cameraMake cameraModel: (NSString *) cameraModel clientWillIndex: (BOOL) clientWillIndex recoType: (NSString *) recoType fileName: (NSString *) fileName attachment: (BOOL) attachment; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) sourceURL; +- (void) setSourceURL: (NSString *) sourceURL; +- (BOOL) sourceURLIsSet; + +- (EDAMTimestamp) timestamp; +- (void) setTimestamp: (EDAMTimestamp) timestamp; +- (BOOL) timestampIsSet; + +- (double) latitude; +- (void) setLatitude: (double) latitude; +- (BOOL) latitudeIsSet; + +- (double) longitude; +- (void) setLongitude: (double) longitude; +- (BOOL) longitudeIsSet; + +- (double) altitude; +- (void) setAltitude: (double) altitude; +- (BOOL) altitudeIsSet; + +- (NSString *) cameraMake; +- (void) setCameraMake: (NSString *) cameraMake; +- (BOOL) cameraMakeIsSet; + +- (NSString *) cameraModel; +- (void) setCameraModel: (NSString *) cameraModel; +- (BOOL) cameraModelIsSet; + +- (BOOL) clientWillIndex; +- (void) setClientWillIndex: (BOOL) clientWillIndex; +- (BOOL) clientWillIndexIsSet; + +- (NSString *) recoType; +- (void) setRecoType: (NSString *) recoType; +- (BOOL) recoTypeIsSet; + +- (NSString *) fileName; +- (void) setFileName: (NSString *) fileName; +- (BOOL) fileNameIsSet; + +- (BOOL) attachment; +- (void) setAttachment: (BOOL) attachment; +- (BOOL) attachmentIsSet; + +@end + +@interface EDAMResource : NSObject { + EDAMGuid __guid; + EDAMGuid __noteGuid; + EDAMData * __data; + NSString * __mime; + int16_t __width; + int16_t __height; + int16_t __duration; + BOOL __active; + EDAMData * __recognition; + EDAMResourceAttributes * __attributes; + int32_t __updateSequenceNum; + EDAMData * __alternateData; + + BOOL __guid_isset; + BOOL __noteGuid_isset; + BOOL __data_isset; + BOOL __mime_isset; + BOOL __width_isset; + BOOL __height_isset; + BOOL __duration_isset; + BOOL __active_isset; + BOOL __recognition_isset; + BOOL __attributes_isset; + BOOL __updateSequenceNum_isset; + BOOL __alternateData_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +@property (nonatomic, retain, getter=noteGuid, setter=setNoteGuid:) EDAMGuid noteGuid; +@property (nonatomic, retain, getter=data, setter=setData:) EDAMData * data; +@property (nonatomic, retain, getter=mime, setter=setMime:) NSString * mime; +@property (nonatomic, getter=width, setter=setWidth:) int16_t width; +@property (nonatomic, getter=height, setter=setHeight:) int16_t height; +@property (nonatomic, getter=duration, setter=setDuration:) int16_t duration; +@property (nonatomic, getter=active, setter=setActive:) BOOL active; +@property (nonatomic, retain, getter=recognition, setter=setRecognition:) EDAMData * recognition; +@property (nonatomic, retain, getter=attributes, setter=setAttributes:) EDAMResourceAttributes * attributes; +@property (nonatomic, getter=updateSequenceNum, setter=setUpdateSequenceNum:) int32_t updateSequenceNum; +@property (nonatomic, retain, getter=alternateData, setter=setAlternateData:) EDAMData * alternateData; +#endif + +- (id) initWithGuid: (EDAMGuid) guid noteGuid: (EDAMGuid) noteGuid data: (EDAMData *) data mime: (NSString *) mime width: (int16_t) width height: (int16_t) height duration: (int16_t) duration active: (BOOL) active recognition: (EDAMData *) recognition attributes: (EDAMResourceAttributes *) attributes updateSequenceNum: (int32_t) updateSequenceNum alternateData: (EDAMData *) alternateData; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +- (EDAMGuid) noteGuid; +- (void) setNoteGuid: (EDAMGuid) noteGuid; +- (BOOL) noteGuidIsSet; + +- (EDAMData *) data; +- (void) setData: (EDAMData *) data; +- (BOOL) dataIsSet; + +- (NSString *) mime; +- (void) setMime: (NSString *) mime; +- (BOOL) mimeIsSet; + +- (int16_t) width; +- (void) setWidth: (int16_t) width; +- (BOOL) widthIsSet; + +- (int16_t) height; +- (void) setHeight: (int16_t) height; +- (BOOL) heightIsSet; + +- (int16_t) duration; +- (void) setDuration: (int16_t) duration; +- (BOOL) durationIsSet; + +- (BOOL) active; +- (void) setActive: (BOOL) active; +- (BOOL) activeIsSet; + +- (EDAMData *) recognition; +- (void) setRecognition: (EDAMData *) recognition; +- (BOOL) recognitionIsSet; + +- (EDAMResourceAttributes *) attributes; +- (void) setAttributes: (EDAMResourceAttributes *) attributes; +- (BOOL) attributesIsSet; + +- (int32_t) updateSequenceNum; +- (void) setUpdateSequenceNum: (int32_t) updateSequenceNum; +- (BOOL) updateSequenceNumIsSet; + +- (EDAMData *) alternateData; +- (void) setAlternateData: (EDAMData *) alternateData; +- (BOOL) alternateDataIsSet; + +@end + +@interface EDAMNoteAttributes : NSObject { + EDAMTimestamp __subjectDate; + double __latitude; + double __longitude; + double __altitude; + NSString * __author; + NSString * __source; + NSString * __sourceURL; + NSString * __sourceApplication; + + BOOL __subjectDate_isset; + BOOL __latitude_isset; + BOOL __longitude_isset; + BOOL __altitude_isset; + BOOL __author_isset; + BOOL __source_isset; + BOOL __sourceURL_isset; + BOOL __sourceApplication_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=subjectDate, setter=setSubjectDate:) EDAMTimestamp subjectDate; +@property (nonatomic, getter=latitude, setter=setLatitude:) double latitude; +@property (nonatomic, getter=longitude, setter=setLongitude:) double longitude; +@property (nonatomic, getter=altitude, setter=setAltitude:) double altitude; +@property (nonatomic, retain, getter=author, setter=setAuthor:) NSString * author; +@property (nonatomic, retain, getter=source, setter=setSource:) NSString * source; +@property (nonatomic, retain, getter=sourceURL, setter=setSourceURL:) NSString * sourceURL; +@property (nonatomic, retain, getter=sourceApplication, setter=setSourceApplication:) NSString * sourceApplication; +#endif + +- (id) initWithSubjectDate: (EDAMTimestamp) subjectDate latitude: (double) latitude longitude: (double) longitude altitude: (double) altitude author: (NSString *) author source: (NSString *) source sourceURL: (NSString *) sourceURL sourceApplication: (NSString *) sourceApplication; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMTimestamp) subjectDate; +- (void) setSubjectDate: (EDAMTimestamp) subjectDate; +- (BOOL) subjectDateIsSet; + +- (double) latitude; +- (void) setLatitude: (double) latitude; +- (BOOL) latitudeIsSet; + +- (double) longitude; +- (void) setLongitude: (double) longitude; +- (BOOL) longitudeIsSet; + +- (double) altitude; +- (void) setAltitude: (double) altitude; +- (BOOL) altitudeIsSet; + +- (NSString *) author; +- (void) setAuthor: (NSString *) author; +- (BOOL) authorIsSet; + +- (NSString *) source; +- (void) setSource: (NSString *) source; +- (BOOL) sourceIsSet; + +- (NSString *) sourceURL; +- (void) setSourceURL: (NSString *) sourceURL; +- (BOOL) sourceURLIsSet; + +- (NSString *) sourceApplication; +- (void) setSourceApplication: (NSString *) sourceApplication; +- (BOOL) sourceApplicationIsSet; + +@end + +@interface EDAMNote : NSObject { + EDAMGuid __guid; + NSString * __title; + NSString * __content; + NSData * __contentHash; + int32_t __contentLength; + EDAMTimestamp __created; + EDAMTimestamp __updated; + EDAMTimestamp __deleted; + BOOL __active; + int32_t __updateSequenceNum; + NSString * __notebookGuid; + NSArray * __tagGuids; + NSArray * __resources; + EDAMNoteAttributes * __attributes; + NSArray * __tagNames; + + BOOL __guid_isset; + BOOL __title_isset; + BOOL __content_isset; + BOOL __contentHash_isset; + BOOL __contentLength_isset; + BOOL __created_isset; + BOOL __updated_isset; + BOOL __deleted_isset; + BOOL __active_isset; + BOOL __updateSequenceNum_isset; + BOOL __notebookGuid_isset; + BOOL __tagGuids_isset; + BOOL __resources_isset; + BOOL __attributes_isset; + BOOL __tagNames_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +@property (nonatomic, retain, getter=title, setter=setTitle:) NSString * title; +@property (nonatomic, retain, getter=content, setter=setContent:) NSString * content; +@property (nonatomic, retain, getter=contentHash, setter=setContentHash:) NSData * contentHash; +@property (nonatomic, getter=contentLength, setter=setContentLength:) int32_t contentLength; +@property (nonatomic, getter=created, setter=setCreated:) EDAMTimestamp created; +@property (nonatomic, getter=updated, setter=setUpdated:) EDAMTimestamp updated; +@property (nonatomic, getter=deleted, setter=setDeleted:) EDAMTimestamp deleted; +@property (nonatomic, getter=active, setter=setActive:) BOOL active; +@property (nonatomic, getter=updateSequenceNum, setter=setUpdateSequenceNum:) int32_t updateSequenceNum; +@property (nonatomic, retain, getter=notebookGuid, setter=setNotebookGuid:) NSString * notebookGuid; +@property (nonatomic, retain, getter=tagGuids, setter=setTagGuids:) NSArray * tagGuids; +@property (nonatomic, retain, getter=resources, setter=setResources:) NSArray * resources; +@property (nonatomic, retain, getter=attributes, setter=setAttributes:) EDAMNoteAttributes * attributes; +@property (nonatomic, retain, getter=tagNames, setter=setTagNames:) NSArray * tagNames; +#endif + +- (id) initWithGuid: (EDAMGuid) guid title: (NSString *) title content: (NSString *) content contentHash: (NSData *) contentHash contentLength: (int32_t) contentLength created: (EDAMTimestamp) created updated: (EDAMTimestamp) updated deleted: (EDAMTimestamp) deleted active: (BOOL) active updateSequenceNum: (int32_t) updateSequenceNum notebookGuid: (NSString *) notebookGuid tagGuids: (NSArray *) tagGuids resources: (NSArray *) resources attributes: (EDAMNoteAttributes *) attributes tagNames: (NSArray *) tagNames; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +- (NSString *) title; +- (void) setTitle: (NSString *) title; +- (BOOL) titleIsSet; + +- (NSString *) content; +- (void) setContent: (NSString *) content; +- (BOOL) contentIsSet; + +- (NSData *) contentHash; +- (void) setContentHash: (NSData *) contentHash; +- (BOOL) contentHashIsSet; + +- (int32_t) contentLength; +- (void) setContentLength: (int32_t) contentLength; +- (BOOL) contentLengthIsSet; + +- (EDAMTimestamp) created; +- (void) setCreated: (EDAMTimestamp) created; +- (BOOL) createdIsSet; + +- (EDAMTimestamp) updated; +- (void) setUpdated: (EDAMTimestamp) updated; +- (BOOL) updatedIsSet; + +- (EDAMTimestamp) deleted; +- (void) setDeleted: (EDAMTimestamp) deleted; +- (BOOL) deletedIsSet; + +- (BOOL) active; +- (void) setActive: (BOOL) active; +- (BOOL) activeIsSet; + +- (int32_t) updateSequenceNum; +- (void) setUpdateSequenceNum: (int32_t) updateSequenceNum; +- (BOOL) updateSequenceNumIsSet; + +- (NSString *) notebookGuid; +- (void) setNotebookGuid: (NSString *) notebookGuid; +- (BOOL) notebookGuidIsSet; + +- (NSArray *) tagGuids; +- (void) setTagGuids: (NSArray *) tagGuids; +- (BOOL) tagGuidsIsSet; + +- (NSArray *) resources; +- (void) setResources: (NSArray *) resources; +- (BOOL) resourcesIsSet; + +- (EDAMNoteAttributes *) attributes; +- (void) setAttributes: (EDAMNoteAttributes *) attributes; +- (BOOL) attributesIsSet; + +- (NSArray *) tagNames; +- (void) setTagNames: (NSArray *) tagNames; +- (BOOL) tagNamesIsSet; + +@end + +@interface EDAMPublishing : NSObject { + NSString * __uri; + int __order; + BOOL __ascending; + NSString * __publicDescription; + + BOOL __uri_isset; + BOOL __order_isset; + BOOL __ascending_isset; + BOOL __publicDescription_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=uri, setter=setUri:) NSString * uri; +@property (nonatomic, getter=order, setter=setOrder:) int order; +@property (nonatomic, getter=ascending, setter=setAscending:) BOOL ascending; +@property (nonatomic, retain, getter=publicDescription, setter=setPublicDescription:) NSString * publicDescription; +#endif + +- (id) initWithUri: (NSString *) uri order: (int) order ascending: (BOOL) ascending publicDescription: (NSString *) publicDescription; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) uri; +- (void) setUri: (NSString *) uri; +- (BOOL) uriIsSet; + +- (int) order; +- (void) setOrder: (int) order; +- (BOOL) orderIsSet; + +- (BOOL) ascending; +- (void) setAscending: (BOOL) ascending; +- (BOOL) ascendingIsSet; + +- (NSString *) publicDescription; +- (void) setPublicDescription: (NSString *) publicDescription; +- (BOOL) publicDescriptionIsSet; + +@end + +@interface EDAMNotebook : NSObject { + EDAMGuid __guid; + NSString * __name; + int32_t __updateSequenceNum; + BOOL __defaultNotebook; + EDAMTimestamp __serviceCreated; + EDAMTimestamp __serviceUpdated; + EDAMPublishing * __publishing; + BOOL __published; + NSString * __stack; + + BOOL __guid_isset; + BOOL __name_isset; + BOOL __updateSequenceNum_isset; + BOOL __defaultNotebook_isset; + BOOL __serviceCreated_isset; + BOOL __serviceUpdated_isset; + BOOL __publishing_isset; + BOOL __published_isset; + BOOL __stack_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +@property (nonatomic, retain, getter=name, setter=setName:) NSString * name; +@property (nonatomic, getter=updateSequenceNum, setter=setUpdateSequenceNum:) int32_t updateSequenceNum; +@property (nonatomic, getter=defaultNotebook, setter=setDefaultNotebook:) BOOL defaultNotebook; +@property (nonatomic, getter=serviceCreated, setter=setServiceCreated:) EDAMTimestamp serviceCreated; +@property (nonatomic, getter=serviceUpdated, setter=setServiceUpdated:) EDAMTimestamp serviceUpdated; +@property (nonatomic, retain, getter=publishing, setter=setPublishing:) EDAMPublishing * publishing; +@property (nonatomic, getter=published, setter=setPublished:) BOOL published; +@property (nonatomic, retain, getter=stack, setter=setStack:) NSString * stack; +#endif + +- (id) initWithGuid: (EDAMGuid) guid name: (NSString *) name updateSequenceNum: (int32_t) updateSequenceNum defaultNotebook: (BOOL) defaultNotebook serviceCreated: (EDAMTimestamp) serviceCreated serviceUpdated: (EDAMTimestamp) serviceUpdated publishing: (EDAMPublishing *) publishing published: (BOOL) published stack: (NSString *) stack; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +- (NSString *) name; +- (void) setName: (NSString *) name; +- (BOOL) nameIsSet; + +- (int32_t) updateSequenceNum; +- (void) setUpdateSequenceNum: (int32_t) updateSequenceNum; +- (BOOL) updateSequenceNumIsSet; + +- (BOOL) defaultNotebook; +- (void) setDefaultNotebook: (BOOL) defaultNotebook; +- (BOOL) defaultNotebookIsSet; + +- (EDAMTimestamp) serviceCreated; +- (void) setServiceCreated: (EDAMTimestamp) serviceCreated; +- (BOOL) serviceCreatedIsSet; + +- (EDAMTimestamp) serviceUpdated; +- (void) setServiceUpdated: (EDAMTimestamp) serviceUpdated; +- (BOOL) serviceUpdatedIsSet; + +- (EDAMPublishing *) publishing; +- (void) setPublishing: (EDAMPublishing *) publishing; +- (BOOL) publishingIsSet; + +- (BOOL) published; +- (void) setPublished: (BOOL) published; +- (BOOL) publishedIsSet; + +- (NSString *) stack; +- (void) setStack: (NSString *) stack; +- (BOOL) stackIsSet; + +@end + +@interface EDAMSavedSearch : NSObject { + EDAMGuid __guid; + NSString * __name; + NSString * __query; + int __format; + int32_t __updateSequenceNum; + + BOOL __guid_isset; + BOOL __name_isset; + BOOL __query_isset; + BOOL __format_isset; + BOOL __updateSequenceNum_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=guid, setter=setGuid:) EDAMGuid guid; +@property (nonatomic, retain, getter=name, setter=setName:) NSString * name; +@property (nonatomic, retain, getter=query, setter=setQuery:) NSString * query; +@property (nonatomic, getter=format, setter=setFormat:) int format; +@property (nonatomic, getter=updateSequenceNum, setter=setUpdateSequenceNum:) int32_t updateSequenceNum; +#endif + +- (id) initWithGuid: (EDAMGuid) guid name: (NSString *) name query: (NSString *) query format: (int) format updateSequenceNum: (int32_t) updateSequenceNum; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMGuid) guid; +- (void) setGuid: (EDAMGuid) guid; +- (BOOL) guidIsSet; + +- (NSString *) name; +- (void) setName: (NSString *) name; +- (BOOL) nameIsSet; + +- (NSString *) query; +- (void) setQuery: (NSString *) query; +- (BOOL) queryIsSet; + +- (int) format; +- (void) setFormat: (int) format; +- (BOOL) formatIsSet; + +- (int32_t) updateSequenceNum; +- (void) setUpdateSequenceNum: (int32_t) updateSequenceNum; +- (BOOL) updateSequenceNumIsSet; + +@end + +@interface EDAMAd : NSObject { + int32_t __id; + int16_t __width; + int16_t __height; + NSString * __advertiserName; + NSString * __imageUrl; + NSString * __destinationUrl; + int16_t __displaySeconds; + double __score; + NSData * __image; + NSString * __imageMime; + NSString * __html; + double __displayFrequency; + + BOOL __id_isset; + BOOL __width_isset; + BOOL __height_isset; + BOOL __advertiserName_isset; + BOOL __imageUrl_isset; + BOOL __destinationUrl_isset; + BOOL __displaySeconds_isset; + BOOL __score_isset; + BOOL __image_isset; + BOOL __imageMime_isset; + BOOL __html_isset; + BOOL __displayFrequency_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=id, setter=setId:) int32_t id; +@property (nonatomic, getter=width, setter=setWidth:) int16_t width; +@property (nonatomic, getter=height, setter=setHeight:) int16_t height; +@property (nonatomic, retain, getter=advertiserName, setter=setAdvertiserName:) NSString * advertiserName; +@property (nonatomic, retain, getter=imageUrl, setter=setImageUrl:) NSString * imageUrl; +@property (nonatomic, retain, getter=destinationUrl, setter=setDestinationUrl:) NSString * destinationUrl; +@property (nonatomic, getter=displaySeconds, setter=setDisplaySeconds:) int16_t displaySeconds; +@property (nonatomic, getter=score, setter=setScore:) double score; +@property (nonatomic, retain, getter=image, setter=setImage:) NSData * image; +@property (nonatomic, retain, getter=imageMime, setter=setImageMime:) NSString * imageMime; +@property (nonatomic, retain, getter=html, setter=setHtml:) NSString * html; +@property (nonatomic, getter=displayFrequency, setter=setDisplayFrequency:) double displayFrequency; +#endif + +- (id) initWithId: (int32_t) id width: (int16_t) width height: (int16_t) height advertiserName: (NSString *) advertiserName imageUrl: (NSString *) imageUrl destinationUrl: (NSString *) destinationUrl displaySeconds: (int16_t) displaySeconds score: (double) score image: (NSData *) image imageMime: (NSString *) imageMime html: (NSString *) html displayFrequency: (double) displayFrequency; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int32_t) id; +- (void) setId: (int32_t) id; +- (BOOL) idIsSet; + +- (int16_t) width; +- (void) setWidth: (int16_t) width; +- (BOOL) widthIsSet; + +- (int16_t) height; +- (void) setHeight: (int16_t) height; +- (BOOL) heightIsSet; + +- (NSString *) advertiserName; +- (void) setAdvertiserName: (NSString *) advertiserName; +- (BOOL) advertiserNameIsSet; + +- (NSString *) imageUrl; +- (void) setImageUrl: (NSString *) imageUrl; +- (BOOL) imageUrlIsSet; + +- (NSString *) destinationUrl; +- (void) setDestinationUrl: (NSString *) destinationUrl; +- (BOOL) destinationUrlIsSet; + +- (int16_t) displaySeconds; +- (void) setDisplaySeconds: (int16_t) displaySeconds; +- (BOOL) displaySecondsIsSet; + +- (double) score; +- (void) setScore: (double) score; +- (BOOL) scoreIsSet; + +- (NSData *) image; +- (void) setImage: (NSData *) image; +- (BOOL) imageIsSet; + +- (NSString *) imageMime; +- (void) setImageMime: (NSString *) imageMime; +- (BOOL) imageMimeIsSet; + +- (NSString *) html; +- (void) setHtml: (NSString *) html; +- (BOOL) htmlIsSet; + +- (double) displayFrequency; +- (void) setDisplayFrequency: (double) displayFrequency; +- (BOOL) displayFrequencyIsSet; + +@end + +@interface EDAMSharedNotebook : NSObject { + int64_t __id; + int32_t __userId; + NSString * __notebookGuid; + NSString * __email; + BOOL __notebookModifiable; + BOOL __requireLogin; + EDAMTimestamp __serviceCreated; + NSString * __shareKey; + NSString * __username; + + BOOL __id_isset; + BOOL __userId_isset; + BOOL __notebookGuid_isset; + BOOL __email_isset; + BOOL __notebookModifiable_isset; + BOOL __requireLogin_isset; + BOOL __serviceCreated_isset; + BOOL __shareKey_isset; + BOOL __username_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=id, setter=setId:) int64_t id; +@property (nonatomic, getter=userId, setter=setUserId:) int32_t userId; +@property (nonatomic, retain, getter=notebookGuid, setter=setNotebookGuid:) NSString * notebookGuid; +@property (nonatomic, retain, getter=email, setter=setEmail:) NSString * email; +@property (nonatomic, getter=notebookModifiable, setter=setNotebookModifiable:) BOOL notebookModifiable; +@property (nonatomic, getter=requireLogin, setter=setRequireLogin:) BOOL requireLogin; +@property (nonatomic, getter=serviceCreated, setter=setServiceCreated:) EDAMTimestamp serviceCreated; +@property (nonatomic, retain, getter=shareKey, setter=setShareKey:) NSString * shareKey; +@property (nonatomic, retain, getter=username, setter=setUsername:) NSString * username; +#endif + +- (id) initWithId: (int64_t) id userId: (int32_t) userId notebookGuid: (NSString *) notebookGuid email: (NSString *) email notebookModifiable: (BOOL) notebookModifiable requireLogin: (BOOL) requireLogin serviceCreated: (EDAMTimestamp) serviceCreated shareKey: (NSString *) shareKey username: (NSString *) username; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int64_t) id; +- (void) setId: (int64_t) id; +- (BOOL) idIsSet; + +- (int32_t) userId; +- (void) setUserId: (int32_t) userId; +- (BOOL) userIdIsSet; + +- (NSString *) notebookGuid; +- (void) setNotebookGuid: (NSString *) notebookGuid; +- (BOOL) notebookGuidIsSet; + +- (NSString *) email; +- (void) setEmail: (NSString *) email; +- (BOOL) emailIsSet; + +- (BOOL) notebookModifiable; +- (void) setNotebookModifiable: (BOOL) notebookModifiable; +- (BOOL) notebookModifiableIsSet; + +- (BOOL) requireLogin; +- (void) setRequireLogin: (BOOL) requireLogin; +- (BOOL) requireLoginIsSet; + +- (EDAMTimestamp) serviceCreated; +- (void) setServiceCreated: (EDAMTimestamp) serviceCreated; +- (BOOL) serviceCreatedIsSet; + +- (NSString *) shareKey; +- (void) setShareKey: (NSString *) shareKey; +- (BOOL) shareKeyIsSet; + +- (NSString *) username; +- (void) setUsername: (NSString *) username; +- (BOOL) usernameIsSet; + +@end + +@interface EDAMLinkedNotebook : NSObject { + int64_t __id; + NSString * __shareName; + NSString * __username; + NSString * __shardId; + NSString * __shareKey; + NSString * __uri; + + BOOL __id_isset; + BOOL __shareName_isset; + BOOL __username_isset; + BOOL __shardId_isset; + BOOL __shareKey_isset; + BOOL __uri_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=id, setter=setId:) int64_t id; +@property (nonatomic, retain, getter=shareName, setter=setShareName:) NSString * shareName; +@property (nonatomic, retain, getter=username, setter=setUsername:) NSString * username; +@property (nonatomic, retain, getter=shardId, setter=setShardId:) NSString * shardId; +@property (nonatomic, retain, getter=shareKey, setter=setShareKey:) NSString * shareKey; +@property (nonatomic, retain, getter=uri, setter=setUri:) NSString * uri; +#endif + +- (id) initWithId: (int64_t) id shareName: (NSString *) shareName username: (NSString *) username shardId: (NSString *) shardId shareKey: (NSString *) shareKey uri: (NSString *) uri; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (int64_t) id; +- (void) setId: (int64_t) id; +- (BOOL) idIsSet; + +- (NSString *) shareName; +- (void) setShareName: (NSString *) shareName; +- (BOOL) shareNameIsSet; + +- (NSString *) username; +- (void) setUsername: (NSString *) username; +- (BOOL) usernameIsSet; + +- (NSString *) shardId; +- (void) setShardId: (NSString *) shardId; +- (BOOL) shardIdIsSet; + +- (NSString *) shareKey; +- (void) setShareKey: (NSString *) shareKey; +- (BOOL) shareKeyIsSet; + +- (NSString *) uri; +- (void) setUri: (NSString *) uri; +- (BOOL) uriIsSet; + +@end + +@interface EDAMTypesConstants : NSObject { +} ++ (NSString *) EDAM_NOTE_SOURCE_WEB_CLIP; ++ (NSString *) EDAM_NOTE_SOURCE_MAIL_CLIP; ++ (NSString *) EDAM_NOTE_SOURCE_MAIL_SMTP_GATEWAY; +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/Types.m b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/Types.m new file mode 100644 index 00000000..6cdd1687 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/Types.m @@ -0,0 +1,8388 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ + +#import + +#import "TProtocol.h" +#import "TApplicationException.h" +#import "TProtocolUtil.h" +#import "TProcessor.h" + +#import "EDAMLimits.h" + +#import "Types.h" + +static NSString * EDAMEDAM_NOTE_SOURCE_WEB_CLIP = @"web.clip"; +static NSString * EDAMEDAM_NOTE_SOURCE_MAIL_CLIP = @"mail.clip"; +static NSString * EDAMEDAM_NOTE_SOURCE_MAIL_SMTP_GATEWAY = @"mail.smtp"; + +@implementation EDAMTypesConstants ++ (void) initialize { +} ++ (NSString *) EDAM_NOTE_SOURCE_WEB_CLIP{ + return EDAMEDAM_NOTE_SOURCE_WEB_CLIP; +} ++ (NSString *) EDAM_NOTE_SOURCE_MAIL_CLIP{ + return EDAMEDAM_NOTE_SOURCE_MAIL_CLIP; +} ++ (NSString *) EDAM_NOTE_SOURCE_MAIL_SMTP_GATEWAY{ + return EDAMEDAM_NOTE_SOURCE_MAIL_SMTP_GATEWAY; +} +@end + +@implementation EDAMData + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic bodyHash; +@dynamic size; +@dynamic body; +#endif + +- (id) initWithBodyHash: (NSData *) bodyHash size: (int32_t) size body: (NSData *) body +{ + self = [super init]; + __bodyHash = [bodyHash retain]; + __bodyHash_isset = YES; + __size = size; + __size_isset = YES; + __body = [body retain]; + __body_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"bodyHash"]) + { + __bodyHash = [[decoder decodeObjectForKey: @"bodyHash"] retain]; + __bodyHash_isset = YES; + } + if ([decoder containsValueForKey: @"size"]) + { + __size = [decoder decodeInt32ForKey: @"size"]; + __size_isset = YES; + } + if ([decoder containsValueForKey: @"body"]) + { + __body = [[decoder decodeObjectForKey: @"body"] retain]; + __body_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__bodyHash_isset) + { + [encoder encodeObject: __bodyHash forKey: @"bodyHash"]; + } + if (__size_isset) + { + [encoder encodeInt32: __size forKey: @"size"]; + } + if (__body_isset) + { + [encoder encodeObject: __body forKey: @"body"]; + } +} + +- (void) dealloc +{ + [__bodyHash release]; + [__body release]; + [super dealloc]; +} + +- (NSData *) bodyHash { + return [[__bodyHash retain] autorelease]; +} + +- (void) setBodyHash: (NSData *) bodyHash { + [bodyHash retain]; + [__bodyHash release]; + __bodyHash = bodyHash; + __bodyHash_isset = YES; +} + +- (BOOL) bodyHashIsSet { + return __bodyHash_isset; +} + +- (void) unsetBodyHash { + [__bodyHash release]; + __bodyHash = nil; + __bodyHash_isset = NO; +} + +- (int32_t) size { + return __size; +} + +- (void) setSize: (int32_t) size { + __size = size; + __size_isset = YES; +} + +- (BOOL) sizeIsSet { + return __size_isset; +} + +- (void) unsetSize { + __size_isset = NO; +} + +- (NSData *) body { + return [[__body retain] autorelease]; +} + +- (void) setBody: (NSData *) body { + [body retain]; + [__body release]; + __body = body; + __body_isset = YES; +} + +- (BOOL) bodyIsSet { + return __body_isset; +} + +- (void) unsetBody { + [__body release]; + __body = nil; + __body_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSData * fieldValue = [inProtocol readBinary]; + [self setBodyHash: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setSize: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRING) { + NSData * fieldValue = [inProtocol readBinary]; + [self setBody: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"Data"]; + if (__bodyHash_isset) { + if (__bodyHash != nil) { + [outProtocol writeFieldBeginWithName: @"bodyHash" type: TType_STRING fieldID: 1]; + [outProtocol writeBinary: __bodyHash]; + [outProtocol writeFieldEnd]; + } + } + if (__size_isset) { + [outProtocol writeFieldBeginWithName: @"size" type: TType_I32 fieldID: 2]; + [outProtocol writeI32: __size]; + [outProtocol writeFieldEnd]; + } + if (__body_isset) { + if (__body != nil) { + [outProtocol writeFieldBeginWithName: @"body" type: TType_STRING fieldID: 3]; + [outProtocol writeBinary: __body]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"Data("]; + [ms appendString: @"bodyHash:"]; + [ms appendFormat: @"\"%@\"", __bodyHash]; + [ms appendString: @",size:"]; + [ms appendFormat: @"%i", __size]; + [ms appendString: @",body:"]; + [ms appendFormat: @"\"%@\"", __body]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMUserAttributes + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic defaultLocationName; +@dynamic defaultLatitude; +@dynamic defaultLongitude; +@dynamic preactivation; +@dynamic viewedPromotions; +@dynamic incomingEmailAddress; +@dynamic recentMailedAddresses; +@dynamic comments; +@dynamic dateAgreedToTermsOfService; +@dynamic maxReferrals; +@dynamic referralCount; +@dynamic refererCode; +@dynamic sentEmailDate; +@dynamic sentEmailCount; +@dynamic dailyEmailLimit; +@dynamic emailOptOutDate; +@dynamic partnerEmailOptInDate; +@dynamic preferredLanguage; +@dynamic preferredCountry; +@dynamic clipFullPage; +@dynamic twitterUserName; +@dynamic twitterId; +@dynamic groupName; +@dynamic recognitionLanguage; +@dynamic customerProfileId; +@dynamic referralProof; +#endif + +- (id) initWithDefaultLocationName: (NSString *) defaultLocationName defaultLatitude: (double) defaultLatitude defaultLongitude: (double) defaultLongitude preactivation: (BOOL) preactivation viewedPromotions: (NSArray *) viewedPromotions incomingEmailAddress: (NSString *) incomingEmailAddress recentMailedAddresses: (NSArray *) recentMailedAddresses comments: (NSString *) comments dateAgreedToTermsOfService: (EDAMTimestamp) dateAgreedToTermsOfService maxReferrals: (int32_t) maxReferrals referralCount: (int32_t) referralCount refererCode: (NSString *) refererCode sentEmailDate: (EDAMTimestamp) sentEmailDate sentEmailCount: (int32_t) sentEmailCount dailyEmailLimit: (int32_t) dailyEmailLimit emailOptOutDate: (EDAMTimestamp) emailOptOutDate partnerEmailOptInDate: (EDAMTimestamp) partnerEmailOptInDate preferredLanguage: (NSString *) preferredLanguage preferredCountry: (NSString *) preferredCountry clipFullPage: (BOOL) clipFullPage twitterUserName: (NSString *) twitterUserName twitterId: (NSString *) twitterId groupName: (NSString *) groupName recognitionLanguage: (NSString *) recognitionLanguage customerProfileId: (int64_t) customerProfileId referralProof: (NSString *) referralProof +{ + self = [super init]; + __defaultLocationName = [defaultLocationName retain]; + __defaultLocationName_isset = YES; + __defaultLatitude = defaultLatitude; + __defaultLatitude_isset = YES; + __defaultLongitude = defaultLongitude; + __defaultLongitude_isset = YES; + __preactivation = preactivation; + __preactivation_isset = YES; + __viewedPromotions = [viewedPromotions retain]; + __viewedPromotions_isset = YES; + __incomingEmailAddress = [incomingEmailAddress retain]; + __incomingEmailAddress_isset = YES; + __recentMailedAddresses = [recentMailedAddresses retain]; + __recentMailedAddresses_isset = YES; + __comments = [comments retain]; + __comments_isset = YES; + __dateAgreedToTermsOfService = dateAgreedToTermsOfService; + __dateAgreedToTermsOfService_isset = YES; + __maxReferrals = maxReferrals; + __maxReferrals_isset = YES; + __referralCount = referralCount; + __referralCount_isset = YES; + __refererCode = [refererCode retain]; + __refererCode_isset = YES; + __sentEmailDate = sentEmailDate; + __sentEmailDate_isset = YES; + __sentEmailCount = sentEmailCount; + __sentEmailCount_isset = YES; + __dailyEmailLimit = dailyEmailLimit; + __dailyEmailLimit_isset = YES; + __emailOptOutDate = emailOptOutDate; + __emailOptOutDate_isset = YES; + __partnerEmailOptInDate = partnerEmailOptInDate; + __partnerEmailOptInDate_isset = YES; + __preferredLanguage = [preferredLanguage retain]; + __preferredLanguage_isset = YES; + __preferredCountry = [preferredCountry retain]; + __preferredCountry_isset = YES; + __clipFullPage = clipFullPage; + __clipFullPage_isset = YES; + __twitterUserName = [twitterUserName retain]; + __twitterUserName_isset = YES; + __twitterId = [twitterId retain]; + __twitterId_isset = YES; + __groupName = [groupName retain]; + __groupName_isset = YES; + __recognitionLanguage = [recognitionLanguage retain]; + __recognitionLanguage_isset = YES; + __customerProfileId = customerProfileId; + __customerProfileId_isset = YES; + __referralProof = [referralProof retain]; + __referralProof_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"defaultLocationName"]) + { + __defaultLocationName = [[decoder decodeObjectForKey: @"defaultLocationName"] retain]; + __defaultLocationName_isset = YES; + } + if ([decoder containsValueForKey: @"defaultLatitude"]) + { + __defaultLatitude = [decoder decodeDoubleForKey: @"defaultLatitude"]; + __defaultLatitude_isset = YES; + } + if ([decoder containsValueForKey: @"defaultLongitude"]) + { + __defaultLongitude = [decoder decodeDoubleForKey: @"defaultLongitude"]; + __defaultLongitude_isset = YES; + } + if ([decoder containsValueForKey: @"preactivation"]) + { + __preactivation = [decoder decodeBoolForKey: @"preactivation"]; + __preactivation_isset = YES; + } + if ([decoder containsValueForKey: @"viewedPromotions"]) + { + __viewedPromotions = [[decoder decodeObjectForKey: @"viewedPromotions"] retain]; + __viewedPromotions_isset = YES; + } + if ([decoder containsValueForKey: @"incomingEmailAddress"]) + { + __incomingEmailAddress = [[decoder decodeObjectForKey: @"incomingEmailAddress"] retain]; + __incomingEmailAddress_isset = YES; + } + if ([decoder containsValueForKey: @"recentMailedAddresses"]) + { + __recentMailedAddresses = [[decoder decodeObjectForKey: @"recentMailedAddresses"] retain]; + __recentMailedAddresses_isset = YES; + } + if ([decoder containsValueForKey: @"comments"]) + { + __comments = [[decoder decodeObjectForKey: @"comments"] retain]; + __comments_isset = YES; + } + if ([decoder containsValueForKey: @"dateAgreedToTermsOfService"]) + { + __dateAgreedToTermsOfService = [decoder decodeInt64ForKey: @"dateAgreedToTermsOfService"]; + __dateAgreedToTermsOfService_isset = YES; + } + if ([decoder containsValueForKey: @"maxReferrals"]) + { + __maxReferrals = [decoder decodeInt32ForKey: @"maxReferrals"]; + __maxReferrals_isset = YES; + } + if ([decoder containsValueForKey: @"referralCount"]) + { + __referralCount = [decoder decodeInt32ForKey: @"referralCount"]; + __referralCount_isset = YES; + } + if ([decoder containsValueForKey: @"refererCode"]) + { + __refererCode = [[decoder decodeObjectForKey: @"refererCode"] retain]; + __refererCode_isset = YES; + } + if ([decoder containsValueForKey: @"sentEmailDate"]) + { + __sentEmailDate = [decoder decodeInt64ForKey: @"sentEmailDate"]; + __sentEmailDate_isset = YES; + } + if ([decoder containsValueForKey: @"sentEmailCount"]) + { + __sentEmailCount = [decoder decodeInt32ForKey: @"sentEmailCount"]; + __sentEmailCount_isset = YES; + } + if ([decoder containsValueForKey: @"dailyEmailLimit"]) + { + __dailyEmailLimit = [decoder decodeInt32ForKey: @"dailyEmailLimit"]; + __dailyEmailLimit_isset = YES; + } + if ([decoder containsValueForKey: @"emailOptOutDate"]) + { + __emailOptOutDate = [decoder decodeInt64ForKey: @"emailOptOutDate"]; + __emailOptOutDate_isset = YES; + } + if ([decoder containsValueForKey: @"partnerEmailOptInDate"]) + { + __partnerEmailOptInDate = [decoder decodeInt64ForKey: @"partnerEmailOptInDate"]; + __partnerEmailOptInDate_isset = YES; + } + if ([decoder containsValueForKey: @"preferredLanguage"]) + { + __preferredLanguage = [[decoder decodeObjectForKey: @"preferredLanguage"] retain]; + __preferredLanguage_isset = YES; + } + if ([decoder containsValueForKey: @"preferredCountry"]) + { + __preferredCountry = [[decoder decodeObjectForKey: @"preferredCountry"] retain]; + __preferredCountry_isset = YES; + } + if ([decoder containsValueForKey: @"clipFullPage"]) + { + __clipFullPage = [decoder decodeBoolForKey: @"clipFullPage"]; + __clipFullPage_isset = YES; + } + if ([decoder containsValueForKey: @"twitterUserName"]) + { + __twitterUserName = [[decoder decodeObjectForKey: @"twitterUserName"] retain]; + __twitterUserName_isset = YES; + } + if ([decoder containsValueForKey: @"twitterId"]) + { + __twitterId = [[decoder decodeObjectForKey: @"twitterId"] retain]; + __twitterId_isset = YES; + } + if ([decoder containsValueForKey: @"groupName"]) + { + __groupName = [[decoder decodeObjectForKey: @"groupName"] retain]; + __groupName_isset = YES; + } + if ([decoder containsValueForKey: @"recognitionLanguage"]) + { + __recognitionLanguage = [[decoder decodeObjectForKey: @"recognitionLanguage"] retain]; + __recognitionLanguage_isset = YES; + } + if ([decoder containsValueForKey: @"customerProfileId"]) + { + __customerProfileId = [decoder decodeInt64ForKey: @"customerProfileId"]; + __customerProfileId_isset = YES; + } + if ([decoder containsValueForKey: @"referralProof"]) + { + __referralProof = [[decoder decodeObjectForKey: @"referralProof"] retain]; + __referralProof_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__defaultLocationName_isset) + { + [encoder encodeObject: __defaultLocationName forKey: @"defaultLocationName"]; + } + if (__defaultLatitude_isset) + { + [encoder encodeDouble: __defaultLatitude forKey: @"defaultLatitude"]; + } + if (__defaultLongitude_isset) + { + [encoder encodeDouble: __defaultLongitude forKey: @"defaultLongitude"]; + } + if (__preactivation_isset) + { + [encoder encodeBool: __preactivation forKey: @"preactivation"]; + } + if (__viewedPromotions_isset) + { + [encoder encodeObject: __viewedPromotions forKey: @"viewedPromotions"]; + } + if (__incomingEmailAddress_isset) + { + [encoder encodeObject: __incomingEmailAddress forKey: @"incomingEmailAddress"]; + } + if (__recentMailedAddresses_isset) + { + [encoder encodeObject: __recentMailedAddresses forKey: @"recentMailedAddresses"]; + } + if (__comments_isset) + { + [encoder encodeObject: __comments forKey: @"comments"]; + } + if (__dateAgreedToTermsOfService_isset) + { + [encoder encodeInt64: __dateAgreedToTermsOfService forKey: @"dateAgreedToTermsOfService"]; + } + if (__maxReferrals_isset) + { + [encoder encodeInt32: __maxReferrals forKey: @"maxReferrals"]; + } + if (__referralCount_isset) + { + [encoder encodeInt32: __referralCount forKey: @"referralCount"]; + } + if (__refererCode_isset) + { + [encoder encodeObject: __refererCode forKey: @"refererCode"]; + } + if (__sentEmailDate_isset) + { + [encoder encodeInt64: __sentEmailDate forKey: @"sentEmailDate"]; + } + if (__sentEmailCount_isset) + { + [encoder encodeInt32: __sentEmailCount forKey: @"sentEmailCount"]; + } + if (__dailyEmailLimit_isset) + { + [encoder encodeInt32: __dailyEmailLimit forKey: @"dailyEmailLimit"]; + } + if (__emailOptOutDate_isset) + { + [encoder encodeInt64: __emailOptOutDate forKey: @"emailOptOutDate"]; + } + if (__partnerEmailOptInDate_isset) + { + [encoder encodeInt64: __partnerEmailOptInDate forKey: @"partnerEmailOptInDate"]; + } + if (__preferredLanguage_isset) + { + [encoder encodeObject: __preferredLanguage forKey: @"preferredLanguage"]; + } + if (__preferredCountry_isset) + { + [encoder encodeObject: __preferredCountry forKey: @"preferredCountry"]; + } + if (__clipFullPage_isset) + { + [encoder encodeBool: __clipFullPage forKey: @"clipFullPage"]; + } + if (__twitterUserName_isset) + { + [encoder encodeObject: __twitterUserName forKey: @"twitterUserName"]; + } + if (__twitterId_isset) + { + [encoder encodeObject: __twitterId forKey: @"twitterId"]; + } + if (__groupName_isset) + { + [encoder encodeObject: __groupName forKey: @"groupName"]; + } + if (__recognitionLanguage_isset) + { + [encoder encodeObject: __recognitionLanguage forKey: @"recognitionLanguage"]; + } + if (__customerProfileId_isset) + { + [encoder encodeInt64: __customerProfileId forKey: @"customerProfileId"]; + } + if (__referralProof_isset) + { + [encoder encodeObject: __referralProof forKey: @"referralProof"]; + } +} + +- (void) dealloc +{ + [__defaultLocationName release]; + [__viewedPromotions release]; + [__incomingEmailAddress release]; + [__recentMailedAddresses release]; + [__comments release]; + [__refererCode release]; + [__preferredLanguage release]; + [__preferredCountry release]; + [__twitterUserName release]; + [__twitterId release]; + [__groupName release]; + [__recognitionLanguage release]; + [__referralProof release]; + [super dealloc]; +} + +- (NSString *) defaultLocationName { + return [[__defaultLocationName retain] autorelease]; +} + +- (void) setDefaultLocationName: (NSString *) defaultLocationName { + [defaultLocationName retain]; + [__defaultLocationName release]; + __defaultLocationName = defaultLocationName; + __defaultLocationName_isset = YES; +} + +- (BOOL) defaultLocationNameIsSet { + return __defaultLocationName_isset; +} + +- (void) unsetDefaultLocationName { + [__defaultLocationName release]; + __defaultLocationName = nil; + __defaultLocationName_isset = NO; +} + +- (double) defaultLatitude { + return __defaultLatitude; +} + +- (void) setDefaultLatitude: (double) defaultLatitude { + __defaultLatitude = defaultLatitude; + __defaultLatitude_isset = YES; +} + +- (BOOL) defaultLatitudeIsSet { + return __defaultLatitude_isset; +} + +- (void) unsetDefaultLatitude { + __defaultLatitude_isset = NO; +} + +- (double) defaultLongitude { + return __defaultLongitude; +} + +- (void) setDefaultLongitude: (double) defaultLongitude { + __defaultLongitude = defaultLongitude; + __defaultLongitude_isset = YES; +} + +- (BOOL) defaultLongitudeIsSet { + return __defaultLongitude_isset; +} + +- (void) unsetDefaultLongitude { + __defaultLongitude_isset = NO; +} + +- (BOOL) preactivation { + return __preactivation; +} + +- (void) setPreactivation: (BOOL) preactivation { + __preactivation = preactivation; + __preactivation_isset = YES; +} + +- (BOOL) preactivationIsSet { + return __preactivation_isset; +} + +- (void) unsetPreactivation { + __preactivation_isset = NO; +} + +- (NSArray *) viewedPromotions { + return [[__viewedPromotions retain] autorelease]; +} + +- (void) setViewedPromotions: (NSArray *) viewedPromotions { + [viewedPromotions retain]; + [__viewedPromotions release]; + __viewedPromotions = viewedPromotions; + __viewedPromotions_isset = YES; +} + +- (BOOL) viewedPromotionsIsSet { + return __viewedPromotions_isset; +} + +- (void) unsetViewedPromotions { + [__viewedPromotions release]; + __viewedPromotions = nil; + __viewedPromotions_isset = NO; +} + +- (NSString *) incomingEmailAddress { + return [[__incomingEmailAddress retain] autorelease]; +} + +- (void) setIncomingEmailAddress: (NSString *) incomingEmailAddress { + [incomingEmailAddress retain]; + [__incomingEmailAddress release]; + __incomingEmailAddress = incomingEmailAddress; + __incomingEmailAddress_isset = YES; +} + +- (BOOL) incomingEmailAddressIsSet { + return __incomingEmailAddress_isset; +} + +- (void) unsetIncomingEmailAddress { + [__incomingEmailAddress release]; + __incomingEmailAddress = nil; + __incomingEmailAddress_isset = NO; +} + +- (NSArray *) recentMailedAddresses { + return [[__recentMailedAddresses retain] autorelease]; +} + +- (void) setRecentMailedAddresses: (NSArray *) recentMailedAddresses { + [recentMailedAddresses retain]; + [__recentMailedAddresses release]; + __recentMailedAddresses = recentMailedAddresses; + __recentMailedAddresses_isset = YES; +} + +- (BOOL) recentMailedAddressesIsSet { + return __recentMailedAddresses_isset; +} + +- (void) unsetRecentMailedAddresses { + [__recentMailedAddresses release]; + __recentMailedAddresses = nil; + __recentMailedAddresses_isset = NO; +} + +- (NSString *) comments { + return [[__comments retain] autorelease]; +} + +- (void) setComments: (NSString *) comments { + [comments retain]; + [__comments release]; + __comments = comments; + __comments_isset = YES; +} + +- (BOOL) commentsIsSet { + return __comments_isset; +} + +- (void) unsetComments { + [__comments release]; + __comments = nil; + __comments_isset = NO; +} + +- (int64_t) dateAgreedToTermsOfService { + return __dateAgreedToTermsOfService; +} + +- (void) setDateAgreedToTermsOfService: (int64_t) dateAgreedToTermsOfService { + __dateAgreedToTermsOfService = dateAgreedToTermsOfService; + __dateAgreedToTermsOfService_isset = YES; +} + +- (BOOL) dateAgreedToTermsOfServiceIsSet { + return __dateAgreedToTermsOfService_isset; +} + +- (void) unsetDateAgreedToTermsOfService { + __dateAgreedToTermsOfService_isset = NO; +} + +- (int32_t) maxReferrals { + return __maxReferrals; +} + +- (void) setMaxReferrals: (int32_t) maxReferrals { + __maxReferrals = maxReferrals; + __maxReferrals_isset = YES; +} + +- (BOOL) maxReferralsIsSet { + return __maxReferrals_isset; +} + +- (void) unsetMaxReferrals { + __maxReferrals_isset = NO; +} + +- (int32_t) referralCount { + return __referralCount; +} + +- (void) setReferralCount: (int32_t) referralCount { + __referralCount = referralCount; + __referralCount_isset = YES; +} + +- (BOOL) referralCountIsSet { + return __referralCount_isset; +} + +- (void) unsetReferralCount { + __referralCount_isset = NO; +} + +- (NSString *) refererCode { + return [[__refererCode retain] autorelease]; +} + +- (void) setRefererCode: (NSString *) refererCode { + [refererCode retain]; + [__refererCode release]; + __refererCode = refererCode; + __refererCode_isset = YES; +} + +- (BOOL) refererCodeIsSet { + return __refererCode_isset; +} + +- (void) unsetRefererCode { + [__refererCode release]; + __refererCode = nil; + __refererCode_isset = NO; +} + +- (int64_t) sentEmailDate { + return __sentEmailDate; +} + +- (void) setSentEmailDate: (int64_t) sentEmailDate { + __sentEmailDate = sentEmailDate; + __sentEmailDate_isset = YES; +} + +- (BOOL) sentEmailDateIsSet { + return __sentEmailDate_isset; +} + +- (void) unsetSentEmailDate { + __sentEmailDate_isset = NO; +} + +- (int32_t) sentEmailCount { + return __sentEmailCount; +} + +- (void) setSentEmailCount: (int32_t) sentEmailCount { + __sentEmailCount = sentEmailCount; + __sentEmailCount_isset = YES; +} + +- (BOOL) sentEmailCountIsSet { + return __sentEmailCount_isset; +} + +- (void) unsetSentEmailCount { + __sentEmailCount_isset = NO; +} + +- (int32_t) dailyEmailLimit { + return __dailyEmailLimit; +} + +- (void) setDailyEmailLimit: (int32_t) dailyEmailLimit { + __dailyEmailLimit = dailyEmailLimit; + __dailyEmailLimit_isset = YES; +} + +- (BOOL) dailyEmailLimitIsSet { + return __dailyEmailLimit_isset; +} + +- (void) unsetDailyEmailLimit { + __dailyEmailLimit_isset = NO; +} + +- (int64_t) emailOptOutDate { + return __emailOptOutDate; +} + +- (void) setEmailOptOutDate: (int64_t) emailOptOutDate { + __emailOptOutDate = emailOptOutDate; + __emailOptOutDate_isset = YES; +} + +- (BOOL) emailOptOutDateIsSet { + return __emailOptOutDate_isset; +} + +- (void) unsetEmailOptOutDate { + __emailOptOutDate_isset = NO; +} + +- (int64_t) partnerEmailOptInDate { + return __partnerEmailOptInDate; +} + +- (void) setPartnerEmailOptInDate: (int64_t) partnerEmailOptInDate { + __partnerEmailOptInDate = partnerEmailOptInDate; + __partnerEmailOptInDate_isset = YES; +} + +- (BOOL) partnerEmailOptInDateIsSet { + return __partnerEmailOptInDate_isset; +} + +- (void) unsetPartnerEmailOptInDate { + __partnerEmailOptInDate_isset = NO; +} + +- (NSString *) preferredLanguage { + return [[__preferredLanguage retain] autorelease]; +} + +- (void) setPreferredLanguage: (NSString *) preferredLanguage { + [preferredLanguage retain]; + [__preferredLanguage release]; + __preferredLanguage = preferredLanguage; + __preferredLanguage_isset = YES; +} + +- (BOOL) preferredLanguageIsSet { + return __preferredLanguage_isset; +} + +- (void) unsetPreferredLanguage { + [__preferredLanguage release]; + __preferredLanguage = nil; + __preferredLanguage_isset = NO; +} + +- (NSString *) preferredCountry { + return [[__preferredCountry retain] autorelease]; +} + +- (void) setPreferredCountry: (NSString *) preferredCountry { + [preferredCountry retain]; + [__preferredCountry release]; + __preferredCountry = preferredCountry; + __preferredCountry_isset = YES; +} + +- (BOOL) preferredCountryIsSet { + return __preferredCountry_isset; +} + +- (void) unsetPreferredCountry { + [__preferredCountry release]; + __preferredCountry = nil; + __preferredCountry_isset = NO; +} + +- (BOOL) clipFullPage { + return __clipFullPage; +} + +- (void) setClipFullPage: (BOOL) clipFullPage { + __clipFullPage = clipFullPage; + __clipFullPage_isset = YES; +} + +- (BOOL) clipFullPageIsSet { + return __clipFullPage_isset; +} + +- (void) unsetClipFullPage { + __clipFullPage_isset = NO; +} + +- (NSString *) twitterUserName { + return [[__twitterUserName retain] autorelease]; +} + +- (void) setTwitterUserName: (NSString *) twitterUserName { + [twitterUserName retain]; + [__twitterUserName release]; + __twitterUserName = twitterUserName; + __twitterUserName_isset = YES; +} + +- (BOOL) twitterUserNameIsSet { + return __twitterUserName_isset; +} + +- (void) unsetTwitterUserName { + [__twitterUserName release]; + __twitterUserName = nil; + __twitterUserName_isset = NO; +} + +- (NSString *) twitterId { + return [[__twitterId retain] autorelease]; +} + +- (void) setTwitterId: (NSString *) twitterId { + [twitterId retain]; + [__twitterId release]; + __twitterId = twitterId; + __twitterId_isset = YES; +} + +- (BOOL) twitterIdIsSet { + return __twitterId_isset; +} + +- (void) unsetTwitterId { + [__twitterId release]; + __twitterId = nil; + __twitterId_isset = NO; +} + +- (NSString *) groupName { + return [[__groupName retain] autorelease]; +} + +- (void) setGroupName: (NSString *) groupName { + [groupName retain]; + [__groupName release]; + __groupName = groupName; + __groupName_isset = YES; +} + +- (BOOL) groupNameIsSet { + return __groupName_isset; +} + +- (void) unsetGroupName { + [__groupName release]; + __groupName = nil; + __groupName_isset = NO; +} + +- (NSString *) recognitionLanguage { + return [[__recognitionLanguage retain] autorelease]; +} + +- (void) setRecognitionLanguage: (NSString *) recognitionLanguage { + [recognitionLanguage retain]; + [__recognitionLanguage release]; + __recognitionLanguage = recognitionLanguage; + __recognitionLanguage_isset = YES; +} + +- (BOOL) recognitionLanguageIsSet { + return __recognitionLanguage_isset; +} + +- (void) unsetRecognitionLanguage { + [__recognitionLanguage release]; + __recognitionLanguage = nil; + __recognitionLanguage_isset = NO; +} + +- (int64_t) customerProfileId { + return __customerProfileId; +} + +- (void) setCustomerProfileId: (int64_t) customerProfileId { + __customerProfileId = customerProfileId; + __customerProfileId_isset = YES; +} + +- (BOOL) customerProfileIdIsSet { + return __customerProfileId_isset; +} + +- (void) unsetCustomerProfileId { + __customerProfileId_isset = NO; +} + +- (NSString *) referralProof { + return [[__referralProof retain] autorelease]; +} + +- (void) setReferralProof: (NSString *) referralProof { + [referralProof retain]; + [__referralProof release]; + __referralProof = referralProof; + __referralProof_isset = YES; +} + +- (BOOL) referralProofIsSet { + return __referralProof_isset; +} + +- (void) unsetReferralProof { + [__referralProof release]; + __referralProof = nil; + __referralProof_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setDefaultLocationName: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_DOUBLE) { + double fieldValue = [inProtocol readDouble]; + [self setDefaultLatitude: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_DOUBLE) { + double fieldValue = [inProtocol readDouble]; + [self setDefaultLongitude: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setPreactivation: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 5: + if (fieldType == TType_LIST) { + int _size0; + [inProtocol readListBeginReturningElementType: NULL size: &_size0]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size0]; + int _i1; + for (_i1 = 0; _i1 < _size0; ++_i1) + { + NSString * _elem2 = [inProtocol readString]; + [fieldValue addObject: _elem2]; + } + [inProtocol readListEnd]; + [self setViewedPromotions: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 6: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setIncomingEmailAddress: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 7: + if (fieldType == TType_LIST) { + int _size3; + [inProtocol readListBeginReturningElementType: NULL size: &_size3]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size3]; + int _i4; + for (_i4 = 0; _i4 < _size3; ++_i4) + { + NSString * _elem5 = [inProtocol readString]; + [fieldValue addObject: _elem5]; + } + [inProtocol readListEnd]; + [self setRecentMailedAddresses: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 9: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setComments: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 11: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setDateAgreedToTermsOfService: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 12: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setMaxReferrals: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 13: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setReferralCount: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 14: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setRefererCode: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 15: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setSentEmailDate: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 16: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setSentEmailCount: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 17: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setDailyEmailLimit: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 18: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setEmailOptOutDate: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 19: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setPartnerEmailOptInDate: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 20: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setPreferredLanguage: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 21: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setPreferredCountry: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 22: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setClipFullPage: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 23: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setTwitterUserName: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 24: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setTwitterId: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 25: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGroupName: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 26: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setRecognitionLanguage: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 27: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setCustomerProfileId: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 28: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setReferralProof: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"UserAttributes"]; + if (__defaultLocationName_isset) { + if (__defaultLocationName != nil) { + [outProtocol writeFieldBeginWithName: @"defaultLocationName" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __defaultLocationName]; + [outProtocol writeFieldEnd]; + } + } + if (__defaultLatitude_isset) { + [outProtocol writeFieldBeginWithName: @"defaultLatitude" type: TType_DOUBLE fieldID: 2]; + [outProtocol writeDouble: __defaultLatitude]; + [outProtocol writeFieldEnd]; + } + if (__defaultLongitude_isset) { + [outProtocol writeFieldBeginWithName: @"defaultLongitude" type: TType_DOUBLE fieldID: 3]; + [outProtocol writeDouble: __defaultLongitude]; + [outProtocol writeFieldEnd]; + } + if (__preactivation_isset) { + [outProtocol writeFieldBeginWithName: @"preactivation" type: TType_BOOL fieldID: 4]; + [outProtocol writeBool: __preactivation]; + [outProtocol writeFieldEnd]; + } + if (__viewedPromotions_isset) { + if (__viewedPromotions != nil) { + [outProtocol writeFieldBeginWithName: @"viewedPromotions" type: TType_LIST fieldID: 5]; + { + [outProtocol writeListBeginWithElementType: TType_STRING size: [__viewedPromotions count]]; + int i7; + for (i7 = 0; i7 < [__viewedPromotions count]; i7++) + { + [outProtocol writeString: [__viewedPromotions objectAtIndex: i7]]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + if (__incomingEmailAddress_isset) { + if (__incomingEmailAddress != nil) { + [outProtocol writeFieldBeginWithName: @"incomingEmailAddress" type: TType_STRING fieldID: 6]; + [outProtocol writeString: __incomingEmailAddress]; + [outProtocol writeFieldEnd]; + } + } + if (__recentMailedAddresses_isset) { + if (__recentMailedAddresses != nil) { + [outProtocol writeFieldBeginWithName: @"recentMailedAddresses" type: TType_LIST fieldID: 7]; + { + [outProtocol writeListBeginWithElementType: TType_STRING size: [__recentMailedAddresses count]]; + int i9; + for (i9 = 0; i9 < [__recentMailedAddresses count]; i9++) + { + [outProtocol writeString: [__recentMailedAddresses objectAtIndex: i9]]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + if (__comments_isset) { + if (__comments != nil) { + [outProtocol writeFieldBeginWithName: @"comments" type: TType_STRING fieldID: 9]; + [outProtocol writeString: __comments]; + [outProtocol writeFieldEnd]; + } + } + if (__dateAgreedToTermsOfService_isset) { + [outProtocol writeFieldBeginWithName: @"dateAgreedToTermsOfService" type: TType_I64 fieldID: 11]; + [outProtocol writeI64: __dateAgreedToTermsOfService]; + [outProtocol writeFieldEnd]; + } + if (__maxReferrals_isset) { + [outProtocol writeFieldBeginWithName: @"maxReferrals" type: TType_I32 fieldID: 12]; + [outProtocol writeI32: __maxReferrals]; + [outProtocol writeFieldEnd]; + } + if (__referralCount_isset) { + [outProtocol writeFieldBeginWithName: @"referralCount" type: TType_I32 fieldID: 13]; + [outProtocol writeI32: __referralCount]; + [outProtocol writeFieldEnd]; + } + if (__refererCode_isset) { + if (__refererCode != nil) { + [outProtocol writeFieldBeginWithName: @"refererCode" type: TType_STRING fieldID: 14]; + [outProtocol writeString: __refererCode]; + [outProtocol writeFieldEnd]; + } + } + if (__sentEmailDate_isset) { + [outProtocol writeFieldBeginWithName: @"sentEmailDate" type: TType_I64 fieldID: 15]; + [outProtocol writeI64: __sentEmailDate]; + [outProtocol writeFieldEnd]; + } + if (__sentEmailCount_isset) { + [outProtocol writeFieldBeginWithName: @"sentEmailCount" type: TType_I32 fieldID: 16]; + [outProtocol writeI32: __sentEmailCount]; + [outProtocol writeFieldEnd]; + } + if (__dailyEmailLimit_isset) { + [outProtocol writeFieldBeginWithName: @"dailyEmailLimit" type: TType_I32 fieldID: 17]; + [outProtocol writeI32: __dailyEmailLimit]; + [outProtocol writeFieldEnd]; + } + if (__emailOptOutDate_isset) { + [outProtocol writeFieldBeginWithName: @"emailOptOutDate" type: TType_I64 fieldID: 18]; + [outProtocol writeI64: __emailOptOutDate]; + [outProtocol writeFieldEnd]; + } + if (__partnerEmailOptInDate_isset) { + [outProtocol writeFieldBeginWithName: @"partnerEmailOptInDate" type: TType_I64 fieldID: 19]; + [outProtocol writeI64: __partnerEmailOptInDate]; + [outProtocol writeFieldEnd]; + } + if (__preferredLanguage_isset) { + if (__preferredLanguage != nil) { + [outProtocol writeFieldBeginWithName: @"preferredLanguage" type: TType_STRING fieldID: 20]; + [outProtocol writeString: __preferredLanguage]; + [outProtocol writeFieldEnd]; + } + } + if (__preferredCountry_isset) { + if (__preferredCountry != nil) { + [outProtocol writeFieldBeginWithName: @"preferredCountry" type: TType_STRING fieldID: 21]; + [outProtocol writeString: __preferredCountry]; + [outProtocol writeFieldEnd]; + } + } + if (__clipFullPage_isset) { + [outProtocol writeFieldBeginWithName: @"clipFullPage" type: TType_BOOL fieldID: 22]; + [outProtocol writeBool: __clipFullPage]; + [outProtocol writeFieldEnd]; + } + if (__twitterUserName_isset) { + if (__twitterUserName != nil) { + [outProtocol writeFieldBeginWithName: @"twitterUserName" type: TType_STRING fieldID: 23]; + [outProtocol writeString: __twitterUserName]; + [outProtocol writeFieldEnd]; + } + } + if (__twitterId_isset) { + if (__twitterId != nil) { + [outProtocol writeFieldBeginWithName: @"twitterId" type: TType_STRING fieldID: 24]; + [outProtocol writeString: __twitterId]; + [outProtocol writeFieldEnd]; + } + } + if (__groupName_isset) { + if (__groupName != nil) { + [outProtocol writeFieldBeginWithName: @"groupName" type: TType_STRING fieldID: 25]; + [outProtocol writeString: __groupName]; + [outProtocol writeFieldEnd]; + } + } + if (__recognitionLanguage_isset) { + if (__recognitionLanguage != nil) { + [outProtocol writeFieldBeginWithName: @"recognitionLanguage" type: TType_STRING fieldID: 26]; + [outProtocol writeString: __recognitionLanguage]; + [outProtocol writeFieldEnd]; + } + } + if (__customerProfileId_isset) { + [outProtocol writeFieldBeginWithName: @"customerProfileId" type: TType_I64 fieldID: 27]; + [outProtocol writeI64: __customerProfileId]; + [outProtocol writeFieldEnd]; + } + if (__referralProof_isset) { + if (__referralProof != nil) { + [outProtocol writeFieldBeginWithName: @"referralProof" type: TType_STRING fieldID: 28]; + [outProtocol writeString: __referralProof]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"UserAttributes("]; + [ms appendString: @"defaultLocationName:"]; + [ms appendFormat: @"\"%@\"", __defaultLocationName]; + [ms appendString: @",defaultLatitude:"]; + [ms appendFormat: @"%f", __defaultLatitude]; + [ms appendString: @",defaultLongitude:"]; + [ms appendFormat: @"%f", __defaultLongitude]; + [ms appendString: @",preactivation:"]; + [ms appendFormat: @"%i", __preactivation]; + [ms appendString: @",viewedPromotions:"]; + [ms appendFormat: @"%@", __viewedPromotions]; + [ms appendString: @",incomingEmailAddress:"]; + [ms appendFormat: @"\"%@\"", __incomingEmailAddress]; + [ms appendString: @",recentMailedAddresses:"]; + [ms appendFormat: @"%@", __recentMailedAddresses]; + [ms appendString: @",comments:"]; + [ms appendFormat: @"\"%@\"", __comments]; + [ms appendString: @",dateAgreedToTermsOfService:"]; + [ms appendFormat: @"%qi", __dateAgreedToTermsOfService]; + [ms appendString: @",maxReferrals:"]; + [ms appendFormat: @"%i", __maxReferrals]; + [ms appendString: @",referralCount:"]; + [ms appendFormat: @"%i", __referralCount]; + [ms appendString: @",refererCode:"]; + [ms appendFormat: @"\"%@\"", __refererCode]; + [ms appendString: @",sentEmailDate:"]; + [ms appendFormat: @"%qi", __sentEmailDate]; + [ms appendString: @",sentEmailCount:"]; + [ms appendFormat: @"%i", __sentEmailCount]; + [ms appendString: @",dailyEmailLimit:"]; + [ms appendFormat: @"%i", __dailyEmailLimit]; + [ms appendString: @",emailOptOutDate:"]; + [ms appendFormat: @"%qi", __emailOptOutDate]; + [ms appendString: @",partnerEmailOptInDate:"]; + [ms appendFormat: @"%qi", __partnerEmailOptInDate]; + [ms appendString: @",preferredLanguage:"]; + [ms appendFormat: @"\"%@\"", __preferredLanguage]; + [ms appendString: @",preferredCountry:"]; + [ms appendFormat: @"\"%@\"", __preferredCountry]; + [ms appendString: @",clipFullPage:"]; + [ms appendFormat: @"%i", __clipFullPage]; + [ms appendString: @",twitterUserName:"]; + [ms appendFormat: @"\"%@\"", __twitterUserName]; + [ms appendString: @",twitterId:"]; + [ms appendFormat: @"\"%@\"", __twitterId]; + [ms appendString: @",groupName:"]; + [ms appendFormat: @"\"%@\"", __groupName]; + [ms appendString: @",recognitionLanguage:"]; + [ms appendFormat: @"\"%@\"", __recognitionLanguage]; + [ms appendString: @",customerProfileId:"]; + [ms appendFormat: @"%qi", __customerProfileId]; + [ms appendString: @",referralProof:"]; + [ms appendFormat: @"\"%@\"", __referralProof]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMAccounting + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic uploadLimit; +@dynamic uploadLimitEnd; +@dynamic uploadLimitNextMonth; +@dynamic premiumServiceStatus; +@dynamic premiumOrderNumber; +@dynamic premiumCommerceService; +@dynamic premiumServiceStart; +@dynamic premiumServiceSKU; +@dynamic lastSuccessfulCharge; +@dynamic lastFailedCharge; +@dynamic lastFailedChargeReason; +@dynamic nextPaymentDue; +@dynamic premiumLockUntil; +@dynamic updated; +@dynamic premiumSubscriptionNumber; +@dynamic lastRequestedCharge; +#endif + +- (id) initWithUploadLimit: (int64_t) uploadLimit uploadLimitEnd: (EDAMTimestamp) uploadLimitEnd uploadLimitNextMonth: (int64_t) uploadLimitNextMonth premiumServiceStatus: (int) premiumServiceStatus premiumOrderNumber: (NSString *) premiumOrderNumber premiumCommerceService: (NSString *) premiumCommerceService premiumServiceStart: (EDAMTimestamp) premiumServiceStart premiumServiceSKU: (NSString *) premiumServiceSKU lastSuccessfulCharge: (EDAMTimestamp) lastSuccessfulCharge lastFailedCharge: (EDAMTimestamp) lastFailedCharge lastFailedChargeReason: (NSString *) lastFailedChargeReason nextPaymentDue: (EDAMTimestamp) nextPaymentDue premiumLockUntil: (EDAMTimestamp) premiumLockUntil updated: (EDAMTimestamp) updated premiumSubscriptionNumber: (NSString *) premiumSubscriptionNumber lastRequestedCharge: (EDAMTimestamp) lastRequestedCharge +{ + self = [super init]; + __uploadLimit = uploadLimit; + __uploadLimit_isset = YES; + __uploadLimitEnd = uploadLimitEnd; + __uploadLimitEnd_isset = YES; + __uploadLimitNextMonth = uploadLimitNextMonth; + __uploadLimitNextMonth_isset = YES; + __premiumServiceStatus = premiumServiceStatus; + __premiumServiceStatus_isset = YES; + __premiumOrderNumber = [premiumOrderNumber retain]; + __premiumOrderNumber_isset = YES; + __premiumCommerceService = [premiumCommerceService retain]; + __premiumCommerceService_isset = YES; + __premiumServiceStart = premiumServiceStart; + __premiumServiceStart_isset = YES; + __premiumServiceSKU = [premiumServiceSKU retain]; + __premiumServiceSKU_isset = YES; + __lastSuccessfulCharge = lastSuccessfulCharge; + __lastSuccessfulCharge_isset = YES; + __lastFailedCharge = lastFailedCharge; + __lastFailedCharge_isset = YES; + __lastFailedChargeReason = [lastFailedChargeReason retain]; + __lastFailedChargeReason_isset = YES; + __nextPaymentDue = nextPaymentDue; + __nextPaymentDue_isset = YES; + __premiumLockUntil = premiumLockUntil; + __premiumLockUntil_isset = YES; + __updated = updated; + __updated_isset = YES; + __premiumSubscriptionNumber = [premiumSubscriptionNumber retain]; + __premiumSubscriptionNumber_isset = YES; + __lastRequestedCharge = lastRequestedCharge; + __lastRequestedCharge_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"uploadLimit"]) + { + __uploadLimit = [decoder decodeInt64ForKey: @"uploadLimit"]; + __uploadLimit_isset = YES; + } + if ([decoder containsValueForKey: @"uploadLimitEnd"]) + { + __uploadLimitEnd = [decoder decodeInt64ForKey: @"uploadLimitEnd"]; + __uploadLimitEnd_isset = YES; + } + if ([decoder containsValueForKey: @"uploadLimitNextMonth"]) + { + __uploadLimitNextMonth = [decoder decodeInt64ForKey: @"uploadLimitNextMonth"]; + __uploadLimitNextMonth_isset = YES; + } + if ([decoder containsValueForKey: @"premiumServiceStatus"]) + { + __premiumServiceStatus = [decoder decodeIntForKey: @"premiumServiceStatus"]; + __premiumServiceStatus_isset = YES; + } + if ([decoder containsValueForKey: @"premiumOrderNumber"]) + { + __premiumOrderNumber = [[decoder decodeObjectForKey: @"premiumOrderNumber"] retain]; + __premiumOrderNumber_isset = YES; + } + if ([decoder containsValueForKey: @"premiumCommerceService"]) + { + __premiumCommerceService = [[decoder decodeObjectForKey: @"premiumCommerceService"] retain]; + __premiumCommerceService_isset = YES; + } + if ([decoder containsValueForKey: @"premiumServiceStart"]) + { + __premiumServiceStart = [decoder decodeInt64ForKey: @"premiumServiceStart"]; + __premiumServiceStart_isset = YES; + } + if ([decoder containsValueForKey: @"premiumServiceSKU"]) + { + __premiumServiceSKU = [[decoder decodeObjectForKey: @"premiumServiceSKU"] retain]; + __premiumServiceSKU_isset = YES; + } + if ([decoder containsValueForKey: @"lastSuccessfulCharge"]) + { + __lastSuccessfulCharge = [decoder decodeInt64ForKey: @"lastSuccessfulCharge"]; + __lastSuccessfulCharge_isset = YES; + } + if ([decoder containsValueForKey: @"lastFailedCharge"]) + { + __lastFailedCharge = [decoder decodeInt64ForKey: @"lastFailedCharge"]; + __lastFailedCharge_isset = YES; + } + if ([decoder containsValueForKey: @"lastFailedChargeReason"]) + { + __lastFailedChargeReason = [[decoder decodeObjectForKey: @"lastFailedChargeReason"] retain]; + __lastFailedChargeReason_isset = YES; + } + if ([decoder containsValueForKey: @"nextPaymentDue"]) + { + __nextPaymentDue = [decoder decodeInt64ForKey: @"nextPaymentDue"]; + __nextPaymentDue_isset = YES; + } + if ([decoder containsValueForKey: @"premiumLockUntil"]) + { + __premiumLockUntil = [decoder decodeInt64ForKey: @"premiumLockUntil"]; + __premiumLockUntil_isset = YES; + } + if ([decoder containsValueForKey: @"updated"]) + { + __updated = [decoder decodeInt64ForKey: @"updated"]; + __updated_isset = YES; + } + if ([decoder containsValueForKey: @"premiumSubscriptionNumber"]) + { + __premiumSubscriptionNumber = [[decoder decodeObjectForKey: @"premiumSubscriptionNumber"] retain]; + __premiumSubscriptionNumber_isset = YES; + } + if ([decoder containsValueForKey: @"lastRequestedCharge"]) + { + __lastRequestedCharge = [decoder decodeInt64ForKey: @"lastRequestedCharge"]; + __lastRequestedCharge_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__uploadLimit_isset) + { + [encoder encodeInt64: __uploadLimit forKey: @"uploadLimit"]; + } + if (__uploadLimitEnd_isset) + { + [encoder encodeInt64: __uploadLimitEnd forKey: @"uploadLimitEnd"]; + } + if (__uploadLimitNextMonth_isset) + { + [encoder encodeInt64: __uploadLimitNextMonth forKey: @"uploadLimitNextMonth"]; + } + if (__premiumServiceStatus_isset) + { + [encoder encodeInt: __premiumServiceStatus forKey: @"premiumServiceStatus"]; + } + if (__premiumOrderNumber_isset) + { + [encoder encodeObject: __premiumOrderNumber forKey: @"premiumOrderNumber"]; + } + if (__premiumCommerceService_isset) + { + [encoder encodeObject: __premiumCommerceService forKey: @"premiumCommerceService"]; + } + if (__premiumServiceStart_isset) + { + [encoder encodeInt64: __premiumServiceStart forKey: @"premiumServiceStart"]; + } + if (__premiumServiceSKU_isset) + { + [encoder encodeObject: __premiumServiceSKU forKey: @"premiumServiceSKU"]; + } + if (__lastSuccessfulCharge_isset) + { + [encoder encodeInt64: __lastSuccessfulCharge forKey: @"lastSuccessfulCharge"]; + } + if (__lastFailedCharge_isset) + { + [encoder encodeInt64: __lastFailedCharge forKey: @"lastFailedCharge"]; + } + if (__lastFailedChargeReason_isset) + { + [encoder encodeObject: __lastFailedChargeReason forKey: @"lastFailedChargeReason"]; + } + if (__nextPaymentDue_isset) + { + [encoder encodeInt64: __nextPaymentDue forKey: @"nextPaymentDue"]; + } + if (__premiumLockUntil_isset) + { + [encoder encodeInt64: __premiumLockUntil forKey: @"premiumLockUntil"]; + } + if (__updated_isset) + { + [encoder encodeInt64: __updated forKey: @"updated"]; + } + if (__premiumSubscriptionNumber_isset) + { + [encoder encodeObject: __premiumSubscriptionNumber forKey: @"premiumSubscriptionNumber"]; + } + if (__lastRequestedCharge_isset) + { + [encoder encodeInt64: __lastRequestedCharge forKey: @"lastRequestedCharge"]; + } +} + +- (void) dealloc +{ + [__premiumOrderNumber release]; + [__premiumCommerceService release]; + [__premiumServiceSKU release]; + [__lastFailedChargeReason release]; + [__premiumSubscriptionNumber release]; + [super dealloc]; +} + +- (int64_t) uploadLimit { + return __uploadLimit; +} + +- (void) setUploadLimit: (int64_t) uploadLimit { + __uploadLimit = uploadLimit; + __uploadLimit_isset = YES; +} + +- (BOOL) uploadLimitIsSet { + return __uploadLimit_isset; +} + +- (void) unsetUploadLimit { + __uploadLimit_isset = NO; +} + +- (int64_t) uploadLimitEnd { + return __uploadLimitEnd; +} + +- (void) setUploadLimitEnd: (int64_t) uploadLimitEnd { + __uploadLimitEnd = uploadLimitEnd; + __uploadLimitEnd_isset = YES; +} + +- (BOOL) uploadLimitEndIsSet { + return __uploadLimitEnd_isset; +} + +- (void) unsetUploadLimitEnd { + __uploadLimitEnd_isset = NO; +} + +- (int64_t) uploadLimitNextMonth { + return __uploadLimitNextMonth; +} + +- (void) setUploadLimitNextMonth: (int64_t) uploadLimitNextMonth { + __uploadLimitNextMonth = uploadLimitNextMonth; + __uploadLimitNextMonth_isset = YES; +} + +- (BOOL) uploadLimitNextMonthIsSet { + return __uploadLimitNextMonth_isset; +} + +- (void) unsetUploadLimitNextMonth { + __uploadLimitNextMonth_isset = NO; +} + +- (int) premiumServiceStatus { + return __premiumServiceStatus; +} + +- (void) setPremiumServiceStatus: (int) premiumServiceStatus { + __premiumServiceStatus = premiumServiceStatus; + __premiumServiceStatus_isset = YES; +} + +- (BOOL) premiumServiceStatusIsSet { + return __premiumServiceStatus_isset; +} + +- (void) unsetPremiumServiceStatus { + __premiumServiceStatus_isset = NO; +} + +- (NSString *) premiumOrderNumber { + return [[__premiumOrderNumber retain] autorelease]; +} + +- (void) setPremiumOrderNumber: (NSString *) premiumOrderNumber { + [premiumOrderNumber retain]; + [__premiumOrderNumber release]; + __premiumOrderNumber = premiumOrderNumber; + __premiumOrderNumber_isset = YES; +} + +- (BOOL) premiumOrderNumberIsSet { + return __premiumOrderNumber_isset; +} + +- (void) unsetPremiumOrderNumber { + [__premiumOrderNumber release]; + __premiumOrderNumber = nil; + __premiumOrderNumber_isset = NO; +} + +- (NSString *) premiumCommerceService { + return [[__premiumCommerceService retain] autorelease]; +} + +- (void) setPremiumCommerceService: (NSString *) premiumCommerceService { + [premiumCommerceService retain]; + [__premiumCommerceService release]; + __premiumCommerceService = premiumCommerceService; + __premiumCommerceService_isset = YES; +} + +- (BOOL) premiumCommerceServiceIsSet { + return __premiumCommerceService_isset; +} + +- (void) unsetPremiumCommerceService { + [__premiumCommerceService release]; + __premiumCommerceService = nil; + __premiumCommerceService_isset = NO; +} + +- (int64_t) premiumServiceStart { + return __premiumServiceStart; +} + +- (void) setPremiumServiceStart: (int64_t) premiumServiceStart { + __premiumServiceStart = premiumServiceStart; + __premiumServiceStart_isset = YES; +} + +- (BOOL) premiumServiceStartIsSet { + return __premiumServiceStart_isset; +} + +- (void) unsetPremiumServiceStart { + __premiumServiceStart_isset = NO; +} + +- (NSString *) premiumServiceSKU { + return [[__premiumServiceSKU retain] autorelease]; +} + +- (void) setPremiumServiceSKU: (NSString *) premiumServiceSKU { + [premiumServiceSKU retain]; + [__premiumServiceSKU release]; + __premiumServiceSKU = premiumServiceSKU; + __premiumServiceSKU_isset = YES; +} + +- (BOOL) premiumServiceSKUIsSet { + return __premiumServiceSKU_isset; +} + +- (void) unsetPremiumServiceSKU { + [__premiumServiceSKU release]; + __premiumServiceSKU = nil; + __premiumServiceSKU_isset = NO; +} + +- (int64_t) lastSuccessfulCharge { + return __lastSuccessfulCharge; +} + +- (void) setLastSuccessfulCharge: (int64_t) lastSuccessfulCharge { + __lastSuccessfulCharge = lastSuccessfulCharge; + __lastSuccessfulCharge_isset = YES; +} + +- (BOOL) lastSuccessfulChargeIsSet { + return __lastSuccessfulCharge_isset; +} + +- (void) unsetLastSuccessfulCharge { + __lastSuccessfulCharge_isset = NO; +} + +- (int64_t) lastFailedCharge { + return __lastFailedCharge; +} + +- (void) setLastFailedCharge: (int64_t) lastFailedCharge { + __lastFailedCharge = lastFailedCharge; + __lastFailedCharge_isset = YES; +} + +- (BOOL) lastFailedChargeIsSet { + return __lastFailedCharge_isset; +} + +- (void) unsetLastFailedCharge { + __lastFailedCharge_isset = NO; +} + +- (NSString *) lastFailedChargeReason { + return [[__lastFailedChargeReason retain] autorelease]; +} + +- (void) setLastFailedChargeReason: (NSString *) lastFailedChargeReason { + [lastFailedChargeReason retain]; + [__lastFailedChargeReason release]; + __lastFailedChargeReason = lastFailedChargeReason; + __lastFailedChargeReason_isset = YES; +} + +- (BOOL) lastFailedChargeReasonIsSet { + return __lastFailedChargeReason_isset; +} + +- (void) unsetLastFailedChargeReason { + [__lastFailedChargeReason release]; + __lastFailedChargeReason = nil; + __lastFailedChargeReason_isset = NO; +} + +- (int64_t) nextPaymentDue { + return __nextPaymentDue; +} + +- (void) setNextPaymentDue: (int64_t) nextPaymentDue { + __nextPaymentDue = nextPaymentDue; + __nextPaymentDue_isset = YES; +} + +- (BOOL) nextPaymentDueIsSet { + return __nextPaymentDue_isset; +} + +- (void) unsetNextPaymentDue { + __nextPaymentDue_isset = NO; +} + +- (int64_t) premiumLockUntil { + return __premiumLockUntil; +} + +- (void) setPremiumLockUntil: (int64_t) premiumLockUntil { + __premiumLockUntil = premiumLockUntil; + __premiumLockUntil_isset = YES; +} + +- (BOOL) premiumLockUntilIsSet { + return __premiumLockUntil_isset; +} + +- (void) unsetPremiumLockUntil { + __premiumLockUntil_isset = NO; +} + +- (int64_t) updated { + return __updated; +} + +- (void) setUpdated: (int64_t) updated { + __updated = updated; + __updated_isset = YES; +} + +- (BOOL) updatedIsSet { + return __updated_isset; +} + +- (void) unsetUpdated { + __updated_isset = NO; +} + +- (NSString *) premiumSubscriptionNumber { + return [[__premiumSubscriptionNumber retain] autorelease]; +} + +- (void) setPremiumSubscriptionNumber: (NSString *) premiumSubscriptionNumber { + [premiumSubscriptionNumber retain]; + [__premiumSubscriptionNumber release]; + __premiumSubscriptionNumber = premiumSubscriptionNumber; + __premiumSubscriptionNumber_isset = YES; +} + +- (BOOL) premiumSubscriptionNumberIsSet { + return __premiumSubscriptionNumber_isset; +} + +- (void) unsetPremiumSubscriptionNumber { + [__premiumSubscriptionNumber release]; + __premiumSubscriptionNumber = nil; + __premiumSubscriptionNumber_isset = NO; +} + +- (int64_t) lastRequestedCharge { + return __lastRequestedCharge; +} + +- (void) setLastRequestedCharge: (int64_t) lastRequestedCharge { + __lastRequestedCharge = lastRequestedCharge; + __lastRequestedCharge_isset = YES; +} + +- (BOOL) lastRequestedChargeIsSet { + return __lastRequestedCharge_isset; +} + +- (void) unsetLastRequestedCharge { + __lastRequestedCharge_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setUploadLimit: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setUploadLimitEnd: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setUploadLimitNextMonth: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_I32) { + int fieldValue = [inProtocol readI32]; + [self setPremiumServiceStatus: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 5: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setPremiumOrderNumber: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 6: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setPremiumCommerceService: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 7: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setPremiumServiceStart: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 8: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setPremiumServiceSKU: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 9: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setLastSuccessfulCharge: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 10: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setLastFailedCharge: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 11: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setLastFailedChargeReason: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 12: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setNextPaymentDue: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 13: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setPremiumLockUntil: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 14: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setUpdated: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 16: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setPremiumSubscriptionNumber: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 17: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setLastRequestedCharge: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"Accounting"]; + if (__uploadLimit_isset) { + [outProtocol writeFieldBeginWithName: @"uploadLimit" type: TType_I64 fieldID: 1]; + [outProtocol writeI64: __uploadLimit]; + [outProtocol writeFieldEnd]; + } + if (__uploadLimitEnd_isset) { + [outProtocol writeFieldBeginWithName: @"uploadLimitEnd" type: TType_I64 fieldID: 2]; + [outProtocol writeI64: __uploadLimitEnd]; + [outProtocol writeFieldEnd]; + } + if (__uploadLimitNextMonth_isset) { + [outProtocol writeFieldBeginWithName: @"uploadLimitNextMonth" type: TType_I64 fieldID: 3]; + [outProtocol writeI64: __uploadLimitNextMonth]; + [outProtocol writeFieldEnd]; + } + if (__premiumServiceStatus_isset) { + [outProtocol writeFieldBeginWithName: @"premiumServiceStatus" type: TType_I32 fieldID: 4]; + [outProtocol writeI32: __premiumServiceStatus]; + [outProtocol writeFieldEnd]; + } + if (__premiumOrderNumber_isset) { + if (__premiumOrderNumber != nil) { + [outProtocol writeFieldBeginWithName: @"premiumOrderNumber" type: TType_STRING fieldID: 5]; + [outProtocol writeString: __premiumOrderNumber]; + [outProtocol writeFieldEnd]; + } + } + if (__premiumCommerceService_isset) { + if (__premiumCommerceService != nil) { + [outProtocol writeFieldBeginWithName: @"premiumCommerceService" type: TType_STRING fieldID: 6]; + [outProtocol writeString: __premiumCommerceService]; + [outProtocol writeFieldEnd]; + } + } + if (__premiumServiceStart_isset) { + [outProtocol writeFieldBeginWithName: @"premiumServiceStart" type: TType_I64 fieldID: 7]; + [outProtocol writeI64: __premiumServiceStart]; + [outProtocol writeFieldEnd]; + } + if (__premiumServiceSKU_isset) { + if (__premiumServiceSKU != nil) { + [outProtocol writeFieldBeginWithName: @"premiumServiceSKU" type: TType_STRING fieldID: 8]; + [outProtocol writeString: __premiumServiceSKU]; + [outProtocol writeFieldEnd]; + } + } + if (__lastSuccessfulCharge_isset) { + [outProtocol writeFieldBeginWithName: @"lastSuccessfulCharge" type: TType_I64 fieldID: 9]; + [outProtocol writeI64: __lastSuccessfulCharge]; + [outProtocol writeFieldEnd]; + } + if (__lastFailedCharge_isset) { + [outProtocol writeFieldBeginWithName: @"lastFailedCharge" type: TType_I64 fieldID: 10]; + [outProtocol writeI64: __lastFailedCharge]; + [outProtocol writeFieldEnd]; + } + if (__lastFailedChargeReason_isset) { + if (__lastFailedChargeReason != nil) { + [outProtocol writeFieldBeginWithName: @"lastFailedChargeReason" type: TType_STRING fieldID: 11]; + [outProtocol writeString: __lastFailedChargeReason]; + [outProtocol writeFieldEnd]; + } + } + if (__nextPaymentDue_isset) { + [outProtocol writeFieldBeginWithName: @"nextPaymentDue" type: TType_I64 fieldID: 12]; + [outProtocol writeI64: __nextPaymentDue]; + [outProtocol writeFieldEnd]; + } + if (__premiumLockUntil_isset) { + [outProtocol writeFieldBeginWithName: @"premiumLockUntil" type: TType_I64 fieldID: 13]; + [outProtocol writeI64: __premiumLockUntil]; + [outProtocol writeFieldEnd]; + } + if (__updated_isset) { + [outProtocol writeFieldBeginWithName: @"updated" type: TType_I64 fieldID: 14]; + [outProtocol writeI64: __updated]; + [outProtocol writeFieldEnd]; + } + if (__premiumSubscriptionNumber_isset) { + if (__premiumSubscriptionNumber != nil) { + [outProtocol writeFieldBeginWithName: @"premiumSubscriptionNumber" type: TType_STRING fieldID: 16]; + [outProtocol writeString: __premiumSubscriptionNumber]; + [outProtocol writeFieldEnd]; + } + } + if (__lastRequestedCharge_isset) { + [outProtocol writeFieldBeginWithName: @"lastRequestedCharge" type: TType_I64 fieldID: 17]; + [outProtocol writeI64: __lastRequestedCharge]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"Accounting("]; + [ms appendString: @"uploadLimit:"]; + [ms appendFormat: @"%qi", __uploadLimit]; + [ms appendString: @",uploadLimitEnd:"]; + [ms appendFormat: @"%qi", __uploadLimitEnd]; + [ms appendString: @",uploadLimitNextMonth:"]; + [ms appendFormat: @"%qi", __uploadLimitNextMonth]; + [ms appendString: @",premiumServiceStatus:"]; + [ms appendFormat: @"%i", __premiumServiceStatus]; + [ms appendString: @",premiumOrderNumber:"]; + [ms appendFormat: @"\"%@\"", __premiumOrderNumber]; + [ms appendString: @",premiumCommerceService:"]; + [ms appendFormat: @"\"%@\"", __premiumCommerceService]; + [ms appendString: @",premiumServiceStart:"]; + [ms appendFormat: @"%qi", __premiumServiceStart]; + [ms appendString: @",premiumServiceSKU:"]; + [ms appendFormat: @"\"%@\"", __premiumServiceSKU]; + [ms appendString: @",lastSuccessfulCharge:"]; + [ms appendFormat: @"%qi", __lastSuccessfulCharge]; + [ms appendString: @",lastFailedCharge:"]; + [ms appendFormat: @"%qi", __lastFailedCharge]; + [ms appendString: @",lastFailedChargeReason:"]; + [ms appendFormat: @"\"%@\"", __lastFailedChargeReason]; + [ms appendString: @",nextPaymentDue:"]; + [ms appendFormat: @"%qi", __nextPaymentDue]; + [ms appendString: @",premiumLockUntil:"]; + [ms appendFormat: @"%qi", __premiumLockUntil]; + [ms appendString: @",updated:"]; + [ms appendFormat: @"%qi", __updated]; + [ms appendString: @",premiumSubscriptionNumber:"]; + [ms appendFormat: @"\"%@\"", __premiumSubscriptionNumber]; + [ms appendString: @",lastRequestedCharge:"]; + [ms appendFormat: @"%qi", __lastRequestedCharge]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMUser + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic id; +@dynamic username; +@dynamic email; +@dynamic name; +@dynamic timezone; +@dynamic privilege; +@dynamic created; +@dynamic updated; +@dynamic deleted; +@dynamic active; +@dynamic shardId; +@dynamic attributes; +@dynamic accounting; +#endif + +- (id) initWithId: (EDAMUserID) id username: (NSString *) username email: (NSString *) email name: (NSString *) name timezone: (NSString *) timezone privilege: (int) privilege created: (EDAMTimestamp) created updated: (EDAMTimestamp) updated deleted: (EDAMTimestamp) deleted active: (BOOL) active shardId: (NSString *) shardId attributes: (EDAMUserAttributes *) attributes accounting: (EDAMAccounting *) accounting +{ + self = [super init]; + __id = id; + __id_isset = YES; + __username = [username retain]; + __username_isset = YES; + __email = [email retain]; + __email_isset = YES; + __name = [name retain]; + __name_isset = YES; + __timezone = [timezone retain]; + __timezone_isset = YES; + __privilege = privilege; + __privilege_isset = YES; + __created = created; + __created_isset = YES; + __updated = updated; + __updated_isset = YES; + __deleted = deleted; + __deleted_isset = YES; + __active = active; + __active_isset = YES; + __shardId = [shardId retain]; + __shardId_isset = YES; + __attributes = [attributes retain]; + __attributes_isset = YES; + __accounting = [accounting retain]; + __accounting_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"id"]) + { + __id = [decoder decodeInt32ForKey: @"id"]; + __id_isset = YES; + } + if ([decoder containsValueForKey: @"username"]) + { + __username = [[decoder decodeObjectForKey: @"username"] retain]; + __username_isset = YES; + } + if ([decoder containsValueForKey: @"email"]) + { + __email = [[decoder decodeObjectForKey: @"email"] retain]; + __email_isset = YES; + } + if ([decoder containsValueForKey: @"name"]) + { + __name = [[decoder decodeObjectForKey: @"name"] retain]; + __name_isset = YES; + } + if ([decoder containsValueForKey: @"timezone"]) + { + __timezone = [[decoder decodeObjectForKey: @"timezone"] retain]; + __timezone_isset = YES; + } + if ([decoder containsValueForKey: @"privilege"]) + { + __privilege = [decoder decodeIntForKey: @"privilege"]; + __privilege_isset = YES; + } + if ([decoder containsValueForKey: @"created"]) + { + __created = [decoder decodeInt64ForKey: @"created"]; + __created_isset = YES; + } + if ([decoder containsValueForKey: @"updated"]) + { + __updated = [decoder decodeInt64ForKey: @"updated"]; + __updated_isset = YES; + } + if ([decoder containsValueForKey: @"deleted"]) + { + __deleted = [decoder decodeInt64ForKey: @"deleted"]; + __deleted_isset = YES; + } + if ([decoder containsValueForKey: @"active"]) + { + __active = [decoder decodeBoolForKey: @"active"]; + __active_isset = YES; + } + if ([decoder containsValueForKey: @"shardId"]) + { + __shardId = [[decoder decodeObjectForKey: @"shardId"] retain]; + __shardId_isset = YES; + } + if ([decoder containsValueForKey: @"attributes"]) + { + __attributes = [[decoder decodeObjectForKey: @"attributes"] retain]; + __attributes_isset = YES; + } + if ([decoder containsValueForKey: @"accounting"]) + { + __accounting = [[decoder decodeObjectForKey: @"accounting"] retain]; + __accounting_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__id_isset) + { + [encoder encodeInt32: __id forKey: @"id"]; + } + if (__username_isset) + { + [encoder encodeObject: __username forKey: @"username"]; + } + if (__email_isset) + { + [encoder encodeObject: __email forKey: @"email"]; + } + if (__name_isset) + { + [encoder encodeObject: __name forKey: @"name"]; + } + if (__timezone_isset) + { + [encoder encodeObject: __timezone forKey: @"timezone"]; + } + if (__privilege_isset) + { + [encoder encodeInt: __privilege forKey: @"privilege"]; + } + if (__created_isset) + { + [encoder encodeInt64: __created forKey: @"created"]; + } + if (__updated_isset) + { + [encoder encodeInt64: __updated forKey: @"updated"]; + } + if (__deleted_isset) + { + [encoder encodeInt64: __deleted forKey: @"deleted"]; + } + if (__active_isset) + { + [encoder encodeBool: __active forKey: @"active"]; + } + if (__shardId_isset) + { + [encoder encodeObject: __shardId forKey: @"shardId"]; + } + if (__attributes_isset) + { + [encoder encodeObject: __attributes forKey: @"attributes"]; + } + if (__accounting_isset) + { + [encoder encodeObject: __accounting forKey: @"accounting"]; + } +} + +- (void) dealloc +{ + [__username release]; + [__email release]; + [__name release]; + [__timezone release]; + [__shardId release]; + [__attributes release]; + [__accounting release]; + [super dealloc]; +} + +- (int32_t) id { + return __id; +} + +- (void) setId: (int32_t) id { + __id = id; + __id_isset = YES; +} + +- (BOOL) idIsSet { + return __id_isset; +} + +- (void) unsetId { + __id_isset = NO; +} + +- (NSString *) username { + return [[__username retain] autorelease]; +} + +- (void) setUsername: (NSString *) username { + [username retain]; + [__username release]; + __username = username; + __username_isset = YES; +} + +- (BOOL) usernameIsSet { + return __username_isset; +} + +- (void) unsetUsername { + [__username release]; + __username = nil; + __username_isset = NO; +} + +- (NSString *) email { + return [[__email retain] autorelease]; +} + +- (void) setEmail: (NSString *) email { + [email retain]; + [__email release]; + __email = email; + __email_isset = YES; +} + +- (BOOL) emailIsSet { + return __email_isset; +} + +- (void) unsetEmail { + [__email release]; + __email = nil; + __email_isset = NO; +} + +- (NSString *) name { + return [[__name retain] autorelease]; +} + +- (void) setName: (NSString *) name { + [name retain]; + [__name release]; + __name = name; + __name_isset = YES; +} + +- (BOOL) nameIsSet { + return __name_isset; +} + +- (void) unsetName { + [__name release]; + __name = nil; + __name_isset = NO; +} + +- (NSString *) timezone { + return [[__timezone retain] autorelease]; +} + +- (void) setTimezone: (NSString *) timezone { + [timezone retain]; + [__timezone release]; + __timezone = timezone; + __timezone_isset = YES; +} + +- (BOOL) timezoneIsSet { + return __timezone_isset; +} + +- (void) unsetTimezone { + [__timezone release]; + __timezone = nil; + __timezone_isset = NO; +} + +- (int) privilege { + return __privilege; +} + +- (void) setPrivilege: (int) privilege { + __privilege = privilege; + __privilege_isset = YES; +} + +- (BOOL) privilegeIsSet { + return __privilege_isset; +} + +- (void) unsetPrivilege { + __privilege_isset = NO; +} + +- (int64_t) created { + return __created; +} + +- (void) setCreated: (int64_t) created { + __created = created; + __created_isset = YES; +} + +- (BOOL) createdIsSet { + return __created_isset; +} + +- (void) unsetCreated { + __created_isset = NO; +} + +- (int64_t) updated { + return __updated; +} + +- (void) setUpdated: (int64_t) updated { + __updated = updated; + __updated_isset = YES; +} + +- (BOOL) updatedIsSet { + return __updated_isset; +} + +- (void) unsetUpdated { + __updated_isset = NO; +} + +- (int64_t) deleted { + return __deleted; +} + +- (void) setDeleted: (int64_t) deleted { + __deleted = deleted; + __deleted_isset = YES; +} + +- (BOOL) deletedIsSet { + return __deleted_isset; +} + +- (void) unsetDeleted { + __deleted_isset = NO; +} + +- (BOOL) active { + return __active; +} + +- (void) setActive: (BOOL) active { + __active = active; + __active_isset = YES; +} + +- (BOOL) activeIsSet { + return __active_isset; +} + +- (void) unsetActive { + __active_isset = NO; +} + +- (NSString *) shardId { + return [[__shardId retain] autorelease]; +} + +- (void) setShardId: (NSString *) shardId { + [shardId retain]; + [__shardId release]; + __shardId = shardId; + __shardId_isset = YES; +} + +- (BOOL) shardIdIsSet { + return __shardId_isset; +} + +- (void) unsetShardId { + [__shardId release]; + __shardId = nil; + __shardId_isset = NO; +} + +- (EDAMUserAttributes *) attributes { + return [[__attributes retain] autorelease]; +} + +- (void) setAttributes: (EDAMUserAttributes *) attributes { + [attributes retain]; + [__attributes release]; + __attributes = attributes; + __attributes_isset = YES; +} + +- (BOOL) attributesIsSet { + return __attributes_isset; +} + +- (void) unsetAttributes { + [__attributes release]; + __attributes = nil; + __attributes_isset = NO; +} + +- (EDAMAccounting *) accounting { + return [[__accounting retain] autorelease]; +} + +- (void) setAccounting: (EDAMAccounting *) accounting { + [accounting retain]; + [__accounting release]; + __accounting = accounting; + __accounting_isset = YES; +} + +- (BOOL) accountingIsSet { + return __accounting_isset; +} + +- (void) unsetAccounting { + [__accounting release]; + __accounting = nil; + __accounting_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setId: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setUsername: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setEmail: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setName: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 6: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setTimezone: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 7: + if (fieldType == TType_I32) { + int fieldValue = [inProtocol readI32]; + [self setPrivilege: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 9: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setCreated: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 10: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setUpdated: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 11: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setDeleted: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 13: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setActive: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 14: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setShardId: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 15: + if (fieldType == TType_STRUCT) { + EDAMUserAttributes *fieldValue = [[EDAMUserAttributes alloc] init]; + [fieldValue read: inProtocol]; + [self setAttributes: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 16: + if (fieldType == TType_STRUCT) { + EDAMAccounting *fieldValue = [[EDAMAccounting alloc] init]; + [fieldValue read: inProtocol]; + [self setAccounting: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"User"]; + if (__id_isset) { + [outProtocol writeFieldBeginWithName: @"id" type: TType_I32 fieldID: 1]; + [outProtocol writeI32: __id]; + [outProtocol writeFieldEnd]; + } + if (__username_isset) { + if (__username != nil) { + [outProtocol writeFieldBeginWithName: @"username" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __username]; + [outProtocol writeFieldEnd]; + } + } + if (__email_isset) { + if (__email != nil) { + [outProtocol writeFieldBeginWithName: @"email" type: TType_STRING fieldID: 3]; + [outProtocol writeString: __email]; + [outProtocol writeFieldEnd]; + } + } + if (__name_isset) { + if (__name != nil) { + [outProtocol writeFieldBeginWithName: @"name" type: TType_STRING fieldID: 4]; + [outProtocol writeString: __name]; + [outProtocol writeFieldEnd]; + } + } + if (__timezone_isset) { + if (__timezone != nil) { + [outProtocol writeFieldBeginWithName: @"timezone" type: TType_STRING fieldID: 6]; + [outProtocol writeString: __timezone]; + [outProtocol writeFieldEnd]; + } + } + if (__privilege_isset) { + [outProtocol writeFieldBeginWithName: @"privilege" type: TType_I32 fieldID: 7]; + [outProtocol writeI32: __privilege]; + [outProtocol writeFieldEnd]; + } + if (__created_isset) { + [outProtocol writeFieldBeginWithName: @"created" type: TType_I64 fieldID: 9]; + [outProtocol writeI64: __created]; + [outProtocol writeFieldEnd]; + } + if (__updated_isset) { + [outProtocol writeFieldBeginWithName: @"updated" type: TType_I64 fieldID: 10]; + [outProtocol writeI64: __updated]; + [outProtocol writeFieldEnd]; + } + if (__deleted_isset) { + [outProtocol writeFieldBeginWithName: @"deleted" type: TType_I64 fieldID: 11]; + [outProtocol writeI64: __deleted]; + [outProtocol writeFieldEnd]; + } + if (__active_isset) { + [outProtocol writeFieldBeginWithName: @"active" type: TType_BOOL fieldID: 13]; + [outProtocol writeBool: __active]; + [outProtocol writeFieldEnd]; + } + if (__shardId_isset) { + if (__shardId != nil) { + [outProtocol writeFieldBeginWithName: @"shardId" type: TType_STRING fieldID: 14]; + [outProtocol writeString: __shardId]; + [outProtocol writeFieldEnd]; + } + } + if (__attributes_isset) { + if (__attributes != nil) { + [outProtocol writeFieldBeginWithName: @"attributes" type: TType_STRUCT fieldID: 15]; + [__attributes write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + if (__accounting_isset) { + if (__accounting != nil) { + [outProtocol writeFieldBeginWithName: @"accounting" type: TType_STRUCT fieldID: 16]; + [__accounting write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"User("]; + [ms appendString: @"id:"]; + [ms appendFormat: @"%i", __id]; + [ms appendString: @",username:"]; + [ms appendFormat: @"\"%@\"", __username]; + [ms appendString: @",email:"]; + [ms appendFormat: @"\"%@\"", __email]; + [ms appendString: @",name:"]; + [ms appendFormat: @"\"%@\"", __name]; + [ms appendString: @",timezone:"]; + [ms appendFormat: @"\"%@\"", __timezone]; + [ms appendString: @",privilege:"]; + [ms appendFormat: @"%i", __privilege]; + [ms appendString: @",created:"]; + [ms appendFormat: @"%qi", __created]; + [ms appendString: @",updated:"]; + [ms appendFormat: @"%qi", __updated]; + [ms appendString: @",deleted:"]; + [ms appendFormat: @"%qi", __deleted]; + [ms appendString: @",active:"]; + [ms appendFormat: @"%i", __active]; + [ms appendString: @",shardId:"]; + [ms appendFormat: @"\"%@\"", __shardId]; + [ms appendString: @",attributes:"]; + [ms appendFormat: @"%@", __attributes]; + [ms appendString: @",accounting:"]; + [ms appendFormat: @"%@", __accounting]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMTag + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic guid; +@dynamic name; +@dynamic parentGuid; +@dynamic updateSequenceNum; +#endif + +- (id) initWithGuid: (EDAMGuid) guid name: (NSString *) name parentGuid: (EDAMGuid) parentGuid updateSequenceNum: (int32_t) updateSequenceNum +{ + self = [super init]; + __guid = [guid retain]; + __guid_isset = YES; + __name = [name retain]; + __name_isset = YES; + __parentGuid = [parentGuid retain]; + __parentGuid_isset = YES; + __updateSequenceNum = updateSequenceNum; + __updateSequenceNum_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + if ([decoder containsValueForKey: @"name"]) + { + __name = [[decoder decodeObjectForKey: @"name"] retain]; + __name_isset = YES; + } + if ([decoder containsValueForKey: @"parentGuid"]) + { + __parentGuid = [[decoder decodeObjectForKey: @"parentGuid"] retain]; + __parentGuid_isset = YES; + } + if ([decoder containsValueForKey: @"updateSequenceNum"]) + { + __updateSequenceNum = [decoder decodeInt32ForKey: @"updateSequenceNum"]; + __updateSequenceNum_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } + if (__name_isset) + { + [encoder encodeObject: __name forKey: @"name"]; + } + if (__parentGuid_isset) + { + [encoder encodeObject: __parentGuid forKey: @"parentGuid"]; + } + if (__updateSequenceNum_isset) + { + [encoder encodeInt32: __updateSequenceNum forKey: @"updateSequenceNum"]; + } +} + +- (void) dealloc +{ + [__guid release]; + [__name release]; + [__parentGuid release]; + [super dealloc]; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (NSString *) name { + return [[__name retain] autorelease]; +} + +- (void) setName: (NSString *) name { + [name retain]; + [__name release]; + __name = name; + __name_isset = YES; +} + +- (BOOL) nameIsSet { + return __name_isset; +} + +- (void) unsetName { + [__name release]; + __name = nil; + __name_isset = NO; +} + +- (NSString *) parentGuid { + return [[__parentGuid retain] autorelease]; +} + +- (void) setParentGuid: (NSString *) parentGuid { + [parentGuid retain]; + [__parentGuid release]; + __parentGuid = parentGuid; + __parentGuid_isset = YES; +} + +- (BOOL) parentGuidIsSet { + return __parentGuid_isset; +} + +- (void) unsetParentGuid { + [__parentGuid release]; + __parentGuid = nil; + __parentGuid_isset = NO; +} + +- (int32_t) updateSequenceNum { + return __updateSequenceNum; +} + +- (void) setUpdateSequenceNum: (int32_t) updateSequenceNum { + __updateSequenceNum = updateSequenceNum; + __updateSequenceNum_isset = YES; +} + +- (BOOL) updateSequenceNumIsSet { + return __updateSequenceNum_isset; +} + +- (void) unsetUpdateSequenceNum { + __updateSequenceNum_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setName: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setParentGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setUpdateSequenceNum: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"Tag"]; + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + if (__name_isset) { + if (__name != nil) { + [outProtocol writeFieldBeginWithName: @"name" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __name]; + [outProtocol writeFieldEnd]; + } + } + if (__parentGuid_isset) { + if (__parentGuid != nil) { + [outProtocol writeFieldBeginWithName: @"parentGuid" type: TType_STRING fieldID: 3]; + [outProtocol writeString: __parentGuid]; + [outProtocol writeFieldEnd]; + } + } + if (__updateSequenceNum_isset) { + [outProtocol writeFieldBeginWithName: @"updateSequenceNum" type: TType_I32 fieldID: 4]; + [outProtocol writeI32: __updateSequenceNum]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"Tag("]; + [ms appendString: @"guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @",name:"]; + [ms appendFormat: @"\"%@\"", __name]; + [ms appendString: @",parentGuid:"]; + [ms appendFormat: @"\"%@\"", __parentGuid]; + [ms appendString: @",updateSequenceNum:"]; + [ms appendFormat: @"%i", __updateSequenceNum]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMResourceAttributes + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic sourceURL; +@dynamic timestamp; +@dynamic latitude; +@dynamic longitude; +@dynamic altitude; +@dynamic cameraMake; +@dynamic cameraModel; +@dynamic clientWillIndex; +@dynamic recoType; +@dynamic fileName; +@dynamic attachment; +#endif + +- (id) initWithSourceURL: (NSString *) sourceURL timestamp: (EDAMTimestamp) timestamp latitude: (double) latitude longitude: (double) longitude altitude: (double) altitude cameraMake: (NSString *) cameraMake cameraModel: (NSString *) cameraModel clientWillIndex: (BOOL) clientWillIndex recoType: (NSString *) recoType fileName: (NSString *) fileName attachment: (BOOL) attachment +{ + self = [super init]; + __sourceURL = [sourceURL retain]; + __sourceURL_isset = YES; + __timestamp = timestamp; + __timestamp_isset = YES; + __latitude = latitude; + __latitude_isset = YES; + __longitude = longitude; + __longitude_isset = YES; + __altitude = altitude; + __altitude_isset = YES; + __cameraMake = [cameraMake retain]; + __cameraMake_isset = YES; + __cameraModel = [cameraModel retain]; + __cameraModel_isset = YES; + __clientWillIndex = clientWillIndex; + __clientWillIndex_isset = YES; + __recoType = [recoType retain]; + __recoType_isset = YES; + __fileName = [fileName retain]; + __fileName_isset = YES; + __attachment = attachment; + __attachment_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"sourceURL"]) + { + __sourceURL = [[decoder decodeObjectForKey: @"sourceURL"] retain]; + __sourceURL_isset = YES; + } + if ([decoder containsValueForKey: @"timestamp"]) + { + __timestamp = [decoder decodeInt64ForKey: @"timestamp"]; + __timestamp_isset = YES; + } + if ([decoder containsValueForKey: @"latitude"]) + { + __latitude = [decoder decodeDoubleForKey: @"latitude"]; + __latitude_isset = YES; + } + if ([decoder containsValueForKey: @"longitude"]) + { + __longitude = [decoder decodeDoubleForKey: @"longitude"]; + __longitude_isset = YES; + } + if ([decoder containsValueForKey: @"altitude"]) + { + __altitude = [decoder decodeDoubleForKey: @"altitude"]; + __altitude_isset = YES; + } + if ([decoder containsValueForKey: @"cameraMake"]) + { + __cameraMake = [[decoder decodeObjectForKey: @"cameraMake"] retain]; + __cameraMake_isset = YES; + } + if ([decoder containsValueForKey: @"cameraModel"]) + { + __cameraModel = [[decoder decodeObjectForKey: @"cameraModel"] retain]; + __cameraModel_isset = YES; + } + if ([decoder containsValueForKey: @"clientWillIndex"]) + { + __clientWillIndex = [decoder decodeBoolForKey: @"clientWillIndex"]; + __clientWillIndex_isset = YES; + } + if ([decoder containsValueForKey: @"recoType"]) + { + __recoType = [[decoder decodeObjectForKey: @"recoType"] retain]; + __recoType_isset = YES; + } + if ([decoder containsValueForKey: @"fileName"]) + { + __fileName = [[decoder decodeObjectForKey: @"fileName"] retain]; + __fileName_isset = YES; + } + if ([decoder containsValueForKey: @"attachment"]) + { + __attachment = [decoder decodeBoolForKey: @"attachment"]; + __attachment_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__sourceURL_isset) + { + [encoder encodeObject: __sourceURL forKey: @"sourceURL"]; + } + if (__timestamp_isset) + { + [encoder encodeInt64: __timestamp forKey: @"timestamp"]; + } + if (__latitude_isset) + { + [encoder encodeDouble: __latitude forKey: @"latitude"]; + } + if (__longitude_isset) + { + [encoder encodeDouble: __longitude forKey: @"longitude"]; + } + if (__altitude_isset) + { + [encoder encodeDouble: __altitude forKey: @"altitude"]; + } + if (__cameraMake_isset) + { + [encoder encodeObject: __cameraMake forKey: @"cameraMake"]; + } + if (__cameraModel_isset) + { + [encoder encodeObject: __cameraModel forKey: @"cameraModel"]; + } + if (__clientWillIndex_isset) + { + [encoder encodeBool: __clientWillIndex forKey: @"clientWillIndex"]; + } + if (__recoType_isset) + { + [encoder encodeObject: __recoType forKey: @"recoType"]; + } + if (__fileName_isset) + { + [encoder encodeObject: __fileName forKey: @"fileName"]; + } + if (__attachment_isset) + { + [encoder encodeBool: __attachment forKey: @"attachment"]; + } +} + +- (void) dealloc +{ + [__sourceURL release]; + [__cameraMake release]; + [__cameraModel release]; + [__recoType release]; + [__fileName release]; + [super dealloc]; +} + +- (NSString *) sourceURL { + return [[__sourceURL retain] autorelease]; +} + +- (void) setSourceURL: (NSString *) sourceURL { + [sourceURL retain]; + [__sourceURL release]; + __sourceURL = sourceURL; + __sourceURL_isset = YES; +} + +- (BOOL) sourceURLIsSet { + return __sourceURL_isset; +} + +- (void) unsetSourceURL { + [__sourceURL release]; + __sourceURL = nil; + __sourceURL_isset = NO; +} + +- (int64_t) timestamp { + return __timestamp; +} + +- (void) setTimestamp: (int64_t) timestamp { + __timestamp = timestamp; + __timestamp_isset = YES; +} + +- (BOOL) timestampIsSet { + return __timestamp_isset; +} + +- (void) unsetTimestamp { + __timestamp_isset = NO; +} + +- (double) latitude { + return __latitude; +} + +- (void) setLatitude: (double) latitude { + __latitude = latitude; + __latitude_isset = YES; +} + +- (BOOL) latitudeIsSet { + return __latitude_isset; +} + +- (void) unsetLatitude { + __latitude_isset = NO; +} + +- (double) longitude { + return __longitude; +} + +- (void) setLongitude: (double) longitude { + __longitude = longitude; + __longitude_isset = YES; +} + +- (BOOL) longitudeIsSet { + return __longitude_isset; +} + +- (void) unsetLongitude { + __longitude_isset = NO; +} + +- (double) altitude { + return __altitude; +} + +- (void) setAltitude: (double) altitude { + __altitude = altitude; + __altitude_isset = YES; +} + +- (BOOL) altitudeIsSet { + return __altitude_isset; +} + +- (void) unsetAltitude { + __altitude_isset = NO; +} + +- (NSString *) cameraMake { + return [[__cameraMake retain] autorelease]; +} + +- (void) setCameraMake: (NSString *) cameraMake { + [cameraMake retain]; + [__cameraMake release]; + __cameraMake = cameraMake; + __cameraMake_isset = YES; +} + +- (BOOL) cameraMakeIsSet { + return __cameraMake_isset; +} + +- (void) unsetCameraMake { + [__cameraMake release]; + __cameraMake = nil; + __cameraMake_isset = NO; +} + +- (NSString *) cameraModel { + return [[__cameraModel retain] autorelease]; +} + +- (void) setCameraModel: (NSString *) cameraModel { + [cameraModel retain]; + [__cameraModel release]; + __cameraModel = cameraModel; + __cameraModel_isset = YES; +} + +- (BOOL) cameraModelIsSet { + return __cameraModel_isset; +} + +- (void) unsetCameraModel { + [__cameraModel release]; + __cameraModel = nil; + __cameraModel_isset = NO; +} + +- (BOOL) clientWillIndex { + return __clientWillIndex; +} + +- (void) setClientWillIndex: (BOOL) clientWillIndex { + __clientWillIndex = clientWillIndex; + __clientWillIndex_isset = YES; +} + +- (BOOL) clientWillIndexIsSet { + return __clientWillIndex_isset; +} + +- (void) unsetClientWillIndex { + __clientWillIndex_isset = NO; +} + +- (NSString *) recoType { + return [[__recoType retain] autorelease]; +} + +- (void) setRecoType: (NSString *) recoType { + [recoType retain]; + [__recoType release]; + __recoType = recoType; + __recoType_isset = YES; +} + +- (BOOL) recoTypeIsSet { + return __recoType_isset; +} + +- (void) unsetRecoType { + [__recoType release]; + __recoType = nil; + __recoType_isset = NO; +} + +- (NSString *) fileName { + return [[__fileName retain] autorelease]; +} + +- (void) setFileName: (NSString *) fileName { + [fileName retain]; + [__fileName release]; + __fileName = fileName; + __fileName_isset = YES; +} + +- (BOOL) fileNameIsSet { + return __fileName_isset; +} + +- (void) unsetFileName { + [__fileName release]; + __fileName = nil; + __fileName_isset = NO; +} + +- (BOOL) attachment { + return __attachment; +} + +- (void) setAttachment: (BOOL) attachment { + __attachment = attachment; + __attachment_isset = YES; +} + +- (BOOL) attachmentIsSet { + return __attachment_isset; +} + +- (void) unsetAttachment { + __attachment_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setSourceURL: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setTimestamp: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_DOUBLE) { + double fieldValue = [inProtocol readDouble]; + [self setLatitude: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_DOUBLE) { + double fieldValue = [inProtocol readDouble]; + [self setLongitude: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 5: + if (fieldType == TType_DOUBLE) { + double fieldValue = [inProtocol readDouble]; + [self setAltitude: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 6: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setCameraMake: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 7: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setCameraModel: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 8: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setClientWillIndex: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 9: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setRecoType: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 10: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setFileName: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 11: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setAttachment: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"ResourceAttributes"]; + if (__sourceURL_isset) { + if (__sourceURL != nil) { + [outProtocol writeFieldBeginWithName: @"sourceURL" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __sourceURL]; + [outProtocol writeFieldEnd]; + } + } + if (__timestamp_isset) { + [outProtocol writeFieldBeginWithName: @"timestamp" type: TType_I64 fieldID: 2]; + [outProtocol writeI64: __timestamp]; + [outProtocol writeFieldEnd]; + } + if (__latitude_isset) { + [outProtocol writeFieldBeginWithName: @"latitude" type: TType_DOUBLE fieldID: 3]; + [outProtocol writeDouble: __latitude]; + [outProtocol writeFieldEnd]; + } + if (__longitude_isset) { + [outProtocol writeFieldBeginWithName: @"longitude" type: TType_DOUBLE fieldID: 4]; + [outProtocol writeDouble: __longitude]; + [outProtocol writeFieldEnd]; + } + if (__altitude_isset) { + [outProtocol writeFieldBeginWithName: @"altitude" type: TType_DOUBLE fieldID: 5]; + [outProtocol writeDouble: __altitude]; + [outProtocol writeFieldEnd]; + } + if (__cameraMake_isset) { + if (__cameraMake != nil) { + [outProtocol writeFieldBeginWithName: @"cameraMake" type: TType_STRING fieldID: 6]; + [outProtocol writeString: __cameraMake]; + [outProtocol writeFieldEnd]; + } + } + if (__cameraModel_isset) { + if (__cameraModel != nil) { + [outProtocol writeFieldBeginWithName: @"cameraModel" type: TType_STRING fieldID: 7]; + [outProtocol writeString: __cameraModel]; + [outProtocol writeFieldEnd]; + } + } + if (__clientWillIndex_isset) { + [outProtocol writeFieldBeginWithName: @"clientWillIndex" type: TType_BOOL fieldID: 8]; + [outProtocol writeBool: __clientWillIndex]; + [outProtocol writeFieldEnd]; + } + if (__recoType_isset) { + if (__recoType != nil) { + [outProtocol writeFieldBeginWithName: @"recoType" type: TType_STRING fieldID: 9]; + [outProtocol writeString: __recoType]; + [outProtocol writeFieldEnd]; + } + } + if (__fileName_isset) { + if (__fileName != nil) { + [outProtocol writeFieldBeginWithName: @"fileName" type: TType_STRING fieldID: 10]; + [outProtocol writeString: __fileName]; + [outProtocol writeFieldEnd]; + } + } + if (__attachment_isset) { + [outProtocol writeFieldBeginWithName: @"attachment" type: TType_BOOL fieldID: 11]; + [outProtocol writeBool: __attachment]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"ResourceAttributes("]; + [ms appendString: @"sourceURL:"]; + [ms appendFormat: @"\"%@\"", __sourceURL]; + [ms appendString: @",timestamp:"]; + [ms appendFormat: @"%qi", __timestamp]; + [ms appendString: @",latitude:"]; + [ms appendFormat: @"%f", __latitude]; + [ms appendString: @",longitude:"]; + [ms appendFormat: @"%f", __longitude]; + [ms appendString: @",altitude:"]; + [ms appendFormat: @"%f", __altitude]; + [ms appendString: @",cameraMake:"]; + [ms appendFormat: @"\"%@\"", __cameraMake]; + [ms appendString: @",cameraModel:"]; + [ms appendFormat: @"\"%@\"", __cameraModel]; + [ms appendString: @",clientWillIndex:"]; + [ms appendFormat: @"%i", __clientWillIndex]; + [ms appendString: @",recoType:"]; + [ms appendFormat: @"\"%@\"", __recoType]; + [ms appendString: @",fileName:"]; + [ms appendFormat: @"\"%@\"", __fileName]; + [ms appendString: @",attachment:"]; + [ms appendFormat: @"%i", __attachment]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMResource + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic guid; +@dynamic noteGuid; +@dynamic data; +@dynamic mime; +@dynamic width; +@dynamic height; +@dynamic duration; +@dynamic active; +@dynamic recognition; +@dynamic attributes; +@dynamic updateSequenceNum; +@dynamic alternateData; +#endif + +- (id) initWithGuid: (EDAMGuid) guid noteGuid: (EDAMGuid) noteGuid data: (EDAMData *) data mime: (NSString *) mime width: (int16_t) width height: (int16_t) height duration: (int16_t) duration active: (BOOL) active recognition: (EDAMData *) recognition attributes: (EDAMResourceAttributes *) attributes updateSequenceNum: (int32_t) updateSequenceNum alternateData: (EDAMData *) alternateData +{ + self = [super init]; + __guid = [guid retain]; + __guid_isset = YES; + __noteGuid = [noteGuid retain]; + __noteGuid_isset = YES; + __data = [data retain]; + __data_isset = YES; + __mime = [mime retain]; + __mime_isset = YES; + __width = width; + __width_isset = YES; + __height = height; + __height_isset = YES; + __duration = duration; + __duration_isset = YES; + __active = active; + __active_isset = YES; + __recognition = [recognition retain]; + __recognition_isset = YES; + __attributes = [attributes retain]; + __attributes_isset = YES; + __updateSequenceNum = updateSequenceNum; + __updateSequenceNum_isset = YES; + __alternateData = [alternateData retain]; + __alternateData_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + if ([decoder containsValueForKey: @"noteGuid"]) + { + __noteGuid = [[decoder decodeObjectForKey: @"noteGuid"] retain]; + __noteGuid_isset = YES; + } + if ([decoder containsValueForKey: @"data"]) + { + __data = [[decoder decodeObjectForKey: @"data"] retain]; + __data_isset = YES; + } + if ([decoder containsValueForKey: @"mime"]) + { + __mime = [[decoder decodeObjectForKey: @"mime"] retain]; + __mime_isset = YES; + } + if ([decoder containsValueForKey: @"width"]) + { + __width = [decoder decodeIntForKey: @"width"]; + __width_isset = YES; + } + if ([decoder containsValueForKey: @"height"]) + { + __height = [decoder decodeIntForKey: @"height"]; + __height_isset = YES; + } + if ([decoder containsValueForKey: @"duration"]) + { + __duration = [decoder decodeIntForKey: @"duration"]; + __duration_isset = YES; + } + if ([decoder containsValueForKey: @"active"]) + { + __active = [decoder decodeBoolForKey: @"active"]; + __active_isset = YES; + } + if ([decoder containsValueForKey: @"recognition"]) + { + __recognition = [[decoder decodeObjectForKey: @"recognition"] retain]; + __recognition_isset = YES; + } + if ([decoder containsValueForKey: @"attributes"]) + { + __attributes = [[decoder decodeObjectForKey: @"attributes"] retain]; + __attributes_isset = YES; + } + if ([decoder containsValueForKey: @"updateSequenceNum"]) + { + __updateSequenceNum = [decoder decodeInt32ForKey: @"updateSequenceNum"]; + __updateSequenceNum_isset = YES; + } + if ([decoder containsValueForKey: @"alternateData"]) + { + __alternateData = [[decoder decodeObjectForKey: @"alternateData"] retain]; + __alternateData_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } + if (__noteGuid_isset) + { + [encoder encodeObject: __noteGuid forKey: @"noteGuid"]; + } + if (__data_isset) + { + [encoder encodeObject: __data forKey: @"data"]; + } + if (__mime_isset) + { + [encoder encodeObject: __mime forKey: @"mime"]; + } + if (__width_isset) + { + [encoder encodeInt: __width forKey: @"width"]; + } + if (__height_isset) + { + [encoder encodeInt: __height forKey: @"height"]; + } + if (__duration_isset) + { + [encoder encodeInt: __duration forKey: @"duration"]; + } + if (__active_isset) + { + [encoder encodeBool: __active forKey: @"active"]; + } + if (__recognition_isset) + { + [encoder encodeObject: __recognition forKey: @"recognition"]; + } + if (__attributes_isset) + { + [encoder encodeObject: __attributes forKey: @"attributes"]; + } + if (__updateSequenceNum_isset) + { + [encoder encodeInt32: __updateSequenceNum forKey: @"updateSequenceNum"]; + } + if (__alternateData_isset) + { + [encoder encodeObject: __alternateData forKey: @"alternateData"]; + } +} + +- (void) dealloc +{ + [__guid release]; + [__noteGuid release]; + [__data release]; + [__mime release]; + [__recognition release]; + [__attributes release]; + [__alternateData release]; + [super dealloc]; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (NSString *) noteGuid { + return [[__noteGuid retain] autorelease]; +} + +- (void) setNoteGuid: (NSString *) noteGuid { + [noteGuid retain]; + [__noteGuid release]; + __noteGuid = noteGuid; + __noteGuid_isset = YES; +} + +- (BOOL) noteGuidIsSet { + return __noteGuid_isset; +} + +- (void) unsetNoteGuid { + [__noteGuid release]; + __noteGuid = nil; + __noteGuid_isset = NO; +} + +- (EDAMData *) data { + return [[__data retain] autorelease]; +} + +- (void) setData: (EDAMData *) data { + [data retain]; + [__data release]; + __data = data; + __data_isset = YES; +} + +- (BOOL) dataIsSet { + return __data_isset; +} + +- (void) unsetData { + [__data release]; + __data = nil; + __data_isset = NO; +} + +- (NSString *) mime { + return [[__mime retain] autorelease]; +} + +- (void) setMime: (NSString *) mime { + [mime retain]; + [__mime release]; + __mime = mime; + __mime_isset = YES; +} + +- (BOOL) mimeIsSet { + return __mime_isset; +} + +- (void) unsetMime { + [__mime release]; + __mime = nil; + __mime_isset = NO; +} + +- (int16_t) width { + return __width; +} + +- (void) setWidth: (int16_t) width { + __width = width; + __width_isset = YES; +} + +- (BOOL) widthIsSet { + return __width_isset; +} + +- (void) unsetWidth { + __width_isset = NO; +} + +- (int16_t) height { + return __height; +} + +- (void) setHeight: (int16_t) height { + __height = height; + __height_isset = YES; +} + +- (BOOL) heightIsSet { + return __height_isset; +} + +- (void) unsetHeight { + __height_isset = NO; +} + +- (int16_t) duration { + return __duration; +} + +- (void) setDuration: (int16_t) duration { + __duration = duration; + __duration_isset = YES; +} + +- (BOOL) durationIsSet { + return __duration_isset; +} + +- (void) unsetDuration { + __duration_isset = NO; +} + +- (BOOL) active { + return __active; +} + +- (void) setActive: (BOOL) active { + __active = active; + __active_isset = YES; +} + +- (BOOL) activeIsSet { + return __active_isset; +} + +- (void) unsetActive { + __active_isset = NO; +} + +- (EDAMData *) recognition { + return [[__recognition retain] autorelease]; +} + +- (void) setRecognition: (EDAMData *) recognition { + [recognition retain]; + [__recognition release]; + __recognition = recognition; + __recognition_isset = YES; +} + +- (BOOL) recognitionIsSet { + return __recognition_isset; +} + +- (void) unsetRecognition { + [__recognition release]; + __recognition = nil; + __recognition_isset = NO; +} + +- (EDAMResourceAttributes *) attributes { + return [[__attributes retain] autorelease]; +} + +- (void) setAttributes: (EDAMResourceAttributes *) attributes { + [attributes retain]; + [__attributes release]; + __attributes = attributes; + __attributes_isset = YES; +} + +- (BOOL) attributesIsSet { + return __attributes_isset; +} + +- (void) unsetAttributes { + [__attributes release]; + __attributes = nil; + __attributes_isset = NO; +} + +- (int32_t) updateSequenceNum { + return __updateSequenceNum; +} + +- (void) setUpdateSequenceNum: (int32_t) updateSequenceNum { + __updateSequenceNum = updateSequenceNum; + __updateSequenceNum_isset = YES; +} + +- (BOOL) updateSequenceNumIsSet { + return __updateSequenceNum_isset; +} + +- (void) unsetUpdateSequenceNum { + __updateSequenceNum_isset = NO; +} + +- (EDAMData *) alternateData { + return [[__alternateData retain] autorelease]; +} + +- (void) setAlternateData: (EDAMData *) alternateData { + [alternateData retain]; + [__alternateData release]; + __alternateData = alternateData; + __alternateData_isset = YES; +} + +- (BOOL) alternateDataIsSet { + return __alternateData_isset; +} + +- (void) unsetAlternateData { + [__alternateData release]; + __alternateData = nil; + __alternateData_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setNoteGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMData *fieldValue = [[EDAMData alloc] init]; + [fieldValue read: inProtocol]; + [self setData: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setMime: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 5: + if (fieldType == TType_I16) { + int16_t fieldValue = [inProtocol readI16]; + [self setWidth: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 6: + if (fieldType == TType_I16) { + int16_t fieldValue = [inProtocol readI16]; + [self setHeight: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 7: + if (fieldType == TType_I16) { + int16_t fieldValue = [inProtocol readI16]; + [self setDuration: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 8: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setActive: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 9: + if (fieldType == TType_STRUCT) { + EDAMData *fieldValue = [[EDAMData alloc] init]; + [fieldValue read: inProtocol]; + [self setRecognition: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 11: + if (fieldType == TType_STRUCT) { + EDAMResourceAttributes *fieldValue = [[EDAMResourceAttributes alloc] init]; + [fieldValue read: inProtocol]; + [self setAttributes: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 12: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setUpdateSequenceNum: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 13: + if (fieldType == TType_STRUCT) { + EDAMData *fieldValue = [[EDAMData alloc] init]; + [fieldValue read: inProtocol]; + [self setAlternateData: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"Resource"]; + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + if (__noteGuid_isset) { + if (__noteGuid != nil) { + [outProtocol writeFieldBeginWithName: @"noteGuid" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __noteGuid]; + [outProtocol writeFieldEnd]; + } + } + if (__data_isset) { + if (__data != nil) { + [outProtocol writeFieldBeginWithName: @"data" type: TType_STRUCT fieldID: 3]; + [__data write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + if (__mime_isset) { + if (__mime != nil) { + [outProtocol writeFieldBeginWithName: @"mime" type: TType_STRING fieldID: 4]; + [outProtocol writeString: __mime]; + [outProtocol writeFieldEnd]; + } + } + if (__width_isset) { + [outProtocol writeFieldBeginWithName: @"width" type: TType_I16 fieldID: 5]; + [outProtocol writeI16: __width]; + [outProtocol writeFieldEnd]; + } + if (__height_isset) { + [outProtocol writeFieldBeginWithName: @"height" type: TType_I16 fieldID: 6]; + [outProtocol writeI16: __height]; + [outProtocol writeFieldEnd]; + } + if (__duration_isset) { + [outProtocol writeFieldBeginWithName: @"duration" type: TType_I16 fieldID: 7]; + [outProtocol writeI16: __duration]; + [outProtocol writeFieldEnd]; + } + if (__active_isset) { + [outProtocol writeFieldBeginWithName: @"active" type: TType_BOOL fieldID: 8]; + [outProtocol writeBool: __active]; + [outProtocol writeFieldEnd]; + } + if (__recognition_isset) { + if (__recognition != nil) { + [outProtocol writeFieldBeginWithName: @"recognition" type: TType_STRUCT fieldID: 9]; + [__recognition write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + if (__attributes_isset) { + if (__attributes != nil) { + [outProtocol writeFieldBeginWithName: @"attributes" type: TType_STRUCT fieldID: 11]; + [__attributes write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + if (__updateSequenceNum_isset) { + [outProtocol writeFieldBeginWithName: @"updateSequenceNum" type: TType_I32 fieldID: 12]; + [outProtocol writeI32: __updateSequenceNum]; + [outProtocol writeFieldEnd]; + } + if (__alternateData_isset) { + if (__alternateData != nil) { + [outProtocol writeFieldBeginWithName: @"alternateData" type: TType_STRUCT fieldID: 13]; + [__alternateData write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"Resource("]; + [ms appendString: @"guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @",noteGuid:"]; + [ms appendFormat: @"\"%@\"", __noteGuid]; + [ms appendString: @",data:"]; + [ms appendFormat: @"%@", __data]; + [ms appendString: @",mime:"]; + [ms appendFormat: @"\"%@\"", __mime]; + [ms appendString: @",width:"]; + [ms appendFormat: @"%hi", __width]; + [ms appendString: @",height:"]; + [ms appendFormat: @"%hi", __height]; + [ms appendString: @",duration:"]; + [ms appendFormat: @"%hi", __duration]; + [ms appendString: @",active:"]; + [ms appendFormat: @"%i", __active]; + [ms appendString: @",recognition:"]; + [ms appendFormat: @"%@", __recognition]; + [ms appendString: @",attributes:"]; + [ms appendFormat: @"%@", __attributes]; + [ms appendString: @",updateSequenceNum:"]; + [ms appendFormat: @"%i", __updateSequenceNum]; + [ms appendString: @",alternateData:"]; + [ms appendFormat: @"%@", __alternateData]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMNoteAttributes + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic subjectDate; +@dynamic latitude; +@dynamic longitude; +@dynamic altitude; +@dynamic author; +@dynamic source; +@dynamic sourceURL; +@dynamic sourceApplication; +#endif + +- (id) initWithSubjectDate: (EDAMTimestamp) subjectDate latitude: (double) latitude longitude: (double) longitude altitude: (double) altitude author: (NSString *) author source: (NSString *) source sourceURL: (NSString *) sourceURL sourceApplication: (NSString *) sourceApplication +{ + self = [super init]; + __subjectDate = subjectDate; + __subjectDate_isset = YES; + __latitude = latitude; + __latitude_isset = YES; + __longitude = longitude; + __longitude_isset = YES; + __altitude = altitude; + __altitude_isset = YES; + __author = [author retain]; + __author_isset = YES; + __source = [source retain]; + __source_isset = YES; + __sourceURL = [sourceURL retain]; + __sourceURL_isset = YES; + __sourceApplication = [sourceApplication retain]; + __sourceApplication_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"subjectDate"]) + { + __subjectDate = [decoder decodeInt64ForKey: @"subjectDate"]; + __subjectDate_isset = YES; + } + if ([decoder containsValueForKey: @"latitude"]) + { + __latitude = [decoder decodeDoubleForKey: @"latitude"]; + __latitude_isset = YES; + } + if ([decoder containsValueForKey: @"longitude"]) + { + __longitude = [decoder decodeDoubleForKey: @"longitude"]; + __longitude_isset = YES; + } + if ([decoder containsValueForKey: @"altitude"]) + { + __altitude = [decoder decodeDoubleForKey: @"altitude"]; + __altitude_isset = YES; + } + if ([decoder containsValueForKey: @"author"]) + { + __author = [[decoder decodeObjectForKey: @"author"] retain]; + __author_isset = YES; + } + if ([decoder containsValueForKey: @"source"]) + { + __source = [[decoder decodeObjectForKey: @"source"] retain]; + __source_isset = YES; + } + if ([decoder containsValueForKey: @"sourceURL"]) + { + __sourceURL = [[decoder decodeObjectForKey: @"sourceURL"] retain]; + __sourceURL_isset = YES; + } + if ([decoder containsValueForKey: @"sourceApplication"]) + { + __sourceApplication = [[decoder decodeObjectForKey: @"sourceApplication"] retain]; + __sourceApplication_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__subjectDate_isset) + { + [encoder encodeInt64: __subjectDate forKey: @"subjectDate"]; + } + if (__latitude_isset) + { + [encoder encodeDouble: __latitude forKey: @"latitude"]; + } + if (__longitude_isset) + { + [encoder encodeDouble: __longitude forKey: @"longitude"]; + } + if (__altitude_isset) + { + [encoder encodeDouble: __altitude forKey: @"altitude"]; + } + if (__author_isset) + { + [encoder encodeObject: __author forKey: @"author"]; + } + if (__source_isset) + { + [encoder encodeObject: __source forKey: @"source"]; + } + if (__sourceURL_isset) + { + [encoder encodeObject: __sourceURL forKey: @"sourceURL"]; + } + if (__sourceApplication_isset) + { + [encoder encodeObject: __sourceApplication forKey: @"sourceApplication"]; + } +} + +- (void) dealloc +{ + [__author release]; + [__source release]; + [__sourceURL release]; + [__sourceApplication release]; + [super dealloc]; +} + +- (int64_t) subjectDate { + return __subjectDate; +} + +- (void) setSubjectDate: (int64_t) subjectDate { + __subjectDate = subjectDate; + __subjectDate_isset = YES; +} + +- (BOOL) subjectDateIsSet { + return __subjectDate_isset; +} + +- (void) unsetSubjectDate { + __subjectDate_isset = NO; +} + +- (double) latitude { + return __latitude; +} + +- (void) setLatitude: (double) latitude { + __latitude = latitude; + __latitude_isset = YES; +} + +- (BOOL) latitudeIsSet { + return __latitude_isset; +} + +- (void) unsetLatitude { + __latitude_isset = NO; +} + +- (double) longitude { + return __longitude; +} + +- (void) setLongitude: (double) longitude { + __longitude = longitude; + __longitude_isset = YES; +} + +- (BOOL) longitudeIsSet { + return __longitude_isset; +} + +- (void) unsetLongitude { + __longitude_isset = NO; +} + +- (double) altitude { + return __altitude; +} + +- (void) setAltitude: (double) altitude { + __altitude = altitude; + __altitude_isset = YES; +} + +- (BOOL) altitudeIsSet { + return __altitude_isset; +} + +- (void) unsetAltitude { + __altitude_isset = NO; +} + +- (NSString *) author { + return [[__author retain] autorelease]; +} + +- (void) setAuthor: (NSString *) author { + [author retain]; + [__author release]; + __author = author; + __author_isset = YES; +} + +- (BOOL) authorIsSet { + return __author_isset; +} + +- (void) unsetAuthor { + [__author release]; + __author = nil; + __author_isset = NO; +} + +- (NSString *) source { + return [[__source retain] autorelease]; +} + +- (void) setSource: (NSString *) source { + [source retain]; + [__source release]; + __source = source; + __source_isset = YES; +} + +- (BOOL) sourceIsSet { + return __source_isset; +} + +- (void) unsetSource { + [__source release]; + __source = nil; + __source_isset = NO; +} + +- (NSString *) sourceURL { + return [[__sourceURL retain] autorelease]; +} + +- (void) setSourceURL: (NSString *) sourceURL { + [sourceURL retain]; + [__sourceURL release]; + __sourceURL = sourceURL; + __sourceURL_isset = YES; +} + +- (BOOL) sourceURLIsSet { + return __sourceURL_isset; +} + +- (void) unsetSourceURL { + [__sourceURL release]; + __sourceURL = nil; + __sourceURL_isset = NO; +} + +- (NSString *) sourceApplication { + return [[__sourceApplication retain] autorelease]; +} + +- (void) setSourceApplication: (NSString *) sourceApplication { + [sourceApplication retain]; + [__sourceApplication release]; + __sourceApplication = sourceApplication; + __sourceApplication_isset = YES; +} + +- (BOOL) sourceApplicationIsSet { + return __sourceApplication_isset; +} + +- (void) unsetSourceApplication { + [__sourceApplication release]; + __sourceApplication = nil; + __sourceApplication_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setSubjectDate: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 10: + if (fieldType == TType_DOUBLE) { + double fieldValue = [inProtocol readDouble]; + [self setLatitude: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 11: + if (fieldType == TType_DOUBLE) { + double fieldValue = [inProtocol readDouble]; + [self setLongitude: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 12: + if (fieldType == TType_DOUBLE) { + double fieldValue = [inProtocol readDouble]; + [self setAltitude: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 13: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthor: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 14: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setSource: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 15: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setSourceURL: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 16: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setSourceApplication: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"NoteAttributes"]; + if (__subjectDate_isset) { + [outProtocol writeFieldBeginWithName: @"subjectDate" type: TType_I64 fieldID: 1]; + [outProtocol writeI64: __subjectDate]; + [outProtocol writeFieldEnd]; + } + if (__latitude_isset) { + [outProtocol writeFieldBeginWithName: @"latitude" type: TType_DOUBLE fieldID: 10]; + [outProtocol writeDouble: __latitude]; + [outProtocol writeFieldEnd]; + } + if (__longitude_isset) { + [outProtocol writeFieldBeginWithName: @"longitude" type: TType_DOUBLE fieldID: 11]; + [outProtocol writeDouble: __longitude]; + [outProtocol writeFieldEnd]; + } + if (__altitude_isset) { + [outProtocol writeFieldBeginWithName: @"altitude" type: TType_DOUBLE fieldID: 12]; + [outProtocol writeDouble: __altitude]; + [outProtocol writeFieldEnd]; + } + if (__author_isset) { + if (__author != nil) { + [outProtocol writeFieldBeginWithName: @"author" type: TType_STRING fieldID: 13]; + [outProtocol writeString: __author]; + [outProtocol writeFieldEnd]; + } + } + if (__source_isset) { + if (__source != nil) { + [outProtocol writeFieldBeginWithName: @"source" type: TType_STRING fieldID: 14]; + [outProtocol writeString: __source]; + [outProtocol writeFieldEnd]; + } + } + if (__sourceURL_isset) { + if (__sourceURL != nil) { + [outProtocol writeFieldBeginWithName: @"sourceURL" type: TType_STRING fieldID: 15]; + [outProtocol writeString: __sourceURL]; + [outProtocol writeFieldEnd]; + } + } + if (__sourceApplication_isset) { + if (__sourceApplication != nil) { + [outProtocol writeFieldBeginWithName: @"sourceApplication" type: TType_STRING fieldID: 16]; + [outProtocol writeString: __sourceApplication]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"NoteAttributes("]; + [ms appendString: @"subjectDate:"]; + [ms appendFormat: @"%qi", __subjectDate]; + [ms appendString: @",latitude:"]; + [ms appendFormat: @"%f", __latitude]; + [ms appendString: @",longitude:"]; + [ms appendFormat: @"%f", __longitude]; + [ms appendString: @",altitude:"]; + [ms appendFormat: @"%f", __altitude]; + [ms appendString: @",author:"]; + [ms appendFormat: @"\"%@\"", __author]; + [ms appendString: @",source:"]; + [ms appendFormat: @"\"%@\"", __source]; + [ms appendString: @",sourceURL:"]; + [ms appendFormat: @"\"%@\"", __sourceURL]; + [ms appendString: @",sourceApplication:"]; + [ms appendFormat: @"\"%@\"", __sourceApplication]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMNote + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic guid; +@dynamic title; +@dynamic content; +@dynamic contentHash; +@dynamic contentLength; +@dynamic created; +@dynamic updated; +@dynamic deleted; +@dynamic active; +@dynamic updateSequenceNum; +@dynamic notebookGuid; +@dynamic tagGuids; +@dynamic resources; +@dynamic attributes; +@dynamic tagNames; +#endif + +- (id) initWithGuid: (EDAMGuid) guid title: (NSString *) title content: (NSString *) content contentHash: (NSData *) contentHash contentLength: (int32_t) contentLength created: (EDAMTimestamp) created updated: (EDAMTimestamp) updated deleted: (EDAMTimestamp) deleted active: (BOOL) active updateSequenceNum: (int32_t) updateSequenceNum notebookGuid: (NSString *) notebookGuid tagGuids: (NSArray *) tagGuids resources: (NSArray *) resources attributes: (EDAMNoteAttributes *) attributes tagNames: (NSArray *) tagNames +{ + self = [super init]; + __guid = [guid retain]; + __guid_isset = YES; + __title = [title retain]; + __title_isset = YES; + __content = [content retain]; + __content_isset = YES; + __contentHash = [contentHash retain]; + __contentHash_isset = YES; + __contentLength = contentLength; + __contentLength_isset = YES; + __created = created; + __created_isset = YES; + __updated = updated; + __updated_isset = YES; + __deleted = deleted; + __deleted_isset = YES; + __active = active; + __active_isset = YES; + __updateSequenceNum = updateSequenceNum; + __updateSequenceNum_isset = YES; + __notebookGuid = [notebookGuid retain]; + __notebookGuid_isset = YES; + __tagGuids = [tagGuids retain]; + __tagGuids_isset = YES; + __resources = [resources retain]; + __resources_isset = YES; + __attributes = [attributes retain]; + __attributes_isset = YES; + __tagNames = [tagNames retain]; + __tagNames_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + if ([decoder containsValueForKey: @"title"]) + { + __title = [[decoder decodeObjectForKey: @"title"] retain]; + __title_isset = YES; + } + if ([decoder containsValueForKey: @"content"]) + { + __content = [[decoder decodeObjectForKey: @"content"] retain]; + __content_isset = YES; + } + if ([decoder containsValueForKey: @"contentHash"]) + { + __contentHash = [[decoder decodeObjectForKey: @"contentHash"] retain]; + __contentHash_isset = YES; + } + if ([decoder containsValueForKey: @"contentLength"]) + { + __contentLength = [decoder decodeInt32ForKey: @"contentLength"]; + __contentLength_isset = YES; + } + if ([decoder containsValueForKey: @"created"]) + { + __created = [decoder decodeInt64ForKey: @"created"]; + __created_isset = YES; + } + if ([decoder containsValueForKey: @"updated"]) + { + __updated = [decoder decodeInt64ForKey: @"updated"]; + __updated_isset = YES; + } + if ([decoder containsValueForKey: @"deleted"]) + { + __deleted = [decoder decodeInt64ForKey: @"deleted"]; + __deleted_isset = YES; + } + if ([decoder containsValueForKey: @"active"]) + { + __active = [decoder decodeBoolForKey: @"active"]; + __active_isset = YES; + } + if ([decoder containsValueForKey: @"updateSequenceNum"]) + { + __updateSequenceNum = [decoder decodeInt32ForKey: @"updateSequenceNum"]; + __updateSequenceNum_isset = YES; + } + if ([decoder containsValueForKey: @"notebookGuid"]) + { + __notebookGuid = [[decoder decodeObjectForKey: @"notebookGuid"] retain]; + __notebookGuid_isset = YES; + } + if ([decoder containsValueForKey: @"tagGuids"]) + { + __tagGuids = [[decoder decodeObjectForKey: @"tagGuids"] retain]; + __tagGuids_isset = YES; + } + if ([decoder containsValueForKey: @"resources"]) + { + __resources = [[decoder decodeObjectForKey: @"resources"] retain]; + __resources_isset = YES; + } + if ([decoder containsValueForKey: @"attributes"]) + { + __attributes = [[decoder decodeObjectForKey: @"attributes"] retain]; + __attributes_isset = YES; + } + if ([decoder containsValueForKey: @"tagNames"]) + { + __tagNames = [[decoder decodeObjectForKey: @"tagNames"] retain]; + __tagNames_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } + if (__title_isset) + { + [encoder encodeObject: __title forKey: @"title"]; + } + if (__content_isset) + { + [encoder encodeObject: __content forKey: @"content"]; + } + if (__contentHash_isset) + { + [encoder encodeObject: __contentHash forKey: @"contentHash"]; + } + if (__contentLength_isset) + { + [encoder encodeInt32: __contentLength forKey: @"contentLength"]; + } + if (__created_isset) + { + [encoder encodeInt64: __created forKey: @"created"]; + } + if (__updated_isset) + { + [encoder encodeInt64: __updated forKey: @"updated"]; + } + if (__deleted_isset) + { + [encoder encodeInt64: __deleted forKey: @"deleted"]; + } + if (__active_isset) + { + [encoder encodeBool: __active forKey: @"active"]; + } + if (__updateSequenceNum_isset) + { + [encoder encodeInt32: __updateSequenceNum forKey: @"updateSequenceNum"]; + } + if (__notebookGuid_isset) + { + [encoder encodeObject: __notebookGuid forKey: @"notebookGuid"]; + } + if (__tagGuids_isset) + { + [encoder encodeObject: __tagGuids forKey: @"tagGuids"]; + } + if (__resources_isset) + { + [encoder encodeObject: __resources forKey: @"resources"]; + } + if (__attributes_isset) + { + [encoder encodeObject: __attributes forKey: @"attributes"]; + } + if (__tagNames_isset) + { + [encoder encodeObject: __tagNames forKey: @"tagNames"]; + } +} + +- (void) dealloc +{ + [__guid release]; + [__title release]; + [__content release]; + [__contentHash release]; + [__notebookGuid release]; + [__tagGuids release]; + [__resources release]; + [__attributes release]; + [__tagNames release]; + [super dealloc]; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (NSString *) title { + return [[__title retain] autorelease]; +} + +- (void) setTitle: (NSString *) title { + [title retain]; + [__title release]; + __title = title; + __title_isset = YES; +} + +- (BOOL) titleIsSet { + return __title_isset; +} + +- (void) unsetTitle { + [__title release]; + __title = nil; + __title_isset = NO; +} + +- (NSString *) content { + return [[__content retain] autorelease]; +} + +- (void) setContent: (NSString *) content { + [content retain]; + [__content release]; + __content = content; + __content_isset = YES; +} + +- (BOOL) contentIsSet { + return __content_isset; +} + +- (void) unsetContent { + [__content release]; + __content = nil; + __content_isset = NO; +} + +- (NSData *) contentHash { + return [[__contentHash retain] autorelease]; +} + +- (void) setContentHash: (NSData *) contentHash { + [contentHash retain]; + [__contentHash release]; + __contentHash = contentHash; + __contentHash_isset = YES; +} + +- (BOOL) contentHashIsSet { + return __contentHash_isset; +} + +- (void) unsetContentHash { + [__contentHash release]; + __contentHash = nil; + __contentHash_isset = NO; +} + +- (int32_t) contentLength { + return __contentLength; +} + +- (void) setContentLength: (int32_t) contentLength { + __contentLength = contentLength; + __contentLength_isset = YES; +} + +- (BOOL) contentLengthIsSet { + return __contentLength_isset; +} + +- (void) unsetContentLength { + __contentLength_isset = NO; +} + +- (int64_t) created { + return __created; +} + +- (void) setCreated: (int64_t) created { + __created = created; + __created_isset = YES; +} + +- (BOOL) createdIsSet { + return __created_isset; +} + +- (void) unsetCreated { + __created_isset = NO; +} + +- (int64_t) updated { + return __updated; +} + +- (void) setUpdated: (int64_t) updated { + __updated = updated; + __updated_isset = YES; +} + +- (BOOL) updatedIsSet { + return __updated_isset; +} + +- (void) unsetUpdated { + __updated_isset = NO; +} + +- (int64_t) deleted { + return __deleted; +} + +- (void) setDeleted: (int64_t) deleted { + __deleted = deleted; + __deleted_isset = YES; +} + +- (BOOL) deletedIsSet { + return __deleted_isset; +} + +- (void) unsetDeleted { + __deleted_isset = NO; +} + +- (BOOL) active { + return __active; +} + +- (void) setActive: (BOOL) active { + __active = active; + __active_isset = YES; +} + +- (BOOL) activeIsSet { + return __active_isset; +} + +- (void) unsetActive { + __active_isset = NO; +} + +- (int32_t) updateSequenceNum { + return __updateSequenceNum; +} + +- (void) setUpdateSequenceNum: (int32_t) updateSequenceNum { + __updateSequenceNum = updateSequenceNum; + __updateSequenceNum_isset = YES; +} + +- (BOOL) updateSequenceNumIsSet { + return __updateSequenceNum_isset; +} + +- (void) unsetUpdateSequenceNum { + __updateSequenceNum_isset = NO; +} + +- (NSString *) notebookGuid { + return [[__notebookGuid retain] autorelease]; +} + +- (void) setNotebookGuid: (NSString *) notebookGuid { + [notebookGuid retain]; + [__notebookGuid release]; + __notebookGuid = notebookGuid; + __notebookGuid_isset = YES; +} + +- (BOOL) notebookGuidIsSet { + return __notebookGuid_isset; +} + +- (void) unsetNotebookGuid { + [__notebookGuid release]; + __notebookGuid = nil; + __notebookGuid_isset = NO; +} + +- (NSArray *) tagGuids { + return [[__tagGuids retain] autorelease]; +} + +- (void) setTagGuids: (NSArray *) tagGuids { + [tagGuids retain]; + [__tagGuids release]; + __tagGuids = tagGuids; + __tagGuids_isset = YES; +} + +- (BOOL) tagGuidsIsSet { + return __tagGuids_isset; +} + +- (void) unsetTagGuids { + [__tagGuids release]; + __tagGuids = nil; + __tagGuids_isset = NO; +} + +- (NSArray *) resources { + return [[__resources retain] autorelease]; +} + +- (void) setResources: (NSArray *) resources { + [resources retain]; + [__resources release]; + __resources = resources; + __resources_isset = YES; +} + +- (BOOL) resourcesIsSet { + return __resources_isset; +} + +- (void) unsetResources { + [__resources release]; + __resources = nil; + __resources_isset = NO; +} + +- (EDAMNoteAttributes *) attributes { + return [[__attributes retain] autorelease]; +} + +- (void) setAttributes: (EDAMNoteAttributes *) attributes { + [attributes retain]; + [__attributes release]; + __attributes = attributes; + __attributes_isset = YES; +} + +- (BOOL) attributesIsSet { + return __attributes_isset; +} + +- (void) unsetAttributes { + [__attributes release]; + __attributes = nil; + __attributes_isset = NO; +} + +- (NSArray *) tagNames { + return [[__tagNames retain] autorelease]; +} + +- (void) setTagNames: (NSArray *) tagNames { + [tagNames retain]; + [__tagNames release]; + __tagNames = tagNames; + __tagNames_isset = YES; +} + +- (BOOL) tagNamesIsSet { + return __tagNames_isset; +} + +- (void) unsetTagNames { + [__tagNames release]; + __tagNames = nil; + __tagNames_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setTitle: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setContent: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_STRING) { + NSData * fieldValue = [inProtocol readBinary]; + [self setContentHash: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 5: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setContentLength: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 6: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setCreated: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 7: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setUpdated: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 8: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setDeleted: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 9: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setActive: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 10: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setUpdateSequenceNum: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 11: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setNotebookGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 12: + if (fieldType == TType_LIST) { + int _size10; + [inProtocol readListBeginReturningElementType: NULL size: &_size10]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size10]; + int _i11; + for (_i11 = 0; _i11 < _size10; ++_i11) + { + NSString * _elem12 = [inProtocol readString]; + [fieldValue addObject: _elem12]; + } + [inProtocol readListEnd]; + [self setTagGuids: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 13: + if (fieldType == TType_LIST) { + int _size13; + [inProtocol readListBeginReturningElementType: NULL size: &_size13]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size13]; + int _i14; + for (_i14 = 0; _i14 < _size13; ++_i14) + { + EDAMResource *_elem15 = [[EDAMResource alloc] init]; + [_elem15 read: inProtocol]; + [fieldValue addObject: _elem15]; + [_elem15 release]; + } + [inProtocol readListEnd]; + [self setResources: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 14: + if (fieldType == TType_STRUCT) { + EDAMNoteAttributes *fieldValue = [[EDAMNoteAttributes alloc] init]; + [fieldValue read: inProtocol]; + [self setAttributes: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 15: + if (fieldType == TType_LIST) { + int _size16; + [inProtocol readListBeginReturningElementType: NULL size: &_size16]; + NSMutableArray * fieldValue = [[NSMutableArray alloc] initWithCapacity: _size16]; + int _i17; + for (_i17 = 0; _i17 < _size16; ++_i17) + { + NSString * _elem18 = [inProtocol readString]; + [fieldValue addObject: _elem18]; + } + [inProtocol readListEnd]; + [self setTagNames: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"Note"]; + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + if (__title_isset) { + if (__title != nil) { + [outProtocol writeFieldBeginWithName: @"title" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __title]; + [outProtocol writeFieldEnd]; + } + } + if (__content_isset) { + if (__content != nil) { + [outProtocol writeFieldBeginWithName: @"content" type: TType_STRING fieldID: 3]; + [outProtocol writeString: __content]; + [outProtocol writeFieldEnd]; + } + } + if (__contentHash_isset) { + if (__contentHash != nil) { + [outProtocol writeFieldBeginWithName: @"contentHash" type: TType_STRING fieldID: 4]; + [outProtocol writeBinary: __contentHash]; + [outProtocol writeFieldEnd]; + } + } + if (__contentLength_isset) { + [outProtocol writeFieldBeginWithName: @"contentLength" type: TType_I32 fieldID: 5]; + [outProtocol writeI32: __contentLength]; + [outProtocol writeFieldEnd]; + } + if (__created_isset) { + [outProtocol writeFieldBeginWithName: @"created" type: TType_I64 fieldID: 6]; + [outProtocol writeI64: __created]; + [outProtocol writeFieldEnd]; + } + if (__updated_isset) { + [outProtocol writeFieldBeginWithName: @"updated" type: TType_I64 fieldID: 7]; + [outProtocol writeI64: __updated]; + [outProtocol writeFieldEnd]; + } + if (__deleted_isset) { + [outProtocol writeFieldBeginWithName: @"deleted" type: TType_I64 fieldID: 8]; + [outProtocol writeI64: __deleted]; + [outProtocol writeFieldEnd]; + } + if (__active_isset) { + [outProtocol writeFieldBeginWithName: @"active" type: TType_BOOL fieldID: 9]; + [outProtocol writeBool: __active]; + [outProtocol writeFieldEnd]; + } + if (__updateSequenceNum_isset) { + [outProtocol writeFieldBeginWithName: @"updateSequenceNum" type: TType_I32 fieldID: 10]; + [outProtocol writeI32: __updateSequenceNum]; + [outProtocol writeFieldEnd]; + } + if (__notebookGuid_isset) { + if (__notebookGuid != nil) { + [outProtocol writeFieldBeginWithName: @"notebookGuid" type: TType_STRING fieldID: 11]; + [outProtocol writeString: __notebookGuid]; + [outProtocol writeFieldEnd]; + } + } + if (__tagGuids_isset) { + if (__tagGuids != nil) { + [outProtocol writeFieldBeginWithName: @"tagGuids" type: TType_LIST fieldID: 12]; + { + [outProtocol writeListBeginWithElementType: TType_STRING size: [__tagGuids count]]; + int i20; + for (i20 = 0; i20 < [__tagGuids count]; i20++) + { + [outProtocol writeString: [__tagGuids objectAtIndex: i20]]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + if (__resources_isset) { + if (__resources != nil) { + [outProtocol writeFieldBeginWithName: @"resources" type: TType_LIST fieldID: 13]; + { + [outProtocol writeListBeginWithElementType: TType_STRUCT size: [__resources count]]; + int i22; + for (i22 = 0; i22 < [__resources count]; i22++) + { + [[__resources objectAtIndex: i22] write: outProtocol]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + if (__attributes_isset) { + if (__attributes != nil) { + [outProtocol writeFieldBeginWithName: @"attributes" type: TType_STRUCT fieldID: 14]; + [__attributes write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + if (__tagNames_isset) { + if (__tagNames != nil) { + [outProtocol writeFieldBeginWithName: @"tagNames" type: TType_LIST fieldID: 15]; + { + [outProtocol writeListBeginWithElementType: TType_STRING size: [__tagNames count]]; + int i24; + for (i24 = 0; i24 < [__tagNames count]; i24++) + { + [outProtocol writeString: [__tagNames objectAtIndex: i24]]; + } + [outProtocol writeListEnd]; + } + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"Note("]; + [ms appendString: @"guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @",title:"]; + [ms appendFormat: @"\"%@\"", __title]; + [ms appendString: @",content:"]; + [ms appendFormat: @"\"%@\"", __content]; + [ms appendString: @",contentHash:"]; + [ms appendFormat: @"\"%@\"", __contentHash]; + [ms appendString: @",contentLength:"]; + [ms appendFormat: @"%i", __contentLength]; + [ms appendString: @",created:"]; + [ms appendFormat: @"%qi", __created]; + [ms appendString: @",updated:"]; + [ms appendFormat: @"%qi", __updated]; + [ms appendString: @",deleted:"]; + [ms appendFormat: @"%qi", __deleted]; + [ms appendString: @",active:"]; + [ms appendFormat: @"%i", __active]; + [ms appendString: @",updateSequenceNum:"]; + [ms appendFormat: @"%i", __updateSequenceNum]; + [ms appendString: @",notebookGuid:"]; + [ms appendFormat: @"\"%@\"", __notebookGuid]; + [ms appendString: @",tagGuids:"]; + [ms appendFormat: @"%@", __tagGuids]; + [ms appendString: @",resources:"]; + [ms appendFormat: @"%@", __resources]; + [ms appendString: @",attributes:"]; + [ms appendFormat: @"%@", __attributes]; + [ms appendString: @",tagNames:"]; + [ms appendFormat: @"%@", __tagNames]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMPublishing + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic uri; +@dynamic order; +@dynamic ascending; +@dynamic publicDescription; +#endif + +- (id) initWithUri: (NSString *) uri order: (int) order ascending: (BOOL) ascending publicDescription: (NSString *) publicDescription +{ + self = [super init]; + __uri = [uri retain]; + __uri_isset = YES; + __order = order; + __order_isset = YES; + __ascending = ascending; + __ascending_isset = YES; + __publicDescription = [publicDescription retain]; + __publicDescription_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"uri"]) + { + __uri = [[decoder decodeObjectForKey: @"uri"] retain]; + __uri_isset = YES; + } + if ([decoder containsValueForKey: @"order"]) + { + __order = [decoder decodeIntForKey: @"order"]; + __order_isset = YES; + } + if ([decoder containsValueForKey: @"ascending"]) + { + __ascending = [decoder decodeBoolForKey: @"ascending"]; + __ascending_isset = YES; + } + if ([decoder containsValueForKey: @"publicDescription"]) + { + __publicDescription = [[decoder decodeObjectForKey: @"publicDescription"] retain]; + __publicDescription_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__uri_isset) + { + [encoder encodeObject: __uri forKey: @"uri"]; + } + if (__order_isset) + { + [encoder encodeInt: __order forKey: @"order"]; + } + if (__ascending_isset) + { + [encoder encodeBool: __ascending forKey: @"ascending"]; + } + if (__publicDescription_isset) + { + [encoder encodeObject: __publicDescription forKey: @"publicDescription"]; + } +} + +- (void) dealloc +{ + [__uri release]; + [__publicDescription release]; + [super dealloc]; +} + +- (NSString *) uri { + return [[__uri retain] autorelease]; +} + +- (void) setUri: (NSString *) uri { + [uri retain]; + [__uri release]; + __uri = uri; + __uri_isset = YES; +} + +- (BOOL) uriIsSet { + return __uri_isset; +} + +- (void) unsetUri { + [__uri release]; + __uri = nil; + __uri_isset = NO; +} + +- (int) order { + return __order; +} + +- (void) setOrder: (int) order { + __order = order; + __order_isset = YES; +} + +- (BOOL) orderIsSet { + return __order_isset; +} + +- (void) unsetOrder { + __order_isset = NO; +} + +- (BOOL) ascending { + return __ascending; +} + +- (void) setAscending: (BOOL) ascending { + __ascending = ascending; + __ascending_isset = YES; +} + +- (BOOL) ascendingIsSet { + return __ascending_isset; +} + +- (void) unsetAscending { + __ascending_isset = NO; +} + +- (NSString *) publicDescription { + return [[__publicDescription retain] autorelease]; +} + +- (void) setPublicDescription: (NSString *) publicDescription { + [publicDescription retain]; + [__publicDescription release]; + __publicDescription = publicDescription; + __publicDescription_isset = YES; +} + +- (BOOL) publicDescriptionIsSet { + return __publicDescription_isset; +} + +- (void) unsetPublicDescription { + [__publicDescription release]; + __publicDescription = nil; + __publicDescription_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setUri: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_I32) { + int fieldValue = [inProtocol readI32]; + [self setOrder: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setAscending: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setPublicDescription: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"Publishing"]; + if (__uri_isset) { + if (__uri != nil) { + [outProtocol writeFieldBeginWithName: @"uri" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __uri]; + [outProtocol writeFieldEnd]; + } + } + if (__order_isset) { + [outProtocol writeFieldBeginWithName: @"order" type: TType_I32 fieldID: 2]; + [outProtocol writeI32: __order]; + [outProtocol writeFieldEnd]; + } + if (__ascending_isset) { + [outProtocol writeFieldBeginWithName: @"ascending" type: TType_BOOL fieldID: 3]; + [outProtocol writeBool: __ascending]; + [outProtocol writeFieldEnd]; + } + if (__publicDescription_isset) { + if (__publicDescription != nil) { + [outProtocol writeFieldBeginWithName: @"publicDescription" type: TType_STRING fieldID: 4]; + [outProtocol writeString: __publicDescription]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"Publishing("]; + [ms appendString: @"uri:"]; + [ms appendFormat: @"\"%@\"", __uri]; + [ms appendString: @",order:"]; + [ms appendFormat: @"%i", __order]; + [ms appendString: @",ascending:"]; + [ms appendFormat: @"%i", __ascending]; + [ms appendString: @",publicDescription:"]; + [ms appendFormat: @"\"%@\"", __publicDescription]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMNotebook + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic guid; +@dynamic name; +@dynamic updateSequenceNum; +@dynamic defaultNotebook; +@dynamic serviceCreated; +@dynamic serviceUpdated; +@dynamic publishing; +@dynamic published; +@dynamic stack; +#endif + +- (id) initWithGuid: (EDAMGuid) guid name: (NSString *) name updateSequenceNum: (int32_t) updateSequenceNum defaultNotebook: (BOOL) defaultNotebook serviceCreated: (EDAMTimestamp) serviceCreated serviceUpdated: (EDAMTimestamp) serviceUpdated publishing: (EDAMPublishing *) publishing published: (BOOL) published stack: (NSString *) stack +{ + self = [super init]; + __guid = [guid retain]; + __guid_isset = YES; + __name = [name retain]; + __name_isset = YES; + __updateSequenceNum = updateSequenceNum; + __updateSequenceNum_isset = YES; + __defaultNotebook = defaultNotebook; + __defaultNotebook_isset = YES; + __serviceCreated = serviceCreated; + __serviceCreated_isset = YES; + __serviceUpdated = serviceUpdated; + __serviceUpdated_isset = YES; + __publishing = [publishing retain]; + __publishing_isset = YES; + __published = published; + __published_isset = YES; + __stack = [stack retain]; + __stack_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + if ([decoder containsValueForKey: @"name"]) + { + __name = [[decoder decodeObjectForKey: @"name"] retain]; + __name_isset = YES; + } + if ([decoder containsValueForKey: @"updateSequenceNum"]) + { + __updateSequenceNum = [decoder decodeInt32ForKey: @"updateSequenceNum"]; + __updateSequenceNum_isset = YES; + } + if ([decoder containsValueForKey: @"defaultNotebook"]) + { + __defaultNotebook = [decoder decodeBoolForKey: @"defaultNotebook"]; + __defaultNotebook_isset = YES; + } + if ([decoder containsValueForKey: @"serviceCreated"]) + { + __serviceCreated = [decoder decodeInt64ForKey: @"serviceCreated"]; + __serviceCreated_isset = YES; + } + if ([decoder containsValueForKey: @"serviceUpdated"]) + { + __serviceUpdated = [decoder decodeInt64ForKey: @"serviceUpdated"]; + __serviceUpdated_isset = YES; + } + if ([decoder containsValueForKey: @"publishing"]) + { + __publishing = [[decoder decodeObjectForKey: @"publishing"] retain]; + __publishing_isset = YES; + } + if ([decoder containsValueForKey: @"published"]) + { + __published = [decoder decodeBoolForKey: @"published"]; + __published_isset = YES; + } + if ([decoder containsValueForKey: @"stack"]) + { + __stack = [[decoder decodeObjectForKey: @"stack"] retain]; + __stack_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } + if (__name_isset) + { + [encoder encodeObject: __name forKey: @"name"]; + } + if (__updateSequenceNum_isset) + { + [encoder encodeInt32: __updateSequenceNum forKey: @"updateSequenceNum"]; + } + if (__defaultNotebook_isset) + { + [encoder encodeBool: __defaultNotebook forKey: @"defaultNotebook"]; + } + if (__serviceCreated_isset) + { + [encoder encodeInt64: __serviceCreated forKey: @"serviceCreated"]; + } + if (__serviceUpdated_isset) + { + [encoder encodeInt64: __serviceUpdated forKey: @"serviceUpdated"]; + } + if (__publishing_isset) + { + [encoder encodeObject: __publishing forKey: @"publishing"]; + } + if (__published_isset) + { + [encoder encodeBool: __published forKey: @"published"]; + } + if (__stack_isset) + { + [encoder encodeObject: __stack forKey: @"stack"]; + } +} + +- (void) dealloc +{ + [__guid release]; + [__name release]; + [__publishing release]; + [__stack release]; + [super dealloc]; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (NSString *) name { + return [[__name retain] autorelease]; +} + +- (void) setName: (NSString *) name { + [name retain]; + [__name release]; + __name = name; + __name_isset = YES; +} + +- (BOOL) nameIsSet { + return __name_isset; +} + +- (void) unsetName { + [__name release]; + __name = nil; + __name_isset = NO; +} + +- (int32_t) updateSequenceNum { + return __updateSequenceNum; +} + +- (void) setUpdateSequenceNum: (int32_t) updateSequenceNum { + __updateSequenceNum = updateSequenceNum; + __updateSequenceNum_isset = YES; +} + +- (BOOL) updateSequenceNumIsSet { + return __updateSequenceNum_isset; +} + +- (void) unsetUpdateSequenceNum { + __updateSequenceNum_isset = NO; +} + +- (BOOL) defaultNotebook { + return __defaultNotebook; +} + +- (void) setDefaultNotebook: (BOOL) defaultNotebook { + __defaultNotebook = defaultNotebook; + __defaultNotebook_isset = YES; +} + +- (BOOL) defaultNotebookIsSet { + return __defaultNotebook_isset; +} + +- (void) unsetDefaultNotebook { + __defaultNotebook_isset = NO; +} + +- (int64_t) serviceCreated { + return __serviceCreated; +} + +- (void) setServiceCreated: (int64_t) serviceCreated { + __serviceCreated = serviceCreated; + __serviceCreated_isset = YES; +} + +- (BOOL) serviceCreatedIsSet { + return __serviceCreated_isset; +} + +- (void) unsetServiceCreated { + __serviceCreated_isset = NO; +} + +- (int64_t) serviceUpdated { + return __serviceUpdated; +} + +- (void) setServiceUpdated: (int64_t) serviceUpdated { + __serviceUpdated = serviceUpdated; + __serviceUpdated_isset = YES; +} + +- (BOOL) serviceUpdatedIsSet { + return __serviceUpdated_isset; +} + +- (void) unsetServiceUpdated { + __serviceUpdated_isset = NO; +} + +- (EDAMPublishing *) publishing { + return [[__publishing retain] autorelease]; +} + +- (void) setPublishing: (EDAMPublishing *) publishing { + [publishing retain]; + [__publishing release]; + __publishing = publishing; + __publishing_isset = YES; +} + +- (BOOL) publishingIsSet { + return __publishing_isset; +} + +- (void) unsetPublishing { + [__publishing release]; + __publishing = nil; + __publishing_isset = NO; +} + +- (BOOL) published { + return __published; +} + +- (void) setPublished: (BOOL) published { + __published = published; + __published_isset = YES; +} + +- (BOOL) publishedIsSet { + return __published_isset; +} + +- (void) unsetPublished { + __published_isset = NO; +} + +- (NSString *) stack { + return [[__stack retain] autorelease]; +} + +- (void) setStack: (NSString *) stack { + [stack retain]; + [__stack release]; + __stack = stack; + __stack_isset = YES; +} + +- (BOOL) stackIsSet { + return __stack_isset; +} + +- (void) unsetStack { + [__stack release]; + __stack = nil; + __stack_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setName: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 5: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setUpdateSequenceNum: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 6: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setDefaultNotebook: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 7: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setServiceCreated: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 8: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setServiceUpdated: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 10: + if (fieldType == TType_STRUCT) { + EDAMPublishing *fieldValue = [[EDAMPublishing alloc] init]; + [fieldValue read: inProtocol]; + [self setPublishing: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 11: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setPublished: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 12: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setStack: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"Notebook"]; + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + if (__name_isset) { + if (__name != nil) { + [outProtocol writeFieldBeginWithName: @"name" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __name]; + [outProtocol writeFieldEnd]; + } + } + if (__updateSequenceNum_isset) { + [outProtocol writeFieldBeginWithName: @"updateSequenceNum" type: TType_I32 fieldID: 5]; + [outProtocol writeI32: __updateSequenceNum]; + [outProtocol writeFieldEnd]; + } + if (__defaultNotebook_isset) { + [outProtocol writeFieldBeginWithName: @"defaultNotebook" type: TType_BOOL fieldID: 6]; + [outProtocol writeBool: __defaultNotebook]; + [outProtocol writeFieldEnd]; + } + if (__serviceCreated_isset) { + [outProtocol writeFieldBeginWithName: @"serviceCreated" type: TType_I64 fieldID: 7]; + [outProtocol writeI64: __serviceCreated]; + [outProtocol writeFieldEnd]; + } + if (__serviceUpdated_isset) { + [outProtocol writeFieldBeginWithName: @"serviceUpdated" type: TType_I64 fieldID: 8]; + [outProtocol writeI64: __serviceUpdated]; + [outProtocol writeFieldEnd]; + } + if (__publishing_isset) { + if (__publishing != nil) { + [outProtocol writeFieldBeginWithName: @"publishing" type: TType_STRUCT fieldID: 10]; + [__publishing write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + if (__published_isset) { + [outProtocol writeFieldBeginWithName: @"published" type: TType_BOOL fieldID: 11]; + [outProtocol writeBool: __published]; + [outProtocol writeFieldEnd]; + } + if (__stack_isset) { + if (__stack != nil) { + [outProtocol writeFieldBeginWithName: @"stack" type: TType_STRING fieldID: 12]; + [outProtocol writeString: __stack]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"Notebook("]; + [ms appendString: @"guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @",name:"]; + [ms appendFormat: @"\"%@\"", __name]; + [ms appendString: @",updateSequenceNum:"]; + [ms appendFormat: @"%i", __updateSequenceNum]; + [ms appendString: @",defaultNotebook:"]; + [ms appendFormat: @"%i", __defaultNotebook]; + [ms appendString: @",serviceCreated:"]; + [ms appendFormat: @"%qi", __serviceCreated]; + [ms appendString: @",serviceUpdated:"]; + [ms appendFormat: @"%qi", __serviceUpdated]; + [ms appendString: @",publishing:"]; + [ms appendFormat: @"%@", __publishing]; + [ms appendString: @",published:"]; + [ms appendFormat: @"%i", __published]; + [ms appendString: @",stack:"]; + [ms appendFormat: @"\"%@\"", __stack]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMSavedSearch + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic guid; +@dynamic name; +@dynamic query; +@dynamic format; +@dynamic updateSequenceNum; +#endif + +- (id) initWithGuid: (EDAMGuid) guid name: (NSString *) name query: (NSString *) query format: (int) format updateSequenceNum: (int32_t) updateSequenceNum +{ + self = [super init]; + __guid = [guid retain]; + __guid_isset = YES; + __name = [name retain]; + __name_isset = YES; + __query = [query retain]; + __query_isset = YES; + __format = format; + __format_isset = YES; + __updateSequenceNum = updateSequenceNum; + __updateSequenceNum_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"guid"]) + { + __guid = [[decoder decodeObjectForKey: @"guid"] retain]; + __guid_isset = YES; + } + if ([decoder containsValueForKey: @"name"]) + { + __name = [[decoder decodeObjectForKey: @"name"] retain]; + __name_isset = YES; + } + if ([decoder containsValueForKey: @"query"]) + { + __query = [[decoder decodeObjectForKey: @"query"] retain]; + __query_isset = YES; + } + if ([decoder containsValueForKey: @"format"]) + { + __format = [decoder decodeIntForKey: @"format"]; + __format_isset = YES; + } + if ([decoder containsValueForKey: @"updateSequenceNum"]) + { + __updateSequenceNum = [decoder decodeInt32ForKey: @"updateSequenceNum"]; + __updateSequenceNum_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__guid_isset) + { + [encoder encodeObject: __guid forKey: @"guid"]; + } + if (__name_isset) + { + [encoder encodeObject: __name forKey: @"name"]; + } + if (__query_isset) + { + [encoder encodeObject: __query forKey: @"query"]; + } + if (__format_isset) + { + [encoder encodeInt: __format forKey: @"format"]; + } + if (__updateSequenceNum_isset) + { + [encoder encodeInt32: __updateSequenceNum forKey: @"updateSequenceNum"]; + } +} + +- (void) dealloc +{ + [__guid release]; + [__name release]; + [__query release]; + [super dealloc]; +} + +- (NSString *) guid { + return [[__guid retain] autorelease]; +} + +- (void) setGuid: (NSString *) guid { + [guid retain]; + [__guid release]; + __guid = guid; + __guid_isset = YES; +} + +- (BOOL) guidIsSet { + return __guid_isset; +} + +- (void) unsetGuid { + [__guid release]; + __guid = nil; + __guid_isset = NO; +} + +- (NSString *) name { + return [[__name retain] autorelease]; +} + +- (void) setName: (NSString *) name { + [name retain]; + [__name release]; + __name = name; + __name_isset = YES; +} + +- (BOOL) nameIsSet { + return __name_isset; +} + +- (void) unsetName { + [__name release]; + __name = nil; + __name_isset = NO; +} + +- (NSString *) query { + return [[__query retain] autorelease]; +} + +- (void) setQuery: (NSString *) query { + [query retain]; + [__query release]; + __query = query; + __query_isset = YES; +} + +- (BOOL) queryIsSet { + return __query_isset; +} + +- (void) unsetQuery { + [__query release]; + __query = nil; + __query_isset = NO; +} + +- (int) format { + return __format; +} + +- (void) setFormat: (int) format { + __format = format; + __format_isset = YES; +} + +- (BOOL) formatIsSet { + return __format_isset; +} + +- (void) unsetFormat { + __format_isset = NO; +} + +- (int32_t) updateSequenceNum { + return __updateSequenceNum; +} + +- (void) setUpdateSequenceNum: (int32_t) updateSequenceNum { + __updateSequenceNum = updateSequenceNum; + __updateSequenceNum_isset = YES; +} + +- (BOOL) updateSequenceNumIsSet { + return __updateSequenceNum_isset; +} + +- (void) unsetUpdateSequenceNum { + __updateSequenceNum_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setName: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setQuery: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_I32) { + int fieldValue = [inProtocol readI32]; + [self setFormat: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 5: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setUpdateSequenceNum: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"SavedSearch"]; + if (__guid_isset) { + if (__guid != nil) { + [outProtocol writeFieldBeginWithName: @"guid" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __guid]; + [outProtocol writeFieldEnd]; + } + } + if (__name_isset) { + if (__name != nil) { + [outProtocol writeFieldBeginWithName: @"name" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __name]; + [outProtocol writeFieldEnd]; + } + } + if (__query_isset) { + if (__query != nil) { + [outProtocol writeFieldBeginWithName: @"query" type: TType_STRING fieldID: 3]; + [outProtocol writeString: __query]; + [outProtocol writeFieldEnd]; + } + } + if (__format_isset) { + [outProtocol writeFieldBeginWithName: @"format" type: TType_I32 fieldID: 4]; + [outProtocol writeI32: __format]; + [outProtocol writeFieldEnd]; + } + if (__updateSequenceNum_isset) { + [outProtocol writeFieldBeginWithName: @"updateSequenceNum" type: TType_I32 fieldID: 5]; + [outProtocol writeI32: __updateSequenceNum]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"SavedSearch("]; + [ms appendString: @"guid:"]; + [ms appendFormat: @"\"%@\"", __guid]; + [ms appendString: @",name:"]; + [ms appendFormat: @"\"%@\"", __name]; + [ms appendString: @",query:"]; + [ms appendFormat: @"\"%@\"", __query]; + [ms appendString: @",format:"]; + [ms appendFormat: @"%i", __format]; + [ms appendString: @",updateSequenceNum:"]; + [ms appendFormat: @"%i", __updateSequenceNum]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMAd + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic id; +@dynamic width; +@dynamic height; +@dynamic advertiserName; +@dynamic imageUrl; +@dynamic destinationUrl; +@dynamic displaySeconds; +@dynamic score; +@dynamic image; +@dynamic imageMime; +@dynamic html; +@dynamic displayFrequency; +#endif + +- (id) initWithId: (int32_t) id width: (int16_t) width height: (int16_t) height advertiserName: (NSString *) advertiserName imageUrl: (NSString *) imageUrl destinationUrl: (NSString *) destinationUrl displaySeconds: (int16_t) displaySeconds score: (double) score image: (NSData *) image imageMime: (NSString *) imageMime html: (NSString *) html displayFrequency: (double) displayFrequency +{ + self = [super init]; + __id = id; + __id_isset = YES; + __width = width; + __width_isset = YES; + __height = height; + __height_isset = YES; + __advertiserName = [advertiserName retain]; + __advertiserName_isset = YES; + __imageUrl = [imageUrl retain]; + __imageUrl_isset = YES; + __destinationUrl = [destinationUrl retain]; + __destinationUrl_isset = YES; + __displaySeconds = displaySeconds; + __displaySeconds_isset = YES; + __score = score; + __score_isset = YES; + __image = [image retain]; + __image_isset = YES; + __imageMime = [imageMime retain]; + __imageMime_isset = YES; + __html = [html retain]; + __html_isset = YES; + __displayFrequency = displayFrequency; + __displayFrequency_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"id"]) + { + __id = [decoder decodeInt32ForKey: @"id"]; + __id_isset = YES; + } + if ([decoder containsValueForKey: @"width"]) + { + __width = [decoder decodeIntForKey: @"width"]; + __width_isset = YES; + } + if ([decoder containsValueForKey: @"height"]) + { + __height = [decoder decodeIntForKey: @"height"]; + __height_isset = YES; + } + if ([decoder containsValueForKey: @"advertiserName"]) + { + __advertiserName = [[decoder decodeObjectForKey: @"advertiserName"] retain]; + __advertiserName_isset = YES; + } + if ([decoder containsValueForKey: @"imageUrl"]) + { + __imageUrl = [[decoder decodeObjectForKey: @"imageUrl"] retain]; + __imageUrl_isset = YES; + } + if ([decoder containsValueForKey: @"destinationUrl"]) + { + __destinationUrl = [[decoder decodeObjectForKey: @"destinationUrl"] retain]; + __destinationUrl_isset = YES; + } + if ([decoder containsValueForKey: @"displaySeconds"]) + { + __displaySeconds = [decoder decodeIntForKey: @"displaySeconds"]; + __displaySeconds_isset = YES; + } + if ([decoder containsValueForKey: @"score"]) + { + __score = [decoder decodeDoubleForKey: @"score"]; + __score_isset = YES; + } + if ([decoder containsValueForKey: @"image"]) + { + __image = [[decoder decodeObjectForKey: @"image"] retain]; + __image_isset = YES; + } + if ([decoder containsValueForKey: @"imageMime"]) + { + __imageMime = [[decoder decodeObjectForKey: @"imageMime"] retain]; + __imageMime_isset = YES; + } + if ([decoder containsValueForKey: @"html"]) + { + __html = [[decoder decodeObjectForKey: @"html"] retain]; + __html_isset = YES; + } + if ([decoder containsValueForKey: @"displayFrequency"]) + { + __displayFrequency = [decoder decodeDoubleForKey: @"displayFrequency"]; + __displayFrequency_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__id_isset) + { + [encoder encodeInt32: __id forKey: @"id"]; + } + if (__width_isset) + { + [encoder encodeInt: __width forKey: @"width"]; + } + if (__height_isset) + { + [encoder encodeInt: __height forKey: @"height"]; + } + if (__advertiserName_isset) + { + [encoder encodeObject: __advertiserName forKey: @"advertiserName"]; + } + if (__imageUrl_isset) + { + [encoder encodeObject: __imageUrl forKey: @"imageUrl"]; + } + if (__destinationUrl_isset) + { + [encoder encodeObject: __destinationUrl forKey: @"destinationUrl"]; + } + if (__displaySeconds_isset) + { + [encoder encodeInt: __displaySeconds forKey: @"displaySeconds"]; + } + if (__score_isset) + { + [encoder encodeDouble: __score forKey: @"score"]; + } + if (__image_isset) + { + [encoder encodeObject: __image forKey: @"image"]; + } + if (__imageMime_isset) + { + [encoder encodeObject: __imageMime forKey: @"imageMime"]; + } + if (__html_isset) + { + [encoder encodeObject: __html forKey: @"html"]; + } + if (__displayFrequency_isset) + { + [encoder encodeDouble: __displayFrequency forKey: @"displayFrequency"]; + } +} + +- (void) dealloc +{ + [__advertiserName release]; + [__imageUrl release]; + [__destinationUrl release]; + [__image release]; + [__imageMime release]; + [__html release]; + [super dealloc]; +} + +- (int32_t) id { + return __id; +} + +- (void) setId: (int32_t) id { + __id = id; + __id_isset = YES; +} + +- (BOOL) idIsSet { + return __id_isset; +} + +- (void) unsetId { + __id_isset = NO; +} + +- (int16_t) width { + return __width; +} + +- (void) setWidth: (int16_t) width { + __width = width; + __width_isset = YES; +} + +- (BOOL) widthIsSet { + return __width_isset; +} + +- (void) unsetWidth { + __width_isset = NO; +} + +- (int16_t) height { + return __height; +} + +- (void) setHeight: (int16_t) height { + __height = height; + __height_isset = YES; +} + +- (BOOL) heightIsSet { + return __height_isset; +} + +- (void) unsetHeight { + __height_isset = NO; +} + +- (NSString *) advertiserName { + return [[__advertiserName retain] autorelease]; +} + +- (void) setAdvertiserName: (NSString *) advertiserName { + [advertiserName retain]; + [__advertiserName release]; + __advertiserName = advertiserName; + __advertiserName_isset = YES; +} + +- (BOOL) advertiserNameIsSet { + return __advertiserName_isset; +} + +- (void) unsetAdvertiserName { + [__advertiserName release]; + __advertiserName = nil; + __advertiserName_isset = NO; +} + +- (NSString *) imageUrl { + return [[__imageUrl retain] autorelease]; +} + +- (void) setImageUrl: (NSString *) imageUrl { + [imageUrl retain]; + [__imageUrl release]; + __imageUrl = imageUrl; + __imageUrl_isset = YES; +} + +- (BOOL) imageUrlIsSet { + return __imageUrl_isset; +} + +- (void) unsetImageUrl { + [__imageUrl release]; + __imageUrl = nil; + __imageUrl_isset = NO; +} + +- (NSString *) destinationUrl { + return [[__destinationUrl retain] autorelease]; +} + +- (void) setDestinationUrl: (NSString *) destinationUrl { + [destinationUrl retain]; + [__destinationUrl release]; + __destinationUrl = destinationUrl; + __destinationUrl_isset = YES; +} + +- (BOOL) destinationUrlIsSet { + return __destinationUrl_isset; +} + +- (void) unsetDestinationUrl { + [__destinationUrl release]; + __destinationUrl = nil; + __destinationUrl_isset = NO; +} + +- (int16_t) displaySeconds { + return __displaySeconds; +} + +- (void) setDisplaySeconds: (int16_t) displaySeconds { + __displaySeconds = displaySeconds; + __displaySeconds_isset = YES; +} + +- (BOOL) displaySecondsIsSet { + return __displaySeconds_isset; +} + +- (void) unsetDisplaySeconds { + __displaySeconds_isset = NO; +} + +- (double) score { + return __score; +} + +- (void) setScore: (double) score { + __score = score; + __score_isset = YES; +} + +- (BOOL) scoreIsSet { + return __score_isset; +} + +- (void) unsetScore { + __score_isset = NO; +} + +- (NSData *) image { + return [[__image retain] autorelease]; +} + +- (void) setImage: (NSData *) image { + [image retain]; + [__image release]; + __image = image; + __image_isset = YES; +} + +- (BOOL) imageIsSet { + return __image_isset; +} + +- (void) unsetImage { + [__image release]; + __image = nil; + __image_isset = NO; +} + +- (NSString *) imageMime { + return [[__imageMime retain] autorelease]; +} + +- (void) setImageMime: (NSString *) imageMime { + [imageMime retain]; + [__imageMime release]; + __imageMime = imageMime; + __imageMime_isset = YES; +} + +- (BOOL) imageMimeIsSet { + return __imageMime_isset; +} + +- (void) unsetImageMime { + [__imageMime release]; + __imageMime = nil; + __imageMime_isset = NO; +} + +- (NSString *) html { + return [[__html retain] autorelease]; +} + +- (void) setHtml: (NSString *) html { + [html retain]; + [__html release]; + __html = html; + __html_isset = YES; +} + +- (BOOL) htmlIsSet { + return __html_isset; +} + +- (void) unsetHtml { + [__html release]; + __html = nil; + __html_isset = NO; +} + +- (double) displayFrequency { + return __displayFrequency; +} + +- (void) setDisplayFrequency: (double) displayFrequency { + __displayFrequency = displayFrequency; + __displayFrequency_isset = YES; +} + +- (BOOL) displayFrequencyIsSet { + return __displayFrequency_isset; +} + +- (void) unsetDisplayFrequency { + __displayFrequency_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setId: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_I16) { + int16_t fieldValue = [inProtocol readI16]; + [self setWidth: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_I16) { + int16_t fieldValue = [inProtocol readI16]; + [self setHeight: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAdvertiserName: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 5: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setImageUrl: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 6: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setDestinationUrl: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 7: + if (fieldType == TType_I16) { + int16_t fieldValue = [inProtocol readI16]; + [self setDisplaySeconds: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 8: + if (fieldType == TType_DOUBLE) { + double fieldValue = [inProtocol readDouble]; + [self setScore: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 9: + if (fieldType == TType_STRING) { + NSData * fieldValue = [inProtocol readBinary]; + [self setImage: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 10: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setImageMime: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 11: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setHtml: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 12: + if (fieldType == TType_DOUBLE) { + double fieldValue = [inProtocol readDouble]; + [self setDisplayFrequency: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"Ad"]; + if (__id_isset) { + [outProtocol writeFieldBeginWithName: @"id" type: TType_I32 fieldID: 1]; + [outProtocol writeI32: __id]; + [outProtocol writeFieldEnd]; + } + if (__width_isset) { + [outProtocol writeFieldBeginWithName: @"width" type: TType_I16 fieldID: 2]; + [outProtocol writeI16: __width]; + [outProtocol writeFieldEnd]; + } + if (__height_isset) { + [outProtocol writeFieldBeginWithName: @"height" type: TType_I16 fieldID: 3]; + [outProtocol writeI16: __height]; + [outProtocol writeFieldEnd]; + } + if (__advertiserName_isset) { + if (__advertiserName != nil) { + [outProtocol writeFieldBeginWithName: @"advertiserName" type: TType_STRING fieldID: 4]; + [outProtocol writeString: __advertiserName]; + [outProtocol writeFieldEnd]; + } + } + if (__imageUrl_isset) { + if (__imageUrl != nil) { + [outProtocol writeFieldBeginWithName: @"imageUrl" type: TType_STRING fieldID: 5]; + [outProtocol writeString: __imageUrl]; + [outProtocol writeFieldEnd]; + } + } + if (__destinationUrl_isset) { + if (__destinationUrl != nil) { + [outProtocol writeFieldBeginWithName: @"destinationUrl" type: TType_STRING fieldID: 6]; + [outProtocol writeString: __destinationUrl]; + [outProtocol writeFieldEnd]; + } + } + if (__displaySeconds_isset) { + [outProtocol writeFieldBeginWithName: @"displaySeconds" type: TType_I16 fieldID: 7]; + [outProtocol writeI16: __displaySeconds]; + [outProtocol writeFieldEnd]; + } + if (__score_isset) { + [outProtocol writeFieldBeginWithName: @"score" type: TType_DOUBLE fieldID: 8]; + [outProtocol writeDouble: __score]; + [outProtocol writeFieldEnd]; + } + if (__image_isset) { + if (__image != nil) { + [outProtocol writeFieldBeginWithName: @"image" type: TType_STRING fieldID: 9]; + [outProtocol writeBinary: __image]; + [outProtocol writeFieldEnd]; + } + } + if (__imageMime_isset) { + if (__imageMime != nil) { + [outProtocol writeFieldBeginWithName: @"imageMime" type: TType_STRING fieldID: 10]; + [outProtocol writeString: __imageMime]; + [outProtocol writeFieldEnd]; + } + } + if (__html_isset) { + if (__html != nil) { + [outProtocol writeFieldBeginWithName: @"html" type: TType_STRING fieldID: 11]; + [outProtocol writeString: __html]; + [outProtocol writeFieldEnd]; + } + } + if (__displayFrequency_isset) { + [outProtocol writeFieldBeginWithName: @"displayFrequency" type: TType_DOUBLE fieldID: 12]; + [outProtocol writeDouble: __displayFrequency]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"Ad("]; + [ms appendString: @"id:"]; + [ms appendFormat: @"%i", __id]; + [ms appendString: @",width:"]; + [ms appendFormat: @"%hi", __width]; + [ms appendString: @",height:"]; + [ms appendFormat: @"%hi", __height]; + [ms appendString: @",advertiserName:"]; + [ms appendFormat: @"\"%@\"", __advertiserName]; + [ms appendString: @",imageUrl:"]; + [ms appendFormat: @"\"%@\"", __imageUrl]; + [ms appendString: @",destinationUrl:"]; + [ms appendFormat: @"\"%@\"", __destinationUrl]; + [ms appendString: @",displaySeconds:"]; + [ms appendFormat: @"%hi", __displaySeconds]; + [ms appendString: @",score:"]; + [ms appendFormat: @"%f", __score]; + [ms appendString: @",image:"]; + [ms appendFormat: @"\"%@\"", __image]; + [ms appendString: @",imageMime:"]; + [ms appendFormat: @"\"%@\"", __imageMime]; + [ms appendString: @",html:"]; + [ms appendFormat: @"\"%@\"", __html]; + [ms appendString: @",displayFrequency:"]; + [ms appendFormat: @"%f", __displayFrequency]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMSharedNotebook + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic id; +@dynamic userId; +@dynamic notebookGuid; +@dynamic email; +@dynamic notebookModifiable; +@dynamic requireLogin; +@dynamic serviceCreated; +@dynamic shareKey; +@dynamic username; +#endif + +- (id) initWithId: (int64_t) id userId: (int32_t) userId notebookGuid: (NSString *) notebookGuid email: (NSString *) email notebookModifiable: (BOOL) notebookModifiable requireLogin: (BOOL) requireLogin serviceCreated: (EDAMTimestamp) serviceCreated shareKey: (NSString *) shareKey username: (NSString *) username +{ + self = [super init]; + __id = id; + __id_isset = YES; + __userId = userId; + __userId_isset = YES; + __notebookGuid = [notebookGuid retain]; + __notebookGuid_isset = YES; + __email = [email retain]; + __email_isset = YES; + __notebookModifiable = notebookModifiable; + __notebookModifiable_isset = YES; + __requireLogin = requireLogin; + __requireLogin_isset = YES; + __serviceCreated = serviceCreated; + __serviceCreated_isset = YES; + __shareKey = [shareKey retain]; + __shareKey_isset = YES; + __username = [username retain]; + __username_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"id"]) + { + __id = [decoder decodeInt64ForKey: @"id"]; + __id_isset = YES; + } + if ([decoder containsValueForKey: @"userId"]) + { + __userId = [decoder decodeInt32ForKey: @"userId"]; + __userId_isset = YES; + } + if ([decoder containsValueForKey: @"notebookGuid"]) + { + __notebookGuid = [[decoder decodeObjectForKey: @"notebookGuid"] retain]; + __notebookGuid_isset = YES; + } + if ([decoder containsValueForKey: @"email"]) + { + __email = [[decoder decodeObjectForKey: @"email"] retain]; + __email_isset = YES; + } + if ([decoder containsValueForKey: @"notebookModifiable"]) + { + __notebookModifiable = [decoder decodeBoolForKey: @"notebookModifiable"]; + __notebookModifiable_isset = YES; + } + if ([decoder containsValueForKey: @"requireLogin"]) + { + __requireLogin = [decoder decodeBoolForKey: @"requireLogin"]; + __requireLogin_isset = YES; + } + if ([decoder containsValueForKey: @"serviceCreated"]) + { + __serviceCreated = [decoder decodeInt64ForKey: @"serviceCreated"]; + __serviceCreated_isset = YES; + } + if ([decoder containsValueForKey: @"shareKey"]) + { + __shareKey = [[decoder decodeObjectForKey: @"shareKey"] retain]; + __shareKey_isset = YES; + } + if ([decoder containsValueForKey: @"username"]) + { + __username = [[decoder decodeObjectForKey: @"username"] retain]; + __username_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__id_isset) + { + [encoder encodeInt64: __id forKey: @"id"]; + } + if (__userId_isset) + { + [encoder encodeInt32: __userId forKey: @"userId"]; + } + if (__notebookGuid_isset) + { + [encoder encodeObject: __notebookGuid forKey: @"notebookGuid"]; + } + if (__email_isset) + { + [encoder encodeObject: __email forKey: @"email"]; + } + if (__notebookModifiable_isset) + { + [encoder encodeBool: __notebookModifiable forKey: @"notebookModifiable"]; + } + if (__requireLogin_isset) + { + [encoder encodeBool: __requireLogin forKey: @"requireLogin"]; + } + if (__serviceCreated_isset) + { + [encoder encodeInt64: __serviceCreated forKey: @"serviceCreated"]; + } + if (__shareKey_isset) + { + [encoder encodeObject: __shareKey forKey: @"shareKey"]; + } + if (__username_isset) + { + [encoder encodeObject: __username forKey: @"username"]; + } +} + +- (void) dealloc +{ + [__notebookGuid release]; + [__email release]; + [__shareKey release]; + [__username release]; + [super dealloc]; +} + +- (int64_t) id { + return __id; +} + +- (void) setId: (int64_t) id { + __id = id; + __id_isset = YES; +} + +- (BOOL) idIsSet { + return __id_isset; +} + +- (void) unsetId { + __id_isset = NO; +} + +- (int32_t) userId { + return __userId; +} + +- (void) setUserId: (int32_t) userId { + __userId = userId; + __userId_isset = YES; +} + +- (BOOL) userIdIsSet { + return __userId_isset; +} + +- (void) unsetUserId { + __userId_isset = NO; +} + +- (NSString *) notebookGuid { + return [[__notebookGuid retain] autorelease]; +} + +- (void) setNotebookGuid: (NSString *) notebookGuid { + [notebookGuid retain]; + [__notebookGuid release]; + __notebookGuid = notebookGuid; + __notebookGuid_isset = YES; +} + +- (BOOL) notebookGuidIsSet { + return __notebookGuid_isset; +} + +- (void) unsetNotebookGuid { + [__notebookGuid release]; + __notebookGuid = nil; + __notebookGuid_isset = NO; +} + +- (NSString *) email { + return [[__email retain] autorelease]; +} + +- (void) setEmail: (NSString *) email { + [email retain]; + [__email release]; + __email = email; + __email_isset = YES; +} + +- (BOOL) emailIsSet { + return __email_isset; +} + +- (void) unsetEmail { + [__email release]; + __email = nil; + __email_isset = NO; +} + +- (BOOL) notebookModifiable { + return __notebookModifiable; +} + +- (void) setNotebookModifiable: (BOOL) notebookModifiable { + __notebookModifiable = notebookModifiable; + __notebookModifiable_isset = YES; +} + +- (BOOL) notebookModifiableIsSet { + return __notebookModifiable_isset; +} + +- (void) unsetNotebookModifiable { + __notebookModifiable_isset = NO; +} + +- (BOOL) requireLogin { + return __requireLogin; +} + +- (void) setRequireLogin: (BOOL) requireLogin { + __requireLogin = requireLogin; + __requireLogin_isset = YES; +} + +- (BOOL) requireLoginIsSet { + return __requireLogin_isset; +} + +- (void) unsetRequireLogin { + __requireLogin_isset = NO; +} + +- (int64_t) serviceCreated { + return __serviceCreated; +} + +- (void) setServiceCreated: (int64_t) serviceCreated { + __serviceCreated = serviceCreated; + __serviceCreated_isset = YES; +} + +- (BOOL) serviceCreatedIsSet { + return __serviceCreated_isset; +} + +- (void) unsetServiceCreated { + __serviceCreated_isset = NO; +} + +- (NSString *) shareKey { + return [[__shareKey retain] autorelease]; +} + +- (void) setShareKey: (NSString *) shareKey { + [shareKey retain]; + [__shareKey release]; + __shareKey = shareKey; + __shareKey_isset = YES; +} + +- (BOOL) shareKeyIsSet { + return __shareKey_isset; +} + +- (void) unsetShareKey { + [__shareKey release]; + __shareKey = nil; + __shareKey_isset = NO; +} + +- (NSString *) username { + return [[__username retain] autorelease]; +} + +- (void) setUsername: (NSString *) username { + [username retain]; + [__username release]; + __username = username; + __username_isset = YES; +} + +- (BOOL) usernameIsSet { + return __username_isset; +} + +- (void) unsetUsername { + [__username release]; + __username = nil; + __username_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setId: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setUserId: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setNotebookGuid: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setEmail: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 5: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setNotebookModifiable: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 6: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setRequireLogin: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 7: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setServiceCreated: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 8: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setShareKey: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 9: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setUsername: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"SharedNotebook"]; + if (__id_isset) { + [outProtocol writeFieldBeginWithName: @"id" type: TType_I64 fieldID: 1]; + [outProtocol writeI64: __id]; + [outProtocol writeFieldEnd]; + } + if (__userId_isset) { + [outProtocol writeFieldBeginWithName: @"userId" type: TType_I32 fieldID: 2]; + [outProtocol writeI32: __userId]; + [outProtocol writeFieldEnd]; + } + if (__notebookGuid_isset) { + if (__notebookGuid != nil) { + [outProtocol writeFieldBeginWithName: @"notebookGuid" type: TType_STRING fieldID: 3]; + [outProtocol writeString: __notebookGuid]; + [outProtocol writeFieldEnd]; + } + } + if (__email_isset) { + if (__email != nil) { + [outProtocol writeFieldBeginWithName: @"email" type: TType_STRING fieldID: 4]; + [outProtocol writeString: __email]; + [outProtocol writeFieldEnd]; + } + } + if (__notebookModifiable_isset) { + [outProtocol writeFieldBeginWithName: @"notebookModifiable" type: TType_BOOL fieldID: 5]; + [outProtocol writeBool: __notebookModifiable]; + [outProtocol writeFieldEnd]; + } + if (__requireLogin_isset) { + [outProtocol writeFieldBeginWithName: @"requireLogin" type: TType_BOOL fieldID: 6]; + [outProtocol writeBool: __requireLogin]; + [outProtocol writeFieldEnd]; + } + if (__serviceCreated_isset) { + [outProtocol writeFieldBeginWithName: @"serviceCreated" type: TType_I64 fieldID: 7]; + [outProtocol writeI64: __serviceCreated]; + [outProtocol writeFieldEnd]; + } + if (__shareKey_isset) { + if (__shareKey != nil) { + [outProtocol writeFieldBeginWithName: @"shareKey" type: TType_STRING fieldID: 8]; + [outProtocol writeString: __shareKey]; + [outProtocol writeFieldEnd]; + } + } + if (__username_isset) { + if (__username != nil) { + [outProtocol writeFieldBeginWithName: @"username" type: TType_STRING fieldID: 9]; + [outProtocol writeString: __username]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"SharedNotebook("]; + [ms appendString: @"id:"]; + [ms appendFormat: @"%qi", __id]; + [ms appendString: @",userId:"]; + [ms appendFormat: @"%i", __userId]; + [ms appendString: @",notebookGuid:"]; + [ms appendFormat: @"\"%@\"", __notebookGuid]; + [ms appendString: @",email:"]; + [ms appendFormat: @"\"%@\"", __email]; + [ms appendString: @",notebookModifiable:"]; + [ms appendFormat: @"%i", __notebookModifiable]; + [ms appendString: @",requireLogin:"]; + [ms appendFormat: @"%i", __requireLogin]; + [ms appendString: @",serviceCreated:"]; + [ms appendFormat: @"%qi", __serviceCreated]; + [ms appendString: @",shareKey:"]; + [ms appendFormat: @"\"%@\"", __shareKey]; + [ms appendString: @",username:"]; + [ms appendFormat: @"\"%@\"", __username]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMLinkedNotebook + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic id; +@dynamic shareName; +@dynamic username; +@dynamic shardId; +@dynamic shareKey; +@dynamic uri; +#endif + +- (id) initWithId: (int64_t) id shareName: (NSString *) shareName username: (NSString *) username shardId: (NSString *) shardId shareKey: (NSString *) shareKey uri: (NSString *) uri +{ + self = [super init]; + __id = id; + __id_isset = YES; + __shareName = [shareName retain]; + __shareName_isset = YES; + __username = [username retain]; + __username_isset = YES; + __shardId = [shardId retain]; + __shardId_isset = YES; + __shareKey = [shareKey retain]; + __shareKey_isset = YES; + __uri = [uri retain]; + __uri_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"id"]) + { + __id = [decoder decodeInt64ForKey: @"id"]; + __id_isset = YES; + } + if ([decoder containsValueForKey: @"shareName"]) + { + __shareName = [[decoder decodeObjectForKey: @"shareName"] retain]; + __shareName_isset = YES; + } + if ([decoder containsValueForKey: @"username"]) + { + __username = [[decoder decodeObjectForKey: @"username"] retain]; + __username_isset = YES; + } + if ([decoder containsValueForKey: @"shardId"]) + { + __shardId = [[decoder decodeObjectForKey: @"shardId"] retain]; + __shardId_isset = YES; + } + if ([decoder containsValueForKey: @"shareKey"]) + { + __shareKey = [[decoder decodeObjectForKey: @"shareKey"] retain]; + __shareKey_isset = YES; + } + if ([decoder containsValueForKey: @"uri"]) + { + __uri = [[decoder decodeObjectForKey: @"uri"] retain]; + __uri_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__id_isset) + { + [encoder encodeInt64: __id forKey: @"id"]; + } + if (__shareName_isset) + { + [encoder encodeObject: __shareName forKey: @"shareName"]; + } + if (__username_isset) + { + [encoder encodeObject: __username forKey: @"username"]; + } + if (__shardId_isset) + { + [encoder encodeObject: __shardId forKey: @"shardId"]; + } + if (__shareKey_isset) + { + [encoder encodeObject: __shareKey forKey: @"shareKey"]; + } + if (__uri_isset) + { + [encoder encodeObject: __uri forKey: @"uri"]; + } +} + +- (void) dealloc +{ + [__shareName release]; + [__username release]; + [__shardId release]; + [__shareKey release]; + [__uri release]; + [super dealloc]; +} + +- (int64_t) id { + return __id; +} + +- (void) setId: (int64_t) id { + __id = id; + __id_isset = YES; +} + +- (BOOL) idIsSet { + return __id_isset; +} + +- (void) unsetId { + __id_isset = NO; +} + +- (NSString *) shareName { + return [[__shareName retain] autorelease]; +} + +- (void) setShareName: (NSString *) shareName { + [shareName retain]; + [__shareName release]; + __shareName = shareName; + __shareName_isset = YES; +} + +- (BOOL) shareNameIsSet { + return __shareName_isset; +} + +- (void) unsetShareName { + [__shareName release]; + __shareName = nil; + __shareName_isset = NO; +} + +- (NSString *) username { + return [[__username retain] autorelease]; +} + +- (void) setUsername: (NSString *) username { + [username retain]; + [__username release]; + __username = username; + __username_isset = YES; +} + +- (BOOL) usernameIsSet { + return __username_isset; +} + +- (void) unsetUsername { + [__username release]; + __username = nil; + __username_isset = NO; +} + +- (NSString *) shardId { + return [[__shardId retain] autorelease]; +} + +- (void) setShardId: (NSString *) shardId { + [shardId retain]; + [__shardId release]; + __shardId = shardId; + __shardId_isset = YES; +} + +- (BOOL) shardIdIsSet { + return __shardId_isset; +} + +- (void) unsetShardId { + [__shardId release]; + __shardId = nil; + __shardId_isset = NO; +} + +- (NSString *) shareKey { + return [[__shareKey retain] autorelease]; +} + +- (void) setShareKey: (NSString *) shareKey { + [shareKey retain]; + [__shareKey release]; + __shareKey = shareKey; + __shareKey_isset = YES; +} + +- (BOOL) shareKeyIsSet { + return __shareKey_isset; +} + +- (void) unsetShareKey { + [__shareKey release]; + __shareKey = nil; + __shareKey_isset = NO; +} + +- (NSString *) uri { + return [[__uri retain] autorelease]; +} + +- (void) setUri: (NSString *) uri { + [uri retain]; + [__uri release]; + __uri = uri; + __uri_isset = YES; +} + +- (BOOL) uriIsSet { + return __uri_isset; +} + +- (void) unsetUri { + [__uri release]; + __uri = nil; + __uri_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setId: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setShareName: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setUsername: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setShardId: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 5: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setShareKey: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 6: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setUri: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"LinkedNotebook"]; + if (__id_isset) { + [outProtocol writeFieldBeginWithName: @"id" type: TType_I64 fieldID: 1]; + [outProtocol writeI64: __id]; + [outProtocol writeFieldEnd]; + } + if (__shareName_isset) { + if (__shareName != nil) { + [outProtocol writeFieldBeginWithName: @"shareName" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __shareName]; + [outProtocol writeFieldEnd]; + } + } + if (__username_isset) { + if (__username != nil) { + [outProtocol writeFieldBeginWithName: @"username" type: TType_STRING fieldID: 3]; + [outProtocol writeString: __username]; + [outProtocol writeFieldEnd]; + } + } + if (__shardId_isset) { + if (__shardId != nil) { + [outProtocol writeFieldBeginWithName: @"shardId" type: TType_STRING fieldID: 4]; + [outProtocol writeString: __shardId]; + [outProtocol writeFieldEnd]; + } + } + if (__shareKey_isset) { + if (__shareKey != nil) { + [outProtocol writeFieldBeginWithName: @"shareKey" type: TType_STRING fieldID: 5]; + [outProtocol writeString: __shareKey]; + [outProtocol writeFieldEnd]; + } + } + if (__uri_isset) { + if (__uri != nil) { + [outProtocol writeFieldBeginWithName: @"uri" type: TType_STRING fieldID: 6]; + [outProtocol writeString: __uri]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"LinkedNotebook("]; + [ms appendString: @"id:"]; + [ms appendFormat: @"%qi", __id]; + [ms appendString: @",shareName:"]; + [ms appendFormat: @"\"%@\"", __shareName]; + [ms appendString: @",username:"]; + [ms appendFormat: @"\"%@\"", __username]; + [ms appendString: @",shardId:"]; + [ms appendFormat: @"\"%@\"", __shardId]; + [ms appendString: @",shareKey:"]; + [ms appendFormat: @"\"%@\"", __shareKey]; + [ms appendString: @",uri:"]; + [ms appendFormat: @"\"%@\"", __uri]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/UserStore.h b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/UserStore.h new file mode 100644 index 00000000..21586190 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/UserStore.h @@ -0,0 +1,136 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ + +#import + +#import "TProtocol.h" +#import "TApplicationException.h" +#import "TProtocolUtil.h" +#import "TProcessor.h" + +#import "Types.h" +#import "Errors.h" + +@interface EDAMPublicUserInfo : NSObject { + EDAMUserID __userId; + NSString * __shardId; + int __privilege; + NSString * __username; + + BOOL __userId_isset; + BOOL __shardId_isset; + BOOL __privilege_isset; + BOOL __username_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=userId, setter=setUserId:) EDAMUserID userId; +@property (nonatomic, retain, getter=shardId, setter=setShardId:) NSString * shardId; +@property (nonatomic, getter=privilege, setter=setPrivilege:) int privilege; +@property (nonatomic, retain, getter=username, setter=setUsername:) NSString * username; +#endif + +- (id) initWithUserId: (EDAMUserID) userId shardId: (NSString *) shardId privilege: (int) privilege username: (NSString *) username; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMUserID) userId; +- (void) setUserId: (EDAMUserID) userId; +- (BOOL) userIdIsSet; + +- (NSString *) shardId; +- (void) setShardId: (NSString *) shardId; +- (BOOL) shardIdIsSet; + +- (int) privilege; +- (void) setPrivilege: (int) privilege; +- (BOOL) privilegeIsSet; + +- (NSString *) username; +- (void) setUsername: (NSString *) username; +- (BOOL) usernameIsSet; + +@end + +@interface EDAMAuthenticationResult : NSObject { + EDAMTimestamp __currentTime; + NSString * __authenticationToken; + EDAMTimestamp __expiration; + EDAMUser * __user; + EDAMPublicUserInfo * __publicUserInfo; + + BOOL __currentTime_isset; + BOOL __authenticationToken_isset; + BOOL __expiration_isset; + BOOL __user_isset; + BOOL __publicUserInfo_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=currentTime, setter=setCurrentTime:) EDAMTimestamp currentTime; +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +@property (nonatomic, getter=expiration, setter=setExpiration:) EDAMTimestamp expiration; +@property (nonatomic, retain, getter=user, setter=setUser:) EDAMUser * user; +@property (nonatomic, retain, getter=publicUserInfo, setter=setPublicUserInfo:) EDAMPublicUserInfo * publicUserInfo; +#endif + +- (id) initWithCurrentTime: (EDAMTimestamp) currentTime authenticationToken: (NSString *) authenticationToken expiration: (EDAMTimestamp) expiration user: (EDAMUser *) user publicUserInfo: (EDAMPublicUserInfo *) publicUserInfo; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMTimestamp) currentTime; +- (void) setCurrentTime: (EDAMTimestamp) currentTime; +- (BOOL) currentTimeIsSet; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +- (EDAMTimestamp) expiration; +- (void) setExpiration: (EDAMTimestamp) expiration; +- (BOOL) expirationIsSet; + +- (EDAMUser *) user; +- (void) setUser: (EDAMUser *) user; +- (BOOL) userIsSet; + +- (EDAMPublicUserInfo *) publicUserInfo; +- (void) setPublicUserInfo: (EDAMPublicUserInfo *) publicUserInfo; +- (BOOL) publicUserInfoIsSet; + +@end + +@protocol EDAMUserStore +- (BOOL) checkVersion: (NSString *) clientName : (int16_t) edamVersionMajor : (int16_t) edamVersionMinor; // throws TException +- (EDAMAuthenticationResult *) authenticate: (NSString *) username : (NSString *) password : (NSString *) consumerKey : (NSString *) consumerSecret; // throws EDAMUserException *, EDAMSystemException *, TException +- (EDAMAuthenticationResult *) refreshAuthentication: (NSString *) authenticationToken; // throws EDAMUserException *, EDAMSystemException *, TException +- (EDAMUser *) getUser: (NSString *) authenticationToken; // throws EDAMUserException *, EDAMSystemException *, TException +- (EDAMPublicUserInfo *) getPublicUserInfo: (NSString *) username; // throws EDAMNotFoundException *, EDAMSystemException *, EDAMUserException *, TException +@end + +@interface EDAMUserStoreClient : NSObject { + id inProtocol; + id outProtocol; +} +- (id) initWithProtocol: (id ) protocol; +- (id) initWithInProtocol: (id ) inProtocol outProtocol: (id ) outProtocol; +@end + +@interface EDAMUserStoreProcessor : NSObject { + id mService; + NSDictionary * mMethodMap; +} +- (id) initWithUserStore: (id ) service; +- (id) service; +@end + +@interface EDAMUserStoreConstants : NSObject { +} ++ (int16_t) EDAM_VERSION_MAJOR; ++ (int16_t) EDAM_VERSION_MINOR; +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/UserStore.m b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/UserStore.m new file mode 100644 index 00000000..5871a2ca --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/edam/UserStore.m @@ -0,0 +1,3224 @@ +/** + * Autogenerated by Thrift + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + */ + +#import + +#import "TProtocol.h" +#import "TApplicationException.h" +#import "TProtocolUtil.h" +#import "TProcessor.h" + +#import "Types.h" +#import "Errors.h" + +#import "UserStore.h" + +static int16_t EDAMEDAM_VERSION_MAJOR = 1; +static int16_t EDAMEDAM_VERSION_MINOR = 16; + +@implementation EDAMUserStoreConstants ++ (void) initialize { +} ++ (int16_t) EDAM_VERSION_MAJOR{ + return EDAMEDAM_VERSION_MAJOR; +} ++ (int16_t) EDAM_VERSION_MINOR{ + return EDAMEDAM_VERSION_MINOR; +} +@end + +@implementation EDAMPublicUserInfo + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic userId; +@dynamic shardId; +@dynamic privilege; +@dynamic username; +#endif + +- (id) initWithUserId: (EDAMUserID) userId shardId: (NSString *) shardId privilege: (int) privilege username: (NSString *) username +{ + self = [super init]; + __userId = userId; + __userId_isset = YES; + __shardId = [shardId retain]; + __shardId_isset = YES; + __privilege = privilege; + __privilege_isset = YES; + __username = [username retain]; + __username_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"userId"]) + { + __userId = [decoder decodeInt32ForKey: @"userId"]; + __userId_isset = YES; + } + if ([decoder containsValueForKey: @"shardId"]) + { + __shardId = [[decoder decodeObjectForKey: @"shardId"] retain]; + __shardId_isset = YES; + } + if ([decoder containsValueForKey: @"privilege"]) + { + __privilege = [decoder decodeIntForKey: @"privilege"]; + __privilege_isset = YES; + } + if ([decoder containsValueForKey: @"username"]) + { + __username = [[decoder decodeObjectForKey: @"username"] retain]; + __username_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__userId_isset) + { + [encoder encodeInt32: __userId forKey: @"userId"]; + } + if (__shardId_isset) + { + [encoder encodeObject: __shardId forKey: @"shardId"]; + } + if (__privilege_isset) + { + [encoder encodeInt: __privilege forKey: @"privilege"]; + } + if (__username_isset) + { + [encoder encodeObject: __username forKey: @"username"]; + } +} + +- (void) dealloc +{ + [__shardId release]; + [__username release]; + [super dealloc]; +} + +- (int32_t) userId { + return __userId; +} + +- (void) setUserId: (int32_t) userId { + __userId = userId; + __userId_isset = YES; +} + +- (BOOL) userIdIsSet { + return __userId_isset; +} + +- (void) unsetUserId { + __userId_isset = NO; +} + +- (NSString *) shardId { + return [[__shardId retain] autorelease]; +} + +- (void) setShardId: (NSString *) shardId { + [shardId retain]; + [__shardId release]; + __shardId = shardId; + __shardId_isset = YES; +} + +- (BOOL) shardIdIsSet { + return __shardId_isset; +} + +- (void) unsetShardId { + [__shardId release]; + __shardId = nil; + __shardId_isset = NO; +} + +- (int) privilege { + return __privilege; +} + +- (void) setPrivilege: (int) privilege { + __privilege = privilege; + __privilege_isset = YES; +} + +- (BOOL) privilegeIsSet { + return __privilege_isset; +} + +- (void) unsetPrivilege { + __privilege_isset = NO; +} + +- (NSString *) username { + return [[__username retain] autorelease]; +} + +- (void) setUsername: (NSString *) username { + [username retain]; + [__username release]; + __username = username; + __username_isset = YES; +} + +- (BOOL) usernameIsSet { + return __username_isset; +} + +- (void) unsetUsername { + [__username release]; + __username = nil; + __username_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_I32) { + int32_t fieldValue = [inProtocol readI32]; + [self setUserId: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setShardId: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_I32) { + int fieldValue = [inProtocol readI32]; + [self setPrivilege: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setUsername: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"PublicUserInfo"]; + if (__userId_isset) { + [outProtocol writeFieldBeginWithName: @"userId" type: TType_I32 fieldID: 1]; + [outProtocol writeI32: __userId]; + [outProtocol writeFieldEnd]; + } + if (__shardId_isset) { + if (__shardId != nil) { + [outProtocol writeFieldBeginWithName: @"shardId" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __shardId]; + [outProtocol writeFieldEnd]; + } + } + if (__privilege_isset) { + [outProtocol writeFieldBeginWithName: @"privilege" type: TType_I32 fieldID: 3]; + [outProtocol writeI32: __privilege]; + [outProtocol writeFieldEnd]; + } + if (__username_isset) { + if (__username != nil) { + [outProtocol writeFieldBeginWithName: @"username" type: TType_STRING fieldID: 4]; + [outProtocol writeString: __username]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"PublicUserInfo("]; + [ms appendString: @"userId:"]; + [ms appendFormat: @"%i", __userId]; + [ms appendString: @",shardId:"]; + [ms appendFormat: @"\"%@\"", __shardId]; + [ms appendString: @",privilege:"]; + [ms appendFormat: @"%i", __privilege]; + [ms appendString: @",username:"]; + [ms appendFormat: @"\"%@\"", __username]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMAuthenticationResult + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic currentTime; +@dynamic authenticationToken; +@dynamic expiration; +@dynamic user; +@dynamic publicUserInfo; +#endif + +- (id) initWithCurrentTime: (EDAMTimestamp) currentTime authenticationToken: (NSString *) authenticationToken expiration: (EDAMTimestamp) expiration user: (EDAMUser *) user publicUserInfo: (EDAMPublicUserInfo *) publicUserInfo +{ + self = [super init]; + __currentTime = currentTime; + __currentTime_isset = YES; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + __expiration = expiration; + __expiration_isset = YES; + __user = [user retain]; + __user_isset = YES; + __publicUserInfo = [publicUserInfo retain]; + __publicUserInfo_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"currentTime"]) + { + __currentTime = [decoder decodeInt64ForKey: @"currentTime"]; + __currentTime_isset = YES; + } + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + if ([decoder containsValueForKey: @"expiration"]) + { + __expiration = [decoder decodeInt64ForKey: @"expiration"]; + __expiration_isset = YES; + } + if ([decoder containsValueForKey: @"user"]) + { + __user = [[decoder decodeObjectForKey: @"user"] retain]; + __user_isset = YES; + } + if ([decoder containsValueForKey: @"publicUserInfo"]) + { + __publicUserInfo = [[decoder decodeObjectForKey: @"publicUserInfo"] retain]; + __publicUserInfo_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__currentTime_isset) + { + [encoder encodeInt64: __currentTime forKey: @"currentTime"]; + } + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } + if (__expiration_isset) + { + [encoder encodeInt64: __expiration forKey: @"expiration"]; + } + if (__user_isset) + { + [encoder encodeObject: __user forKey: @"user"]; + } + if (__publicUserInfo_isset) + { + [encoder encodeObject: __publicUserInfo forKey: @"publicUserInfo"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [__user release]; + [__publicUserInfo release]; + [super dealloc]; +} + +- (int64_t) currentTime { + return __currentTime; +} + +- (void) setCurrentTime: (int64_t) currentTime { + __currentTime = currentTime; + __currentTime_isset = YES; +} + +- (BOOL) currentTimeIsSet { + return __currentTime_isset; +} + +- (void) unsetCurrentTime { + __currentTime_isset = NO; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (int64_t) expiration { + return __expiration; +} + +- (void) setExpiration: (int64_t) expiration { + __expiration = expiration; + __expiration_isset = YES; +} + +- (BOOL) expirationIsSet { + return __expiration_isset; +} + +- (void) unsetExpiration { + __expiration_isset = NO; +} + +- (EDAMUser *) user { + return [[__user retain] autorelease]; +} + +- (void) setUser: (EDAMUser *) user { + [user retain]; + [__user release]; + __user = user; + __user_isset = YES; +} + +- (BOOL) userIsSet { + return __user_isset; +} + +- (void) unsetUser { + [__user release]; + __user = nil; + __user_isset = NO; +} + +- (EDAMPublicUserInfo *) publicUserInfo { + return [[__publicUserInfo retain] autorelease]; +} + +- (void) setPublicUserInfo: (EDAMPublicUserInfo *) publicUserInfo { + [publicUserInfo retain]; + [__publicUserInfo release]; + __publicUserInfo = publicUserInfo; + __publicUserInfo_isset = YES; +} + +- (BOOL) publicUserInfoIsSet { + return __publicUserInfo_isset; +} + +- (void) unsetPublicUserInfo { + [__publicUserInfo release]; + __publicUserInfo = nil; + __publicUserInfo_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setCurrentTime: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_I64) { + int64_t fieldValue = [inProtocol readI64]; + [self setExpiration: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_STRUCT) { + EDAMUser *fieldValue = [[EDAMUser alloc] init]; + [fieldValue read: inProtocol]; + [self setUser: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 5: + if (fieldType == TType_STRUCT) { + EDAMPublicUserInfo *fieldValue = [[EDAMPublicUserInfo alloc] init]; + [fieldValue read: inProtocol]; + [self setPublicUserInfo: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"AuthenticationResult"]; + if (__currentTime_isset) { + [outProtocol writeFieldBeginWithName: @"currentTime" type: TType_I64 fieldID: 1]; + [outProtocol writeI64: __currentTime]; + [outProtocol writeFieldEnd]; + } + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + if (__expiration_isset) { + [outProtocol writeFieldBeginWithName: @"expiration" type: TType_I64 fieldID: 3]; + [outProtocol writeI64: __expiration]; + [outProtocol writeFieldEnd]; + } + if (__user_isset) { + if (__user != nil) { + [outProtocol writeFieldBeginWithName: @"user" type: TType_STRUCT fieldID: 4]; + [__user write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + if (__publicUserInfo_isset) { + if (__publicUserInfo != nil) { + [outProtocol writeFieldBeginWithName: @"publicUserInfo" type: TType_STRUCT fieldID: 5]; + [__publicUserInfo write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"AuthenticationResult("]; + [ms appendString: @"currentTime:"]; + [ms appendFormat: @"%qi", __currentTime]; + [ms appendString: @",authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @",expiration:"]; + [ms appendFormat: @"%qi", __expiration]; + [ms appendString: @",user:"]; + [ms appendFormat: @"%@", __user]; + [ms appendString: @",publicUserInfo:"]; + [ms appendFormat: @"%@", __publicUserInfo]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMcheckVersion_args : NSObject { + NSString * __clientName; + int16_t __edamVersionMajor; + int16_t __edamVersionMinor; + + BOOL __clientName_isset; + BOOL __edamVersionMajor_isset; + BOOL __edamVersionMinor_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=clientName, setter=setClientName:) NSString * clientName; +@property (nonatomic, getter=edamVersionMajor, setter=setEdamVersionMajor:) int16_t edamVersionMajor; +@property (nonatomic, getter=edamVersionMinor, setter=setEdamVersionMinor:) int16_t edamVersionMinor; +#endif + +- (id) initWithClientName: (NSString *) clientName edamVersionMajor: (int16_t) edamVersionMajor edamVersionMinor: (int16_t) edamVersionMinor; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) clientName; +- (void) setClientName: (NSString *) clientName; +- (BOOL) clientNameIsSet; + +- (int16_t) edamVersionMajor; +- (void) setEdamVersionMajor: (int16_t) edamVersionMajor; +- (BOOL) edamVersionMajorIsSet; + +- (int16_t) edamVersionMinor; +- (void) setEdamVersionMinor: (int16_t) edamVersionMinor; +- (BOOL) edamVersionMinorIsSet; + +@end + +@implementation EDAMcheckVersion_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic clientName; +@dynamic edamVersionMajor; +@dynamic edamVersionMinor; +#endif + +- (id) initWithClientName: (NSString *) clientName edamVersionMajor: (int16_t) edamVersionMajor edamVersionMinor: (int16_t) edamVersionMinor +{ + self = [super init]; + __clientName = [clientName retain]; + __clientName_isset = YES; + __edamVersionMajor = edamVersionMajor; + __edamVersionMajor_isset = YES; + __edamVersionMinor = edamVersionMinor; + __edamVersionMinor_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"clientName"]) + { + __clientName = [[decoder decodeObjectForKey: @"clientName"] retain]; + __clientName_isset = YES; + } + if ([decoder containsValueForKey: @"edamVersionMajor"]) + { + __edamVersionMajor = [decoder decodeIntForKey: @"edamVersionMajor"]; + __edamVersionMajor_isset = YES; + } + if ([decoder containsValueForKey: @"edamVersionMinor"]) + { + __edamVersionMinor = [decoder decodeIntForKey: @"edamVersionMinor"]; + __edamVersionMinor_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__clientName_isset) + { + [encoder encodeObject: __clientName forKey: @"clientName"]; + } + if (__edamVersionMajor_isset) + { + [encoder encodeInt: __edamVersionMajor forKey: @"edamVersionMajor"]; + } + if (__edamVersionMinor_isset) + { + [encoder encodeInt: __edamVersionMinor forKey: @"edamVersionMinor"]; + } +} + +- (void) dealloc +{ + [__clientName release]; + [super dealloc]; +} + +- (NSString *) clientName { + return [[__clientName retain] autorelease]; +} + +- (void) setClientName: (NSString *) clientName { + [clientName retain]; + [__clientName release]; + __clientName = clientName; + __clientName_isset = YES; +} + +- (BOOL) clientNameIsSet { + return __clientName_isset; +} + +- (void) unsetClientName { + [__clientName release]; + __clientName = nil; + __clientName_isset = NO; +} + +- (int16_t) edamVersionMajor { + return __edamVersionMajor; +} + +- (void) setEdamVersionMajor: (int16_t) edamVersionMajor { + __edamVersionMajor = edamVersionMajor; + __edamVersionMajor_isset = YES; +} + +- (BOOL) edamVersionMajorIsSet { + return __edamVersionMajor_isset; +} + +- (void) unsetEdamVersionMajor { + __edamVersionMajor_isset = NO; +} + +- (int16_t) edamVersionMinor { + return __edamVersionMinor; +} + +- (void) setEdamVersionMinor: (int16_t) edamVersionMinor { + __edamVersionMinor = edamVersionMinor; + __edamVersionMinor_isset = YES; +} + +- (BOOL) edamVersionMinorIsSet { + return __edamVersionMinor_isset; +} + +- (void) unsetEdamVersionMinor { + __edamVersionMinor_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setClientName: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_I16) { + int16_t fieldValue = [inProtocol readI16]; + [self setEdamVersionMajor: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_I16) { + int16_t fieldValue = [inProtocol readI16]; + [self setEdamVersionMinor: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"checkVersion_args"]; + if (__clientName_isset) { + if (__clientName != nil) { + [outProtocol writeFieldBeginWithName: @"clientName" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __clientName]; + [outProtocol writeFieldEnd]; + } + } + if (__edamVersionMajor_isset) { + [outProtocol writeFieldBeginWithName: @"edamVersionMajor" type: TType_I16 fieldID: 2]; + [outProtocol writeI16: __edamVersionMajor]; + [outProtocol writeFieldEnd]; + } + if (__edamVersionMinor_isset) { + [outProtocol writeFieldBeginWithName: @"edamVersionMinor" type: TType_I16 fieldID: 3]; + [outProtocol writeI16: __edamVersionMinor]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"checkVersion_args("]; + [ms appendString: @"clientName:"]; + [ms appendFormat: @"\"%@\"", __clientName]; + [ms appendString: @",edamVersionMajor:"]; + [ms appendFormat: @"%hi", __edamVersionMajor]; + [ms appendString: @",edamVersionMinor:"]; + [ms appendFormat: @"%hi", __edamVersionMinor]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMCheckVersion_result : NSObject { + BOOL __success; + + BOOL __success_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, getter=success, setter=setSuccess:) BOOL success; +#endif + +- (id) initWithSuccess: (BOOL) success; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (BOOL) success; +- (void) setSuccess: (BOOL) success; +- (BOOL) successIsSet; + +@end + +@implementation EDAMCheckVersion_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +#endif + +- (id) initWithSuccess: (BOOL) success +{ + self = [super init]; + __success = success; + __success_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [decoder decodeBoolForKey: @"success"]; + __success_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeBool: __success forKey: @"success"]; + } +} + +- (void) dealloc +{ + [super dealloc]; +} + +- (BOOL) success { + return __success; +} + +- (void) setSuccess: (BOOL) success { + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + __success_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_BOOL) { + BOOL fieldValue = [inProtocol readBool]; + [self setSuccess: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"CheckVersion_result"]; + + if (__success_isset) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_BOOL fieldID: 0]; + [outProtocol writeBool: __success]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"CheckVersion_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%i", __success]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMauthenticate_args : NSObject { + NSString * __username; + NSString * __password; + NSString * __consumerKey; + NSString * __consumerSecret; + + BOOL __username_isset; + BOOL __password_isset; + BOOL __consumerKey_isset; + BOOL __consumerSecret_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=username, setter=setUsername:) NSString * username; +@property (nonatomic, retain, getter=password, setter=setPassword:) NSString * password; +@property (nonatomic, retain, getter=consumerKey, setter=setConsumerKey:) NSString * consumerKey; +@property (nonatomic, retain, getter=consumerSecret, setter=setConsumerSecret:) NSString * consumerSecret; +#endif + +- (id) initWithUsername: (NSString *) username password: (NSString *) password consumerKey: (NSString *) consumerKey consumerSecret: (NSString *) consumerSecret; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) username; +- (void) setUsername: (NSString *) username; +- (BOOL) usernameIsSet; + +- (NSString *) password; +- (void) setPassword: (NSString *) password; +- (BOOL) passwordIsSet; + +- (NSString *) consumerKey; +- (void) setConsumerKey: (NSString *) consumerKey; +- (BOOL) consumerKeyIsSet; + +- (NSString *) consumerSecret; +- (void) setConsumerSecret: (NSString *) consumerSecret; +- (BOOL) consumerSecretIsSet; + +@end + +@implementation EDAMauthenticate_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic username; +@dynamic password; +@dynamic consumerKey; +@dynamic consumerSecret; +#endif + +- (id) initWithUsername: (NSString *) username password: (NSString *) password consumerKey: (NSString *) consumerKey consumerSecret: (NSString *) consumerSecret +{ + self = [super init]; + __username = [username retain]; + __username_isset = YES; + __password = [password retain]; + __password_isset = YES; + __consumerKey = [consumerKey retain]; + __consumerKey_isset = YES; + __consumerSecret = [consumerSecret retain]; + __consumerSecret_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"username"]) + { + __username = [[decoder decodeObjectForKey: @"username"] retain]; + __username_isset = YES; + } + if ([decoder containsValueForKey: @"password"]) + { + __password = [[decoder decodeObjectForKey: @"password"] retain]; + __password_isset = YES; + } + if ([decoder containsValueForKey: @"consumerKey"]) + { + __consumerKey = [[decoder decodeObjectForKey: @"consumerKey"] retain]; + __consumerKey_isset = YES; + } + if ([decoder containsValueForKey: @"consumerSecret"]) + { + __consumerSecret = [[decoder decodeObjectForKey: @"consumerSecret"] retain]; + __consumerSecret_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__username_isset) + { + [encoder encodeObject: __username forKey: @"username"]; + } + if (__password_isset) + { + [encoder encodeObject: __password forKey: @"password"]; + } + if (__consumerKey_isset) + { + [encoder encodeObject: __consumerKey forKey: @"consumerKey"]; + } + if (__consumerSecret_isset) + { + [encoder encodeObject: __consumerSecret forKey: @"consumerSecret"]; + } +} + +- (void) dealloc +{ + [__username release]; + [__password release]; + [__consumerKey release]; + [__consumerSecret release]; + [super dealloc]; +} + +- (NSString *) username { + return [[__username retain] autorelease]; +} + +- (void) setUsername: (NSString *) username { + [username retain]; + [__username release]; + __username = username; + __username_isset = YES; +} + +- (BOOL) usernameIsSet { + return __username_isset; +} + +- (void) unsetUsername { + [__username release]; + __username = nil; + __username_isset = NO; +} + +- (NSString *) password { + return [[__password retain] autorelease]; +} + +- (void) setPassword: (NSString *) password { + [password retain]; + [__password release]; + __password = password; + __password_isset = YES; +} + +- (BOOL) passwordIsSet { + return __password_isset; +} + +- (void) unsetPassword { + [__password release]; + __password = nil; + __password_isset = NO; +} + +- (NSString *) consumerKey { + return [[__consumerKey retain] autorelease]; +} + +- (void) setConsumerKey: (NSString *) consumerKey { + [consumerKey retain]; + [__consumerKey release]; + __consumerKey = consumerKey; + __consumerKey_isset = YES; +} + +- (BOOL) consumerKeyIsSet { + return __consumerKey_isset; +} + +- (void) unsetConsumerKey { + [__consumerKey release]; + __consumerKey = nil; + __consumerKey_isset = NO; +} + +- (NSString *) consumerSecret { + return [[__consumerSecret retain] autorelease]; +} + +- (void) setConsumerSecret: (NSString *) consumerSecret { + [consumerSecret retain]; + [__consumerSecret release]; + __consumerSecret = consumerSecret; + __consumerSecret_isset = YES; +} + +- (BOOL) consumerSecretIsSet { + return __consumerSecret_isset; +} + +- (void) unsetConsumerSecret { + [__consumerSecret release]; + __consumerSecret = nil; + __consumerSecret_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setUsername: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setPassword: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setConsumerKey: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 4: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setConsumerSecret: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"authenticate_args"]; + if (__username_isset) { + if (__username != nil) { + [outProtocol writeFieldBeginWithName: @"username" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __username]; + [outProtocol writeFieldEnd]; + } + } + if (__password_isset) { + if (__password != nil) { + [outProtocol writeFieldBeginWithName: @"password" type: TType_STRING fieldID: 2]; + [outProtocol writeString: __password]; + [outProtocol writeFieldEnd]; + } + } + if (__consumerKey_isset) { + if (__consumerKey != nil) { + [outProtocol writeFieldBeginWithName: @"consumerKey" type: TType_STRING fieldID: 3]; + [outProtocol writeString: __consumerKey]; + [outProtocol writeFieldEnd]; + } + } + if (__consumerSecret_isset) { + if (__consumerSecret != nil) { + [outProtocol writeFieldBeginWithName: @"consumerSecret" type: TType_STRING fieldID: 4]; + [outProtocol writeString: __consumerSecret]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"authenticate_args("]; + [ms appendString: @"username:"]; + [ms appendFormat: @"\"%@\"", __username]; + [ms appendString: @",password:"]; + [ms appendFormat: @"\"%@\"", __password]; + [ms appendString: @",consumerKey:"]; + [ms appendFormat: @"\"%@\"", __consumerKey]; + [ms appendString: @",consumerSecret:"]; + [ms appendFormat: @"\"%@\"", __consumerSecret]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMAuthenticate_result : NSObject { + EDAMAuthenticationResult * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMAuthenticationResult * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (EDAMAuthenticationResult *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMAuthenticationResult *) success; +- (void) setSuccess: (EDAMAuthenticationResult *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMAuthenticate_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (EDAMAuthenticationResult *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [super dealloc]; +} + +- (EDAMAuthenticationResult *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMAuthenticationResult *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMAuthenticationResult *fieldValue = [[EDAMAuthenticationResult alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"Authenticate_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"Authenticate_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMrefreshAuthentication_args : NSObject { + NSString * __authenticationToken; + + BOOL __authenticationToken_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +@end + +@implementation EDAMrefreshAuthentication_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"refreshAuthentication_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"refreshAuthentication_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMRefreshAuthentication_result : NSObject { + EDAMAuthenticationResult * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMAuthenticationResult * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (EDAMAuthenticationResult *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMAuthenticationResult *) success; +- (void) setSuccess: (EDAMAuthenticationResult *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMRefreshAuthentication_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (EDAMAuthenticationResult *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [super dealloc]; +} + +- (EDAMAuthenticationResult *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMAuthenticationResult *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMAuthenticationResult *fieldValue = [[EDAMAuthenticationResult alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"RefreshAuthentication_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"RefreshAuthentication_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetUser_args : NSObject { + NSString * __authenticationToken; + + BOOL __authenticationToken_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=authenticationToken, setter=setAuthenticationToken:) NSString * authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) authenticationToken; +- (void) setAuthenticationToken: (NSString *) authenticationToken; +- (BOOL) authenticationTokenIsSet; + +@end + +@implementation EDAMgetUser_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic authenticationToken; +#endif + +- (id) initWithAuthenticationToken: (NSString *) authenticationToken +{ + self = [super init]; + __authenticationToken = [authenticationToken retain]; + __authenticationToken_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"authenticationToken"]) + { + __authenticationToken = [[decoder decodeObjectForKey: @"authenticationToken"] retain]; + __authenticationToken_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__authenticationToken_isset) + { + [encoder encodeObject: __authenticationToken forKey: @"authenticationToken"]; + } +} + +- (void) dealloc +{ + [__authenticationToken release]; + [super dealloc]; +} + +- (NSString *) authenticationToken { + return [[__authenticationToken retain] autorelease]; +} + +- (void) setAuthenticationToken: (NSString *) authenticationToken { + [authenticationToken retain]; + [__authenticationToken release]; + __authenticationToken = authenticationToken; + __authenticationToken_isset = YES; +} + +- (BOOL) authenticationTokenIsSet { + return __authenticationToken_isset; +} + +- (void) unsetAuthenticationToken { + [__authenticationToken release]; + __authenticationToken = nil; + __authenticationToken_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setAuthenticationToken: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getUser_args"]; + if (__authenticationToken_isset) { + if (__authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __authenticationToken]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getUser_args("]; + [ms appendString: @"authenticationToken:"]; + [ms appendFormat: @"\"%@\"", __authenticationToken]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetUser_result : NSObject { + EDAMUser * __success; + EDAMUserException * __userException; + EDAMSystemException * __systemException; + + BOOL __success_isset; + BOOL __userException_isset; + BOOL __systemException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMUser * success; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +#endif + +- (id) initWithSuccess: (EDAMUser *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMUser *) success; +- (void) setSuccess: (EDAMUser *) success; +- (BOOL) successIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +@end + +@implementation EDAMGetUser_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic userException; +@dynamic systemException; +#endif + +- (id) initWithSuccess: (EDAMUser *) success userException: (EDAMUserException *) userException systemException: (EDAMSystemException *) systemException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__userException release]; + [__systemException release]; + [super dealloc]; +} + +- (EDAMUser *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMUser *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMUser *fieldValue = [[EDAMUser alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetUser_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 1]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetUser_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMgetPublicUserInfo_args : NSObject { + NSString * __username; + + BOOL __username_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=username, setter=setUsername:) NSString * username; +#endif + +- (id) initWithUsername: (NSString *) username; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (NSString *) username; +- (void) setUsername: (NSString *) username; +- (BOOL) usernameIsSet; + +@end + +@implementation EDAMgetPublicUserInfo_args + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic username; +#endif + +- (id) initWithUsername: (NSString *) username +{ + self = [super init]; + __username = [username retain]; + __username_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"username"]) + { + __username = [[decoder decodeObjectForKey: @"username"] retain]; + __username_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__username_isset) + { + [encoder encodeObject: __username forKey: @"username"]; + } +} + +- (void) dealloc +{ + [__username release]; + [super dealloc]; +} + +- (NSString *) username { + return [[__username retain] autorelease]; +} + +- (void) setUsername: (NSString *) username { + [username retain]; + [__username release]; + __username = username; + __username_isset = YES; +} + +- (BOOL) usernameIsSet { + return __username_isset; +} + +- (void) unsetUsername { + [__username release]; + __username = nil; + __username_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 1: + if (fieldType == TType_STRING) { + NSString * fieldValue = [inProtocol readString]; + [self setUsername: fieldValue]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"getPublicUserInfo_args"]; + if (__username_isset) { + if (__username != nil) { + [outProtocol writeFieldBeginWithName: @"username" type: TType_STRING fieldID: 1]; + [outProtocol writeString: __username]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"getPublicUserInfo_args("]; + [ms appendString: @"username:"]; + [ms appendFormat: @"\"%@\"", __username]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@interface EDAMGetPublicUserInfo_result : NSObject { + EDAMPublicUserInfo * __success; + EDAMNotFoundException * __notFoundException; + EDAMSystemException * __systemException; + EDAMUserException * __userException; + + BOOL __success_isset; + BOOL __notFoundException_isset; + BOOL __systemException_isset; + BOOL __userException_isset; +} + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@property (nonatomic, retain, getter=success, setter=setSuccess:) EDAMPublicUserInfo * success; +@property (nonatomic, retain, getter=notFoundException, setter=setNotFoundException:) EDAMNotFoundException * notFoundException; +@property (nonatomic, retain, getter=systemException, setter=setSystemException:) EDAMSystemException * systemException; +@property (nonatomic, retain, getter=userException, setter=setUserException:) EDAMUserException * userException; +#endif + +- (id) initWithSuccess: (EDAMPublicUserInfo *) success notFoundException: (EDAMNotFoundException *) notFoundException systemException: (EDAMSystemException *) systemException userException: (EDAMUserException *) userException; + +- (void) read: (id ) inProtocol; +- (void) write: (id ) outProtocol; + +- (EDAMPublicUserInfo *) success; +- (void) setSuccess: (EDAMPublicUserInfo *) success; +- (BOOL) successIsSet; + +- (EDAMNotFoundException *) notFoundException; +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException; +- (BOOL) notFoundExceptionIsSet; + +- (EDAMSystemException *) systemException; +- (void) setSystemException: (EDAMSystemException *) systemException; +- (BOOL) systemExceptionIsSet; + +- (EDAMUserException *) userException; +- (void) setUserException: (EDAMUserException *) userException; +- (BOOL) userExceptionIsSet; + +@end + +@implementation EDAMGetPublicUserInfo_result + +#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) +@dynamic success; +@dynamic notFoundException; +@dynamic systemException; +@dynamic userException; +#endif + +- (id) initWithSuccess: (EDAMPublicUserInfo *) success notFoundException: (EDAMNotFoundException *) notFoundException systemException: (EDAMSystemException *) systemException userException: (EDAMUserException *) userException +{ + self = [super init]; + __success = [success retain]; + __success_isset = YES; + __notFoundException = [notFoundException retain]; + __notFoundException_isset = YES; + __systemException = [systemException retain]; + __systemException_isset = YES; + __userException = [userException retain]; + __userException_isset = YES; + return self; +} + +- (id) initWithCoder: (NSCoder *) decoder +{ + self = [super init]; + if ([decoder containsValueForKey: @"success"]) + { + __success = [[decoder decodeObjectForKey: @"success"] retain]; + __success_isset = YES; + } + if ([decoder containsValueForKey: @"notFoundException"]) + { + __notFoundException = [[decoder decodeObjectForKey: @"notFoundException"] retain]; + __notFoundException_isset = YES; + } + if ([decoder containsValueForKey: @"systemException"]) + { + __systemException = [[decoder decodeObjectForKey: @"systemException"] retain]; + __systemException_isset = YES; + } + if ([decoder containsValueForKey: @"userException"]) + { + __userException = [[decoder decodeObjectForKey: @"userException"] retain]; + __userException_isset = YES; + } + return self; +} + +- (void) encodeWithCoder: (NSCoder *) encoder +{ + if (__success_isset) + { + [encoder encodeObject: __success forKey: @"success"]; + } + if (__notFoundException_isset) + { + [encoder encodeObject: __notFoundException forKey: @"notFoundException"]; + } + if (__systemException_isset) + { + [encoder encodeObject: __systemException forKey: @"systemException"]; + } + if (__userException_isset) + { + [encoder encodeObject: __userException forKey: @"userException"]; + } +} + +- (void) dealloc +{ + [__success release]; + [__notFoundException release]; + [__systemException release]; + [__userException release]; + [super dealloc]; +} + +- (EDAMPublicUserInfo *) success { + return [[__success retain] autorelease]; +} + +- (void) setSuccess: (EDAMPublicUserInfo *) success { + [success retain]; + [__success release]; + __success = success; + __success_isset = YES; +} + +- (BOOL) successIsSet { + return __success_isset; +} + +- (void) unsetSuccess { + [__success release]; + __success = nil; + __success_isset = NO; +} + +- (EDAMNotFoundException *) notFoundException { + return [[__notFoundException retain] autorelease]; +} + +- (void) setNotFoundException: (EDAMNotFoundException *) notFoundException { + [notFoundException retain]; + [__notFoundException release]; + __notFoundException = notFoundException; + __notFoundException_isset = YES; +} + +- (BOOL) notFoundExceptionIsSet { + return __notFoundException_isset; +} + +- (void) unsetNotFoundException { + [__notFoundException release]; + __notFoundException = nil; + __notFoundException_isset = NO; +} + +- (EDAMSystemException *) systemException { + return [[__systemException retain] autorelease]; +} + +- (void) setSystemException: (EDAMSystemException *) systemException { + [systemException retain]; + [__systemException release]; + __systemException = systemException; + __systemException_isset = YES; +} + +- (BOOL) systemExceptionIsSet { + return __systemException_isset; +} + +- (void) unsetSystemException { + [__systemException release]; + __systemException = nil; + __systemException_isset = NO; +} + +- (EDAMUserException *) userException { + return [[__userException retain] autorelease]; +} + +- (void) setUserException: (EDAMUserException *) userException { + [userException retain]; + [__userException release]; + __userException = userException; + __userException_isset = YES; +} + +- (BOOL) userExceptionIsSet { + return __userException_isset; +} + +- (void) unsetUserException { + [__userException release]; + __userException = nil; + __userException_isset = NO; +} + +- (void) read: (id ) inProtocol +{ + NSString * fieldName; + int fieldType; + int fieldID; + + [inProtocol readStructBeginReturningName: NULL]; + while (true) + { + [inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) + { + case 0: + if (fieldType == TType_STRUCT) { + EDAMPublicUserInfo *fieldValue = [[EDAMPublicUserInfo alloc] init]; + [fieldValue read: inProtocol]; + [self setSuccess: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 1: + if (fieldType == TType_STRUCT) { + EDAMNotFoundException *fieldValue = [[EDAMNotFoundException alloc] init]; + [fieldValue read: inProtocol]; + [self setNotFoundException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 2: + if (fieldType == TType_STRUCT) { + EDAMSystemException *fieldValue = [[EDAMSystemException alloc] init]; + [fieldValue read: inProtocol]; + [self setSystemException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + case 3: + if (fieldType == TType_STRUCT) { + EDAMUserException *fieldValue = [[EDAMUserException alloc] init]; + [fieldValue read: inProtocol]; + [self setUserException: fieldValue]; + [fieldValue release]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: inProtocol]; + break; + } + [inProtocol readFieldEnd]; + } + [inProtocol readStructEnd]; +} + +- (void) write: (id ) outProtocol { + [outProtocol writeStructBeginWithName: @"GetPublicUserInfo_result"]; + + if (__success_isset) { + if (__success != nil) { + [outProtocol writeFieldBeginWithName: @"success" type: TType_STRUCT fieldID: 0]; + [__success write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__notFoundException_isset) { + if (__notFoundException != nil) { + [outProtocol writeFieldBeginWithName: @"notFoundException" type: TType_STRUCT fieldID: 1]; + [__notFoundException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__systemException_isset) { + if (__systemException != nil) { + [outProtocol writeFieldBeginWithName: @"systemException" type: TType_STRUCT fieldID: 2]; + [__systemException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } else if (__userException_isset) { + if (__userException != nil) { + [outProtocol writeFieldBeginWithName: @"userException" type: TType_STRUCT fieldID: 3]; + [__userException write: outProtocol]; + [outProtocol writeFieldEnd]; + } + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; +} + +- (NSString *) description { + NSMutableString * ms = [NSMutableString stringWithString: @"GetPublicUserInfo_result("]; + [ms appendString: @"success:"]; + [ms appendFormat: @"%@", __success]; + [ms appendString: @",notFoundException:"]; + [ms appendFormat: @"%@", __notFoundException]; + [ms appendString: @",systemException:"]; + [ms appendFormat: @"%@", __systemException]; + [ms appendString: @",userException:"]; + [ms appendFormat: @"%@", __userException]; + [ms appendString: @")"]; + return [NSString stringWithString: ms]; +} + +@end + +@implementation EDAMUserStoreClient +- (id) initWithProtocol: (id ) protocol +{ + return [self initWithInProtocol: protocol outProtocol: protocol]; +} + +- (id) initWithInProtocol: (id ) anInProtocol outProtocol: (id ) anOutProtocol +{ + [super init]; + inProtocol = [anInProtocol retain]; + outProtocol = [anOutProtocol retain]; + return self; +} + +- (void) dealloc +{ + [inProtocol release]; + [outProtocol release]; + [super dealloc]; +} + +- (void) send_checkVersion: (NSString *) clientName : (int16_t) edamVersionMajor : (int16_t) edamVersionMinor +{ + [outProtocol writeMessageBeginWithName: @"checkVersion" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"checkVersion_args"]; + if (clientName != nil) { + [outProtocol writeFieldBeginWithName: @"clientName" type: TType_STRING fieldID: 1]; + [outProtocol writeString: clientName]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldBeginWithName: @"edamVersionMajor" type: TType_I16 fieldID: 2]; + [outProtocol writeI16: edamVersionMajor]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldBeginWithName: @"edamVersionMinor" type: TType_I16 fieldID: 3]; + [outProtocol writeI16: edamVersionMinor]; + [outProtocol writeFieldEnd]; + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (BOOL) recv_checkVersion +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMCheckVersion_result * result = [[[EDAMCheckVersion_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"checkVersion failed: unknown result"]; +} + +- (BOOL) checkVersion: (NSString *) clientName : (int16_t) edamVersionMajor : (int16_t) edamVersionMinor +{ + [self send_checkVersion: clientName : edamVersionMajor : edamVersionMinor]; + return [self recv_checkVersion]; +} + +- (void) send_authenticate: (NSString *) username : (NSString *) password : (NSString *) consumerKey : (NSString *) consumerSecret +{ + [outProtocol writeMessageBeginWithName: @"authenticate" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"authenticate_args"]; + if (username != nil) { + [outProtocol writeFieldBeginWithName: @"username" type: TType_STRING fieldID: 1]; + [outProtocol writeString: username]; + [outProtocol writeFieldEnd]; + } + if (password != nil) { + [outProtocol writeFieldBeginWithName: @"password" type: TType_STRING fieldID: 2]; + [outProtocol writeString: password]; + [outProtocol writeFieldEnd]; + } + if (consumerKey != nil) { + [outProtocol writeFieldBeginWithName: @"consumerKey" type: TType_STRING fieldID: 3]; + [outProtocol writeString: consumerKey]; + [outProtocol writeFieldEnd]; + } + if (consumerSecret != nil) { + [outProtocol writeFieldBeginWithName: @"consumerSecret" type: TType_STRING fieldID: 4]; + [outProtocol writeString: consumerSecret]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMAuthenticationResult *) recv_authenticate +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMAuthenticate_result * result = [[[EDAMAuthenticate_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"authenticate failed: unknown result"]; +} + +- (EDAMAuthenticationResult *) authenticate: (NSString *) username : (NSString *) password : (NSString *) consumerKey : (NSString *) consumerSecret +{ + [self send_authenticate: username : password : consumerKey : consumerSecret]; + return [self recv_authenticate]; +} + +- (void) send_refreshAuthentication: (NSString *) authenticationToken +{ + [outProtocol writeMessageBeginWithName: @"refreshAuthentication" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"refreshAuthentication_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMAuthenticationResult *) recv_refreshAuthentication +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMRefreshAuthentication_result * result = [[[EDAMRefreshAuthentication_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"refreshAuthentication failed: unknown result"]; +} + +- (EDAMAuthenticationResult *) refreshAuthentication: (NSString *) authenticationToken +{ + [self send_refreshAuthentication: authenticationToken]; + return [self recv_refreshAuthentication]; +} + +- (void) send_getUser: (NSString *) authenticationToken +{ + [outProtocol writeMessageBeginWithName: @"getUser" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getUser_args"]; + if (authenticationToken != nil) { + [outProtocol writeFieldBeginWithName: @"authenticationToken" type: TType_STRING fieldID: 1]; + [outProtocol writeString: authenticationToken]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMUser *) recv_getUser +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetUser_result * result = [[[EDAMGetUser_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getUser failed: unknown result"]; +} + +- (EDAMUser *) getUser: (NSString *) authenticationToken +{ + [self send_getUser: authenticationToken]; + return [self recv_getUser]; +} + +- (void) send_getPublicUserInfo: (NSString *) username +{ + [outProtocol writeMessageBeginWithName: @"getPublicUserInfo" type: TMessageType_CALL sequenceID: 0]; + [outProtocol writeStructBeginWithName: @"getPublicUserInfo_args"]; + if (username != nil) { + [outProtocol writeFieldBeginWithName: @"username" type: TType_STRING fieldID: 1]; + [outProtocol writeString: username]; + [outProtocol writeFieldEnd]; + } + [outProtocol writeFieldStop]; + [outProtocol writeStructEnd]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; +} + +- (EDAMPublicUserInfo *) recv_getPublicUserInfo +{ + int msgType = 0; + [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL]; + if (msgType == TMessageType_EXCEPTION) { + TApplicationException * x = [TApplicationException read: inProtocol]; + [inProtocol readMessageEnd]; + @throw x; + } + EDAMGetPublicUserInfo_result * result = [[[EDAMGetPublicUserInfo_result alloc] init] autorelease]; + [result read: inProtocol]; + [inProtocol readMessageEnd]; + if ([result successIsSet]) { + return [result success]; + } + if ([result notFoundExceptionIsSet]) { + @throw [result notFoundException]; + } + if ([result systemExceptionIsSet]) { + @throw [result systemException]; + } + if ([result userExceptionIsSet]) { + @throw [result userException]; + } + @throw [TApplicationException exceptionWithType: TApplicationException_MISSING_RESULT + reason: @"getPublicUserInfo failed: unknown result"]; +} + +- (EDAMPublicUserInfo *) getPublicUserInfo: (NSString *) username +{ + [self send_getPublicUserInfo: username]; + return [self recv_getPublicUserInfo]; +} + +@end + +@implementation EDAMUserStoreProcessor + +- (id) initWithUserStore: (id ) service +{ + self = [super init]; + if (!self) { + return nil; + } + mService = [service retain]; + mMethodMap = [[NSMutableDictionary dictionary] retain]; + { + SEL s = @selector(process_checkVersion_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"checkVersion"]; + } + { + SEL s = @selector(process_authenticate_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"authenticate"]; + } + { + SEL s = @selector(process_refreshAuthentication_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"refreshAuthentication"]; + } + { + SEL s = @selector(process_getUser_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getUser"]; + } + { + SEL s = @selector(process_getPublicUserInfo_withSequenceID:inProtocol:outProtocol:); + NSMethodSignature * sig = [self methodSignatureForSelector: s]; + NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig]; + [invocation setSelector: s]; + [invocation retainArguments]; + [mMethodMap setValue: invocation forKey: @"getPublicUserInfo"]; + } + return self; +} + +- (id) service +{ + return [[mService retain] autorelease]; +} + +- (BOOL) processOnInputProtocol: (id ) inProtocol + outputProtocol: (id ) outProtocol +{ + NSString * messageName; + int messageType; + int seqID; + [inProtocol readMessageBeginReturningName: &messageName + type: &messageType + sequenceID: &seqID]; + NSInvocation * invocation = [mMethodMap valueForKey: messageName]; + if (invocation == nil) { + [TProtocolUtil skipType: TType_STRUCT onProtocol: inProtocol]; + [inProtocol readMessageEnd]; + TApplicationException * x = [TApplicationException exceptionWithType: TApplicationException_UNKNOWN_METHOD reason: [NSString stringWithFormat: @"Invalid method name: '%@'", messageName]]; + [outProtocol writeMessageBeginWithName: messageName + type: TMessageType_EXCEPTION + sequenceID: seqID]; + [x write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + return YES; + } + // NSInvocation does not conform to NSCopying protocol + NSInvocation * i = [NSInvocation invocationWithMethodSignature: [invocation methodSignature]]; + [i setSelector: [invocation selector]]; + [i setArgument: &seqID atIndex: 2]; + [i setArgument: &inProtocol atIndex: 3]; + [i setArgument: &outProtocol atIndex: 4]; + [i setTarget: self]; + [i invoke]; + return YES; +} + +- (void) process_checkVersion_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMcheckVersion_args * args = [[EDAMcheckVersion_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMCheckVersion_result * result = [[EDAMCheckVersion_result alloc] init]; + [result setSuccess: [mService checkVersion: [args clientName]: [args edamVersionMajor]: [args edamVersionMinor]]]; + [outProtocol writeMessageBeginWithName: @"checkVersion" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_authenticate_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMauthenticate_args * args = [[EDAMauthenticate_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMAuthenticate_result * result = [[EDAMAuthenticate_result alloc] init]; + [result setSuccess: [mService authenticate: [args username]: [args password]: [args consumerKey]: [args consumerSecret]]]; + [outProtocol writeMessageBeginWithName: @"authenticate" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_refreshAuthentication_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMrefreshAuthentication_args * args = [[EDAMrefreshAuthentication_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMRefreshAuthentication_result * result = [[EDAMRefreshAuthentication_result alloc] init]; + [result setSuccess: [mService refreshAuthentication: [args authenticationToken]]]; + [outProtocol writeMessageBeginWithName: @"refreshAuthentication" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getUser_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetUser_args * args = [[EDAMgetUser_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetUser_result * result = [[EDAMGetUser_result alloc] init]; + [result setSuccess: [mService getUser: [args authenticationToken]]]; + [outProtocol writeMessageBeginWithName: @"getUser" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) process_getPublicUserInfo_withSequenceID: (int32_t) seqID inProtocol: (id) inProtocol outProtocol: (id) outProtocol +{ + EDAMgetPublicUserInfo_args * args = [[EDAMgetPublicUserInfo_args alloc] init]; + [args read: inProtocol]; + [inProtocol readMessageEnd]; + EDAMGetPublicUserInfo_result * result = [[EDAMGetPublicUserInfo_result alloc] init]; + [result setSuccess: [mService getPublicUserInfo: [args username]]]; + [outProtocol writeMessageBeginWithName: @"getPublicUserInfo" + type: TMessageType_REPLY + sequenceID: seqID]; + [result write: outProtocol]; + [outProtocol writeMessageEnd]; + [[outProtocol transport] flush]; + [result release]; + [args release]; +} + +- (void) dealloc +{ + [mService release]; + [mMethodMap release]; + [super dealloc]; +} + +@end + diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TApplicationException.h b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TApplicationException.h new file mode 100644 index 00000000..cf1641d9 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TApplicationException.h @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import "TException.h" +#import "TProtocol.h" + +enum { + TApplicationException_UNKNOWN = 0, + TApplicationException_UNKNOWN_METHOD = 1, + TApplicationException_INVALID_MESSAGE_TYPE = 2, + TApplicationException_WRONG_METHOD_NAME = 3, + TApplicationException_BAD_SEQUENCE_ID = 4, + TApplicationException_MISSING_RESULT = 5 +}; + +// FIXME +@interface TApplicationException : TException { + int mType; +} + ++ (TApplicationException *) read: (id ) protocol; + +- (void) write: (id ) protocol; + ++ (TApplicationException *) exceptionWithType: (int) type + reason: (NSString *) message; + +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TApplicationException.m b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TApplicationException.m new file mode 100644 index 00000000..70687537 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TApplicationException.m @@ -0,0 +1,130 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import "TApplicationException.h" +#import "TProtocolUtil.h" + +@implementation TApplicationException + +- (id) initWithType: (int) type + reason: (NSString *) reason +{ + mType = type; + + NSString * name; + switch (type) { + case TApplicationException_UNKNOWN_METHOD: + name = @"Unknown method"; + break; + case TApplicationException_INVALID_MESSAGE_TYPE: + name = @"Invalid message type"; + break; + case TApplicationException_WRONG_METHOD_NAME: + name = @"Wrong method name"; + break; + case TApplicationException_BAD_SEQUENCE_ID: + name = @"Bad sequence ID"; + break; + case TApplicationException_MISSING_RESULT: + name = @"Missing result"; + break; + default: + name = @"Unknown"; + break; + } + + self = [super initWithName: name reason: reason userInfo: nil]; + return self; +} + + ++ (TApplicationException *) read: (id ) protocol +{ + NSString * reason = nil; + int type = TApplicationException_UNKNOWN; + int fieldType; + int fieldID; + + [protocol readStructBeginReturningName: NULL]; + + while (true) { + [protocol readFieldBeginReturningName: NULL + type: &fieldType + fieldID: &fieldID]; + if (fieldType == TType_STOP) { + break; + } + switch (fieldID) { + case 1: + if (fieldType == TType_STRING) { + reason = [protocol readString]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: protocol]; + } + break; + case 2: + if (fieldType == TType_I32) { + type = [protocol readI32]; + } else { + [TProtocolUtil skipType: fieldType onProtocol: protocol]; + } + break; + default: + [TProtocolUtil skipType: fieldType onProtocol: protocol]; + break; + } + [protocol readFieldEnd]; + } + [protocol readStructEnd]; + + return [TApplicationException exceptionWithType: type reason: reason]; +} + + +- (void) write: (id ) protocol +{ + [protocol writeStructBeginWithName: @"TApplicationException"]; + + if ([self reason] != nil) { + [protocol writeFieldBeginWithName: @"message" + type: TType_STRING + fieldID: 1]; + [protocol writeString: [self reason]]; + [protocol writeFieldEnd]; + } + + [protocol writeFieldBeginWithName: @"type" + type: TType_I32 + fieldID: 2]; + [protocol writeI32: mType]; + [protocol writeFieldEnd]; + + [protocol writeFieldStop]; + [protocol writeStructEnd]; +} + + ++ (TApplicationException *) exceptionWithType: (int) type + reason: (NSString *) reason +{ + return [[[TApplicationException alloc] initWithType: type + reason: reason] autorelease]; +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TException.h b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TException.h new file mode 100644 index 00000000..e56f4fa2 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TException.h @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import + +@interface TException : NSException { +} + ++ (id) exceptionWithName: (NSString *) name; + ++ (id) exceptionWithName: (NSString *) name + reason: (NSString *) reason; + ++ (id) exceptionWithName: (NSString *) name + reason: (NSString *) reason + error: (NSError *) error; + +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TException.m b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TException.m new file mode 100644 index 00000000..7c84199d --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TException.m @@ -0,0 +1,64 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import "TException.h" + +@implementation TException + ++ (id) exceptionWithName: (NSString *) name +{ + return [self exceptionWithName: name reason: @"unknown" error: nil]; +} + + ++ (id) exceptionWithName: (NSString *) name + reason: (NSString *) reason +{ + return [self exceptionWithName: name reason: reason error: nil]; +} + + ++ (id) exceptionWithName: (NSString *) name + reason: (NSString *) reason + error: (NSError *) error +{ + NSDictionary * userInfo = nil; + if (error != nil) { + userInfo = [NSDictionary dictionaryWithObject: error forKey: @"error"]; + } + + return [super exceptionWithName: name + reason: reason + userInfo: userInfo]; +} + + +- (NSString *) description +{ + NSMutableString * result = [NSMutableString stringWithString: [self name]]; + [result appendFormat: @": %@", [self reason]]; + if ([self userInfo] != nil) { + [result appendFormat: @"\n userInfo = %@", [self userInfo]]; + } + + return result; +} + + +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TProcessor.h b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TProcessor.h new file mode 100644 index 00000000..980be948 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TProcessor.h @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import +#import "TProtocol.h" + + +@protocol TProcessor + +- (BOOL) processOnInputProtocol: (id ) inProtocol + outputProtocol: (id ) outProtocol; + +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TProcessorFactory.h b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TProcessorFactory.h new file mode 100644 index 00000000..29d12b3e --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TProcessorFactory.h @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import +#import "TProcessor.h" + +@protocol TProcessorFactory + +- (id) processorForTransport: (id) transport; + +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TSharedProcessorFactory.h b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TSharedProcessorFactory.h new file mode 100644 index 00000000..d3e55c4a --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TSharedProcessorFactory.h @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import +#import "TProcessorFactory.h" + +@interface TSharedProcessorFactory : NSObject { + id mSharedProcessor; +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TSharedProcessorFactory.m b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TSharedProcessorFactory.m new file mode 100644 index 00000000..b38e73ab --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/TSharedProcessorFactory.m @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + + +#import "TSharedProcessorFactory.h" + + +@implementation TSharedProcessorFactory + + +- (id) initWithSharedProcessor: (id) sharedProcessor +{ + self = [super init]; + if (!self) { + return nil; + } + + mSharedProcessor = [sharedProcessor retain]; + return self; +} + + +- (void) dealloc +{ + [mSharedProcessor release]; + [super dealloc]; +} + + +- (id) processorForTransport: (id) transport +{ + return [[mSharedProcessor retain] autorelease]; +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TBinaryProtocol.h b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TBinaryProtocol.h new file mode 100644 index 00000000..52cf2669 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TBinaryProtocol.h @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import "TProtocol.h" +#import "TTransport.h" +#import "TProtocolFactory.h" + + +@interface TBinaryProtocol : NSObject { + id mTransport; + BOOL mStrictRead; + BOOL mStrictWrite; + int32_t mMessageSizeLimit; +} + +- (id) initWithTransport: (id ) transport; + +- (id) initWithTransport: (id ) transport + strictRead: (BOOL) strictRead + strictWrite: (BOOL) strictWrite; + +- (int32_t) messageSizeLimit; +- (void) setMessageSizeLimit: (int32_t) sizeLimit; + +@end; + + +@interface TBinaryProtocolFactory : NSObject { +} + ++ (TBinaryProtocolFactory *) sharedFactory; + +- (TBinaryProtocol *) newProtocolOnTransport: (id ) transport; + +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TBinaryProtocol.m b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TBinaryProtocol.m new file mode 100644 index 00000000..b2727167 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TBinaryProtocol.m @@ -0,0 +1,477 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import "TBinaryProtocol.h" +#import "TProtocolException.h" + +int32_t VERSION_1 = 0x80010000; +int32_t VERSION_MASK = 0xffff0000; + + +static TBinaryProtocolFactory * gSharedFactory = nil; + +@implementation TBinaryProtocolFactory + ++ (TBinaryProtocolFactory *) sharedFactory { + if (gSharedFactory == nil) { + gSharedFactory = [[TBinaryProtocolFactory alloc] init]; + } + + return gSharedFactory; +} + +- (TBinaryProtocol *) newProtocolOnTransport: (id ) transport { + return [[TBinaryProtocol alloc] initWithTransport: transport]; +} + +@end + + + +@implementation TBinaryProtocol + +- (id) initWithTransport: (id ) transport +{ + return [self initWithTransport: transport strictRead: NO strictWrite: NO]; +} + +- (id) initWithTransport: (id ) transport + strictRead: (BOOL) strictRead + strictWrite: (BOOL) strictWrite +{ + self = [super init]; + mTransport = [transport retain]; + mStrictRead = strictRead; + mStrictWrite = strictWrite; + return self; +} + + +- (int32_t) messageSizeLimit +{ + return mMessageSizeLimit; +} + + +- (void) setMessageSizeLimit: (int32_t) sizeLimit +{ + mMessageSizeLimit = sizeLimit; +} + + +- (void) dealloc +{ + [mTransport release]; + [super dealloc]; +} + + +- (id ) transport +{ + return mTransport; +} + + +- (NSString *) readStringBody: (int) size +{ + char * buffer = malloc(size+1); + if (!buffer) { + @throw [TProtocolException exceptionWithName: @"TProtocolException" + reason: [NSString stringWithFormat: @"Unable to allocate memory in %s, size: %i", + __PRETTY_FUNCTION__, + size]];; + } + [mTransport readAll: (uint8_t *) buffer offset: 0 length: size]; + buffer[size] = 0; + NSString * result = [NSString stringWithUTF8String: buffer]; + free(buffer); + return result; +} + + +- (void) readMessageBeginReturningName: (NSString **) name + type: (int *) type + sequenceID: (int *) sequenceID +{ + int32_t size = [self readI32]; + if (size < 0) { + int version = size & VERSION_MASK; + if (version != VERSION_1) { + @throw [TProtocolException exceptionWithName: @"TProtocolException" + reason: @"Bad version in readMessageBegin"]; + } + if (type != NULL) { + *type = version & 0x00FF; + } + NSString * messageName = [self readString]; + if (name != NULL) { + *name = messageName; + } + int seqID = [self readI32]; + if (sequenceID != NULL) { + *sequenceID = seqID; + } + } else { + if (mStrictRead) { + @throw [TProtocolException exceptionWithName: @"TProtocolException" + reason: @"Missing version in readMessageBegin, old client?"]; + } + if ([self messageSizeLimit] > 0 && size > [self messageSizeLimit]) { + @throw [TProtocolException exceptionWithName: @"TProtocolException" + reason: [NSString stringWithFormat: @"Message too big. Size limit is: %d Message size is: %d", + mMessageSizeLimit, + size]]; + } + NSString * messageName = [self readStringBody: size]; + if (name != NULL) { + *name = messageName; + } + int messageType = [self readByte]; + if (type != NULL) { + *type = messageType; + } + int seqID = [self readI32]; + if (sequenceID != NULL) { + *sequenceID = seqID; + } + } +} + + +- (void) readMessageEnd {} + + +- (void) readStructBeginReturningName: (NSString **) name +{ + if (name != NULL) { + *name = nil; + } +} + + +- (void) readStructEnd {} + + +- (void) readFieldBeginReturningName: (NSString **) name + type: (int *) fieldType + fieldID: (int *) fieldID +{ + if (name != NULL) { + *name = nil; + } + int ft = [self readByte]; + if (fieldType != NULL) { + *fieldType = ft; + } + if (ft != TType_STOP) { + int fid = [self readI16]; + if (fieldID != NULL) { + *fieldID = fid; + } + } +} + + +- (void) readFieldEnd {} + + +- (int32_t) readI32 +{ + uint8_t i32rd[4]; + [mTransport readAll: i32rd offset: 0 length: 4]; + return + ((i32rd[0] & 0xff) << 24) | + ((i32rd[1] & 0xff) << 16) | + ((i32rd[2] & 0xff) << 8) | + ((i32rd[3] & 0xff)); +} + + +- (NSString *) readString +{ + int size = [self readI32]; + return [self readStringBody: size]; +} + + +- (BOOL) readBool +{ + return [self readByte] == 1; +} + +- (uint8_t) readByte +{ + uint8_t myByte; + [mTransport readAll: &myByte offset: 0 length: 1]; + return myByte; +} + +- (short) readI16 +{ + uint8_t buff[2]; + [mTransport readAll: buff offset: 0 length: 2]; + return (short) + (((buff[0] & 0xff) << 8) | + ((buff[1] & 0xff))); + return 0; +} + +- (int64_t) readI64; +{ + uint8_t i64rd[8]; + [mTransport readAll: i64rd offset: 0 length: 8]; + return + ((int64_t)(i64rd[0] & 0xff) << 56) | + ((int64_t)(i64rd[1] & 0xff) << 48) | + ((int64_t)(i64rd[2] & 0xff) << 40) | + ((int64_t)(i64rd[3] & 0xff) << 32) | + ((int64_t)(i64rd[4] & 0xff) << 24) | + ((int64_t)(i64rd[5] & 0xff) << 16) | + ((int64_t)(i64rd[6] & 0xff) << 8) | + ((int64_t)(i64rd[7] & 0xff)); +} + +- (double) readDouble; +{ + // FIXME - will this get us into trouble on PowerPC? + int64_t ieee754 = [self readI64]; + return *((double *) &ieee754); +} + + +- (NSData *) readBinary +{ + int32_t size = [self readI32]; + uint8_t * buff = malloc(size); + if (buff == NULL) { + @throw [TProtocolException + exceptionWithName: @"TProtocolException" + reason: [NSString stringWithFormat: @"Out of memory. Unable to allocate %d bytes trying to read binary data.", + size]]; + } + [mTransport readAll: buff offset: 0 length: size]; + return [NSData dataWithBytesNoCopy: buff length: size]; +} + + +- (void) readMapBeginReturningKeyType: (int *) keyType + valueType: (int *) valueType + size: (int *) size +{ + int kt = [self readByte]; + int vt = [self readByte]; + int s = [self readI32]; + if (keyType != NULL) { + *keyType = kt; + } + if (valueType != NULL) { + *valueType = vt; + } + if (size != NULL) { + *size = s; + } +} + +- (void) readMapEnd {} + + +- (void) readSetBeginReturningElementType: (int *) elementType + size: (int *) size +{ + int et = [self readByte]; + int s = [self readI32]; + if (elementType != NULL) { + *elementType = et; + } + if (size != NULL) { + *size = s; + } +} + + +- (void) readSetEnd {} + + +- (void) readListBeginReturningElementType: (int *) elementType + size: (int *) size +{ + int et = [self readByte]; + int s = [self readI32]; + if (elementType != NULL) { + *elementType = et; + } + if (size != NULL) { + *size = s; + } +} + + +- (void) readListEnd {} + + +- (void) writeByte: (uint8_t) value +{ + [mTransport write: &value offset: 0 length: 1]; +} + + +- (void) writeMessageBeginWithName: (NSString *) name + type: (int) messageType + sequenceID: (int) sequenceID +{ + if (mStrictWrite) { + int version = VERSION_1 | messageType; + [self writeI32: version]; + [self writeString: name]; + [self writeI32: sequenceID]; + } else { + [self writeString: name]; + [self writeByte: messageType]; + [self writeI32: sequenceID]; + } +} + + +- (void) writeMessageEnd {} + + +- (void) writeStructBeginWithName: (NSString *) name {} + + +- (void) writeStructEnd {} + + +- (void) writeFieldBeginWithName: (NSString *) name + type: (int) fieldType + fieldID: (int) fieldID +{ + [self writeByte: fieldType]; + [self writeI16: fieldID]; +} + + +- (void) writeI32: (int32_t) value +{ + uint8_t buff[4]; + buff[0] = 0xFF & (value >> 24); + buff[1] = 0xFF & (value >> 16); + buff[2] = 0xFF & (value >> 8); + buff[3] = 0xFF & value; + [mTransport write: buff offset: 0 length: 4]; +} + +- (void) writeI16: (short) value +{ + uint8_t buff[2]; + buff[0] = 0xff & (value >> 8); + buff[1] = 0xff & value; + [mTransport write: buff offset: 0 length: 2]; +} + + +- (void) writeI64: (int64_t) value +{ + uint8_t buff[8]; + buff[0] = 0xFF & (value >> 56); + buff[1] = 0xFF & (value >> 48); + buff[2] = 0xFF & (value >> 40); + buff[3] = 0xFF & (value >> 32); + buff[4] = 0xFF & (value >> 24); + buff[5] = 0xFF & (value >> 16); + buff[6] = 0xFF & (value >> 8); + buff[7] = 0xFF & value; + [mTransport write: buff offset: 0 length: 8]; +} + +- (void) writeDouble: (double) value +{ + // spit out IEEE 754 bits - FIXME - will this get us in trouble on + // PowerPC? + [self writeI64: *((int64_t *) &value)]; +} + + +- (void) writeString: (NSString *) value +{ + if (value != nil) { + const char * utf8Bytes = [value UTF8String]; + size_t length = strlen(utf8Bytes); + [self writeI32: length]; + [mTransport write: (uint8_t *) utf8Bytes offset: 0 length: length]; + } else { + // instead of crashing when we get null, let's write out a zero + // length string + [self writeI32: 0]; + } +} + + +- (void) writeBinary: (NSData *) data +{ + [self writeI32: [data length]]; + [mTransport write: [data bytes] offset: 0 length: [data length]]; +} + +- (void) writeFieldStop +{ + [self writeByte: TType_STOP]; +} + + +- (void) writeFieldEnd {} + + +- (void) writeMapBeginWithKeyType: (int) keyType + valueType: (int) valueType + size: (int) size +{ + [self writeByte: keyType]; + [self writeByte: valueType]; + [self writeI32: size]; +} + +- (void) writeMapEnd {} + + +- (void) writeSetBeginWithElementType: (int) elementType + size: (int) size +{ + [self writeByte: elementType]; + [self writeI32: size]; +} + +- (void) writeSetEnd {} + + +- (void) writeListBeginWithElementType: (int) elementType + size: (int) size +{ + [self writeByte: elementType]; + [self writeI32: size]; +} + +- (void) writeListEnd {} + + +- (void) writeBool: (BOOL) value +{ + [self writeByte: (value ? 1 : 0)]; +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocol.h b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocol.h new file mode 100644 index 00000000..281239d7 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocol.h @@ -0,0 +1,148 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import + +#import "TTransport.h" + + +enum { + TMessageType_CALL = 1, + TMessageType_REPLY = 2, + TMessageType_EXCEPTION = 3, + TMessageType_ONEWAY = 4 +}; + +enum { + TType_STOP = 0, + TType_VOID = 1, + TType_BOOL = 2, + TType_BYTE = 3, + TType_DOUBLE = 4, + TType_I16 = 6, + TType_I32 = 8, + TType_I64 = 10, + TType_STRING = 11, + TType_STRUCT = 12, + TType_MAP = 13, + TType_SET = 14, + TType_LIST = 15 +}; + + +@protocol TProtocol + +- (id ) transport; + +- (void) readMessageBeginReturningName: (NSString **) name + type: (int *) type + sequenceID: (int *) sequenceID; +- (void) readMessageEnd; + +- (void) readStructBeginReturningName: (NSString **) name; +- (void) readStructEnd; + +- (void) readFieldBeginReturningName: (NSString **) name + type: (int *) fieldType + fieldID: (int *) fieldID; +- (void) readFieldEnd; + +- (NSString *) readString; + +- (BOOL) readBool; + +- (unsigned char) readByte; + +- (short) readI16; + +- (int32_t) readI32; + +- (int64_t) readI64; + +- (double) readDouble; + +- (NSData *) readBinary; + +- (void) readMapBeginReturningKeyType: (int *) keyType + valueType: (int *) valueType + size: (int *) size; +- (void) readMapEnd; + + +- (void) readSetBeginReturningElementType: (int *) elementType + size: (int *) size; +- (void) readSetEnd; + + +- (void) readListBeginReturningElementType: (int *) elementType + size: (int *) size; +- (void) readListEnd; + + +- (void) writeMessageBeginWithName: (NSString *) name + type: (int) messageType + sequenceID: (int) sequenceID; +- (void) writeMessageEnd; + +- (void) writeStructBeginWithName: (NSString *) name; +- (void) writeStructEnd; + +- (void) writeFieldBeginWithName: (NSString *) name + type: (int) fieldType + fieldID: (int) fieldID; + +- (void) writeI32: (int32_t) value; + +- (void) writeI64: (int64_t) value; + +- (void) writeI16: (short) value; + +- (void) writeByte: (uint8_t) value; + +- (void) writeString: (NSString *) value; + +- (void) writeDouble: (double) value; + +- (void) writeBool: (BOOL) value; + +- (void) writeBinary: (NSData *) data; + +- (void) writeFieldStop; + +- (void) writeFieldEnd; + +- (void) writeMapBeginWithKeyType: (int) keyType + valueType: (int) valueType + size: (int) size; +- (void) writeMapEnd; + + +- (void) writeSetBeginWithElementType: (int) elementType + size: (int) size; +- (void) writeSetEnd; + + +- (void) writeListBeginWithElementType: (int) elementType + size: (int) size; + +- (void) writeListEnd; + + +@end + diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocolException.h b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocolException.h new file mode 100644 index 00000000..ad354fc2 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocolException.h @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import "TException.h" + +@interface TProtocolException : TException { +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocolException.m b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocolException.m new file mode 100644 index 00000000..681487a4 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocolException.m @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import "TProtocolException.h" + +@implementation TProtocolException +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocolFactory.h b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocolFactory.h new file mode 100644 index 00000000..f200a6dd --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocolFactory.h @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import +#import "TProtocol.h" +#import "TTransport.h" + + +@protocol TProtocolFactory + +- (id ) newProtocolOnTransport: (id ) transport; + +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocolUtil.h b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocolUtil.h new file mode 100644 index 00000000..c2d2521c --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocolUtil.h @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import "TProtocol.h" +#import "TTransport.h" + +@interface TProtocolUtil : NSObject { + +} + ++ (void) skipType: (int) type onProtocol: (id ) protocol; + +@end; diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocolUtil.m b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocolUtil.m new file mode 100644 index 00000000..13d70954 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/protocol/TProtocolUtil.m @@ -0,0 +1,104 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import "TProtocolUtil.h" + +@implementation TProtocolUtil + ++ (void) skipType: (int) type onProtocol: (id ) protocol +{ + switch (type) { + case TType_BOOL: + [protocol readBool]; + break; + case TType_BYTE: + [protocol readByte]; + break; + case TType_I16: + [protocol readI16]; + break; + case TType_I32: + [protocol readI32]; + break; + case TType_I64: + [protocol readI64]; + break; + case TType_DOUBLE: + [protocol readDouble]; + break; + case TType_STRING: + [protocol readString]; + break; + case TType_STRUCT: + [protocol readStructBeginReturningName: NULL]; + while (true) { + int fieldType; + [protocol readFieldBeginReturningName: nil type: &fieldType fieldID: nil]; + if (fieldType == TType_STOP) { + break; + } + [TProtocolUtil skipType: fieldType onProtocol: protocol]; + [protocol readFieldEnd]; + } + [protocol readStructEnd]; + break; + case TType_MAP: + { + int keyType; + int valueType; + int size; + [protocol readMapBeginReturningKeyType: &keyType valueType: &valueType size: &size]; + int i; + for (i = 0; i < size; i++) { + [TProtocolUtil skipType: keyType onProtocol: protocol]; + [TProtocolUtil skipType: valueType onProtocol: protocol]; + } + [protocol readMapEnd]; + } + break; + case TType_SET: + { + int elemType; + int size; + [protocol readSetBeginReturningElementType: &elemType size: &size]; + int i; + for (i = 0; i < size; i++) { + [TProtocolUtil skipType: elemType onProtocol: protocol]; + } + [protocol readSetEnd]; + } + break; + case TType_LIST: + { + int elemType; + int size; + [protocol readListBeginReturningElementType: &elemType size: &size]; + int i; + for (i = 0; i < size; i++) { + [TProtocolUtil skipType: elemType onProtocol: protocol]; + } + [protocol readListEnd]; + } + break; + default: + return; + } +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/THTTPClient.h b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/THTTPClient.h new file mode 100644 index 00000000..4d57840b --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/THTTPClient.h @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import +#import "TTransport.h" + +@interface THTTPClient : NSObject { + NSURL * mURL; + NSMutableURLRequest * mRequest; + NSMutableData * mRequestData; + NSData * mResponseData; + int mResponseDataOffset; + NSString * mUserAgent; + int mTimeout; +} + +- (id) initWithURL: (NSURL *) aURL; + +- (id) initWithURL: (NSURL *) aURL + userAgent: (NSString *) userAgent + timeout: (int) timeout; + +- (void) setURL: (NSURL *) aURL; + +@end + diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/THTTPClient.m b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/THTTPClient.m new file mode 100644 index 00000000..1eaa859b --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/THTTPClient.m @@ -0,0 +1,160 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import "THTTPClient.h" +#import "TTransportException.h" + +@implementation THTTPClient + + +- (void) setupRequest +{ + if (mRequest != nil) { + [mRequest release]; + } + + // set up our request object that we'll use for each request + mRequest = [[NSMutableURLRequest alloc] initWithURL: mURL]; + [mRequest setHTTPMethod: @"POST"]; + [mRequest setValue: @"application/x-thrift" forHTTPHeaderField: @"Content-Type"]; + [mRequest setValue: @"application/x-thrift" forHTTPHeaderField: @"Accept"]; + + NSString * userAgent = mUserAgent; + if (!userAgent) { + userAgent = @"Cocoa/THTTPClient"; + } + [mRequest setValue: userAgent forHTTPHeaderField: @"User-Agent"]; + + [mRequest setCachePolicy: NSURLRequestReloadIgnoringCacheData]; + if (mTimeout) { + [mRequest setTimeoutInterval: mTimeout]; + } +} + + +- (id) initWithURL: (NSURL *) aURL +{ + return [self initWithURL: aURL + userAgent: nil + timeout: 0]; +} + + +- (id) initWithURL: (NSURL *) aURL + userAgent: (NSString *) userAgent + timeout: (int) timeout +{ + self = [super init]; + if (!self) { + return nil; + } + + mTimeout = timeout; + if (userAgent) { + mUserAgent = [userAgent retain]; + } + mURL = [aURL retain]; + + [self setupRequest]; + + // create our request data buffer + mRequestData = [[NSMutableData alloc] initWithCapacity: 1024]; + + return self; +} + + +- (void) setURL: (NSURL *) aURL +{ + [aURL retain]; + [mURL release]; + mURL = aURL; + + [self setupRequest]; +} + + +- (void) dealloc +{ + [mURL release]; + [mUserAgent release]; + [mRequest release]; + [mRequestData release]; + [mResponseData release]; + [super dealloc]; +} + + +- (int) readAll: (uint8_t *) buf offset: (int) off length: (int) len +{ + NSRange r; + r.location = mResponseDataOffset; + r.length = len; + + [mResponseData getBytes: buf+off range: r]; + mResponseDataOffset += len; + + return len; +} + + +- (void) write: (const uint8_t *) data offset: (unsigned int) offset length: (unsigned int) length +{ + [mRequestData appendBytes: data+offset length: length]; +} + + +- (void) flush +{ + [mRequest setHTTPBody: mRequestData]; // not sure if it copies the data + + // make the HTTP request + NSURLResponse * response; + NSError * error; + NSData * responseData = + [NSURLConnection sendSynchronousRequest: mRequest returningResponse: &response error: &error]; + + [mRequestData setLength: 0]; + + if (responseData == nil) { + @throw [TTransportException exceptionWithName: @"TTransportException" + reason: @"Could not make HTTP request" + error: error]; + } + if (![response isKindOfClass: [NSHTTPURLResponse class]]) { + @throw [TTransportException exceptionWithName: @"TTransportException" + reason: [NSString stringWithFormat: @"Unexpected NSURLResponse type: %@", + NSStringFromClass([response class])]]; + } + + NSHTTPURLResponse * httpResponse = (NSHTTPURLResponse *) response; + if ([httpResponse statusCode] != 200) { + @throw [TTransportException exceptionWithName: @"TTransportException" + reason: [NSString stringWithFormat: @"Bad response from HTTP server: %d", + [httpResponse statusCode]]]; + } + + // phew! + [mResponseData release]; + mResponseData = [responseData retain]; + mResponseDataOffset = 0; +} + + +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/TMemoryBuffer.h b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/TMemoryBuffer.h new file mode 100644 index 00000000..fa4d3713 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/TMemoryBuffer.h @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import +#import "TTransport.h" + +@interface TMemoryBuffer : NSObject { + NSMutableData *mBuffer; + NSUInteger mOffset; +} +- (id)initWithData:(NSData *)data; +- (NSData *)getBuffer; +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/TMemoryBuffer.m b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/TMemoryBuffer.m new file mode 100644 index 00000000..869010a4 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/TMemoryBuffer.m @@ -0,0 +1,71 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import "TMemoryBuffer.h" +#import "TTransportException.h" + +#define GARBAGE_BUFFER_SIZE 4096 // 4KiB + +@implementation TMemoryBuffer +- (id)init { + if (self = [super init]) { + mBuffer = [[NSMutableData alloc] init]; + mOffset = 0; + } + return self; +} + +- (id)initWithData:(NSData *)data { + if (self = [super init]) { + mBuffer = [data mutableCopy]; + mOffset = 0; + } + return self; +} + +- (int)readAll:(uint8_t *)buf offset:(int)off length:(int)len { + if ([mBuffer length] - mOffset < len) { + @throw [TTransportException exceptionWithReason:@"Not enough bytes remain in buffer"]; + } + [mBuffer getBytes:buf range:NSMakeRange(mOffset, len)]; + mOffset += len; + if (mOffset >= GARBAGE_BUFFER_SIZE) { + [mBuffer replaceBytesInRange:NSMakeRange(0, mOffset) withBytes:NULL length:0]; + mOffset = 0; + } + return len; +} + +- (void)write:(const uint8_t *)data offset:(unsigned int)offset length:(unsigned int)length { + [mBuffer appendBytes:data+offset length:length]; +} + +- (void)flush { + // noop +} + +- (NSData *)getBuffer { + return [[mBuffer copy] autorelease]; +} + +- (void)dealloc { + [mBuffer release]; + [super dealloc]; +} +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/TTransport.h b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/TTransport.h new file mode 100644 index 00000000..61ebbd21 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/TTransport.h @@ -0,0 +1,36 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +@protocol TTransport + + /** + * Guarantees that all of len bytes are read + * + * @param buf Buffer to read into + * @param off Index in buffer to start storing bytes at + * @param len Maximum number of bytes to read + * @return The number of bytes actually read, which must be equal to len + * @throws TTransportException if there was an error reading data + */ +- (int) readAll: (uint8_t *) buf offset: (int) off length: (int) len; + +- (void) write: (const uint8_t *) data offset: (unsigned int) offset length: (unsigned int) length; + +- (void) flush; +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/TTransportException.h b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/TTransportException.h new file mode 100644 index 00000000..6749fe28 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/TTransportException.h @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import "TException.h" + +@interface TTransportException : TException { +} + ++ (id) exceptionWithReason: (NSString *) reason + error: (NSError *) error; + ++ (id) exceptionWithReason: (NSString *) reason; + +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/TTransportException.m b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/TTransportException.m new file mode 100644 index 00000000..aa67149e --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/Helpers/thrift/transport/TTransportException.m @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#import "TTransportException.h" + +@implementation TTransportException + ++ (id) exceptionWithReason: (NSString *) reason + error: (NSError *) error +{ + NSDictionary * userInfo = nil; + if (error != nil) { + userInfo = [NSDictionary dictionaryWithObject: error forKey: @"error"]; + } + + return [super exceptionWithName: @"TTransportException" + reason: reason + userInfo: userInfo]; +} + + ++ (id) exceptionWithReason: (NSString *) reason +{ + return [self exceptionWithReason: reason error: nil]; +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/SHKEvernote.h b/Classes/ShareKit/Sharers/Services/Evernote/SHKEvernote.h new file mode 100644 index 00000000..9d2eb068 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/SHKEvernote.h @@ -0,0 +1,32 @@ +// +// SHKEvernote +// ShareKit Evernote Additions +// +// Created by Atsushi Nagase on 8/28/10. +// Copyright 2010 LittleApps Inc. All rights reserved. +// + +#import +#import "SHK.h" +#import "SHKSharer.h" + +#import "Types.h" +#import "UserStore.h" +#import "NoteStore.h" + +#define kENMLPrefix @"" +#define kENMLSuffix @"" + +@interface SHKEvernoteItem : SHKItem {} +@property (retain) EDAMNote* note; +@end + + +@interface SHKEvernote : SHKSharer {} + +- (EDAMAuthenticationResult *)getAuthenticationResultForUsername:(NSString *)username password:(NSString *)password; +- (EDAMNotebook *)defaultNoteBookFromNoteStore:(EDAMNoteStoreClient *)noteStore authToken:(NSString *)authToken; +- (NSString *)enMediaTagWithResource:(EDAMResource *)src width:(CGFloat)width height:(CGFloat)height; + +@end + diff --git a/Classes/ShareKit/Sharers/Services/Evernote/SHKEvernote.m b/Classes/ShareKit/Sharers/Services/Evernote/SHKEvernote.m new file mode 100644 index 00000000..1856dcde --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/SHKEvernote.m @@ -0,0 +1,382 @@ +// +// SHKEvernote +// ShareKit Evernote Additions +// +// Created by Atsushi Nagase on 8/28/10. +// Copyright 2010 LittleApps Inc. All rights reserved. +// + +#import "SHKEvernote.h" +#import "THTTPClient.h" +#import "TBinaryProtocol.h" +#import "NSData+md5.h" + +@implementation SHKEvernoteItem +@synthesize note; + +- (void)dealloc { + [note release]; + [super dealloc]; +} + + +@end + +@interface SHKEvernote(private) + +- (void)authFinished:(BOOL)success; +- (void)sendFinished:(BOOL)success; + +@end + + +@implementation SHKEvernote + + +#pragma mark - +#pragma mark Configuration : Service Defination + ++ (NSString *)sharerTitle { return @"Evernote"; } ++ (BOOL)canShareURL { return YES; } ++ (BOOL)canShareImage { return YES; } ++ (BOOL)canShareText { return YES; } ++ (BOOL)canShareFile { return YES; } ++ (BOOL)requiresAuthentication { return YES; } + + +#pragma mark - +#pragma mark Configuration : Dynamic Enable + ++ (BOOL)canShare { return YES; } + +#pragma mark - +#pragma mark Authentication + +// Return the form fields required to authenticate the user with the service ++ (NSArray *)authorizationFormFields +{ + return [NSArray arrayWithObjects: + [SHKFormFieldSettings label:@"Username" key:@"username" type:SHKFormFieldTypeText start:nil], + [SHKFormFieldSettings label:@"Password" key:@"password" type:SHKFormFieldTypePassword start:nil], + nil]; +} + ++ (NSString *)authorizationFormCaption +{ + return SHKLocalizedString(@"Create a free account at %@", @"Evernote.com"); +} + +- (void)authorizationFormValidate:(SHKFormController *)form +{ + // Display an activity indicator + if (!quiet) + [[SHKActivityIndicator currentIndicator] displayActivity:SHKLocalizedString(@"Logging In...")]; + + // Authorize the user through the server + self.pendingForm = form; + [NSThread detachNewThreadSelector:@selector(_authorizationFormValidate:) toTarget:self withObject:[form formValues]]; +} + +- (void)_authorizationFormValidate:(NSDictionary *)args +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + BOOL success = NO; + @try { + EDAMAuthenticationResult *authResult = [self getAuthenticationResultForUsername:[args valueForKey:@"username"] password:[args valueForKey:@"password"]]; + success = authResult&&[authResult userIsSet]&&[authResult authenticationTokenIsSet]; + } + @catch (NSException * e) { + SHKLog(@"Caught %@: %@ %@", [e name], [e reason],e); + } + [self performSelectorOnMainThread:@selector(_authFinished:) withObject:[NSDictionary dictionaryWithObjectsAndKeys:success?@"1":@"0",@"success",nil] waitUntilDone:YES]; + [pool release]; +} + +- (EDAMAuthenticationResult *)getAuthenticationResultForUsername:(NSString *)username password:(NSString *)password +{ + THTTPClient *userStoreHTTPClient = [[[THTTPClient alloc] initWithURL:[NSURL URLWithString:SHKEvernoteUserStoreURL]] autorelease]; + TBinaryProtocol *userStoreProtocol = [[[TBinaryProtocol alloc] initWithTransport:userStoreHTTPClient] autorelease]; + EDAMUserStoreClient *userStore = [[[EDAMUserStoreClient alloc] initWithProtocol:userStoreProtocol] autorelease]; + + BOOL versionOK = [userStore checkVersion:@"ShrareKit EDMA" :[EDAMUserStoreConstants EDAM_VERSION_MAJOR] :[EDAMUserStoreConstants EDAM_VERSION_MINOR]]; + if(!versionOK) + { + [[[[UIAlertView alloc] initWithTitle:SHKLocalizedString(@"EDMA Error") + message:SHKLocalizedString(@"EDMA Version is too old.") + delegate:nil + cancelButtonTitle:SHKLocalizedString(@"Close") + otherButtonTitles:nil] autorelease] show]; + return nil; + } + return [userStore authenticate :username :password :SHKEvernoteConsumerKey :SHKEvernoteSecretKey]; +} + +- (void)_authFinished:(NSDictionary *)args +{ + [self authFinished:[[args valueForKey:@"success"] isEqualToString:@"1"]]; +} + +- (void)authFinished:(BOOL)success +{ + [[SHKActivityIndicator currentIndicator] hide]; + if(!success) + { + [[[[UIAlertView alloc] initWithTitle:SHKLocalizedString(@"Login Error") message:SHKLocalizedString(@"Your username and password did not match") delegate:nil cancelButtonTitle:SHKLocalizedString(@"Close") otherButtonTitles:nil] autorelease] show]; + return; + } + else + [pendingForm saveForm]; +} + +#pragma mark - +#pragma mark Share Form + +- (NSArray *)shareFormFieldsForType:(SHKShareType)type +{ + return [NSArray arrayWithObjects: + [SHKFormFieldSettings label:SHKLocalizedString(@"Title") key:@"title" type:SHKFormFieldTypeText start:item.title], + //[SHKFormFieldSettings label:SHKLocalizedString(@"Memo") key:@"text" type:SHKFormFieldTypeText start:item.text], + [SHKFormFieldSettings label:SHKLocalizedString(@"Tags") key:@"tags" type:SHKFormFieldTypeText start:item.tags], + nil]; +} + +- (void)shareFormValidate:(SHKCustomFormController *)form +{ + [form saveForm]; +} + +#pragma mark - +#pragma mark Implementation + +- (BOOL)validateItem { return [super validateItem]; } + +- (EDAMNotebook *)defaultNoteBookFromNoteStore:(EDAMNoteStoreClient *)noteStore authToken:(NSString *)authToken { + NSArray *notebooks = [noteStore listNotebooks:authToken]; + for(int i = 0; i < [notebooks count]; i++) { + EDAMNotebook *notebook = (EDAMNotebook*)[notebooks objectAtIndex:i]; + if([notebook defaultNotebook]) return notebook; + } + return nil; +} + +- (BOOL)send { + if (![self validateItem]) + return NO; + [self sendDidStart]; + [NSThread detachNewThreadSelector:@selector(_send) toTarget:self withObject:nil]; + return YES; +} + +- (void)_send { + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + BOOL success = NO; + NSString *authToken; + NSURL *noteStoreURL; + NSString *errorMessage = nil; + BOOL shouldRelogin = NO; + @try { + //////////////////////////////////////////////// + // Authentication + //////////////////////////////////////////////// + EDAMAuthenticationResult *authResult = [self getAuthenticationResultForUsername:[self getAuthValueForKey:@"username"] password:[self getAuthValueForKey:@"password"]]; + EDAMUser *user = [authResult user]; + authToken = [authResult authenticationToken]; + noteStoreURL = [NSURL URLWithString:[SHKEvernoteNetStoreURLBase stringByAppendingString:[user shardId]]]; + + //////////////////////////////////////////////// + // Make clients + //////////////////////////////////////////////// + THTTPClient *noteStoreHTTPClient = [[[THTTPClient alloc] initWithURL:noteStoreURL] autorelease]; + TBinaryProtocol *noteStoreProtocol = [[[TBinaryProtocol alloc] initWithTransport:noteStoreHTTPClient] autorelease]; + EDAMNoteStoreClient *noteStore = [[[EDAMNoteStoreClient alloc] initWithProtocol:noteStoreProtocol] autorelease]; + + //////////////////////////////////////////////// + // Make EDAMNote contents + //////////////////////////////////////////////// + SHKEvernoteItem *enItem = nil; + NSMutableArray *resources = nil; + EDAMNote *note = nil; + if([item isKindOfClass:[SHKEvernoteItem class]]) { + enItem = (SHKEvernoteItem *)item; + note = enItem.note; + resources = [note.resources mutableCopy]; + } + + if(!resources) + resources = [[NSMutableArray alloc] init]; + if(!note) + note = [[[EDAMNote alloc] init] autorelease]; + + + EDAMNoteAttributes *atr = [note attributesIsSet] ? [note.attributes retain] : [[EDAMNoteAttributes alloc] init]; + + if(![atr sourceURLIsSet]&&enItem.URL) + [atr setSourceURL:[enItem.URL absoluteString]]; + if(![note notebookGuidIsSet]) + [note setNotebookGuid:[[self defaultNoteBookFromNoteStore:noteStore authToken:authToken] guid]]; + + note.title = item.title.length > 0 ? + item.title : + ( [note titleIsSet] ? + note.title : + SHKLocalizedString(@"Untitled") ); + + if(![note tagNamesIsSet]&&item.tags) + [note setTagNames:[item.tags componentsSeparatedByString:@" "]]; + + if(![note contentIsSet]) { + NSMutableString* contentStr = [[NSMutableString alloc] initWithString:kENMLPrefix]; + NSString * strURL = [item.URL absoluteString]; + + if(strURL.length>0) { + if(item.title.length>0) + [contentStr appendFormat:@"

%@

",strURL,item.title]; + [contentStr appendFormat:@"

%@

",strURL,strURL]; + atr.sourceURL = strURL; + } else if(item.title.length>0) + [contentStr appendFormat:@"

%@

",item.title]; + + if(item.text.length>0 ) + [contentStr appendFormat:@"

%@

",item.text]; + + if(item.image) { + EDAMResource *img = [[[EDAMResource alloc] init] autorelease]; + NSData *rawimg = UIImageJPEGRepresentation(item.image, 0.6); + EDAMData *imgd = [[[EDAMData alloc] initWithBodyHash:rawimg size:[rawimg length] body:rawimg] autorelease]; + [img setData:imgd]; + [img setRecognition:imgd]; + [img setMime:@"image/jpeg"]; + [resources addObject:img]; + [contentStr appendString:[NSString stringWithFormat:@"

%@

",[self enMediaTagWithResource:img width:item.image.size.width height:item.image.size.height]]]; + } + + if(item.data) { + EDAMResource *file = [[[EDAMResource alloc] init] autorelease]; + EDAMData *filed = [[[EDAMData alloc] initWithBodyHash:item.data size:[item.data length] body:item.data] autorelease]; + [file setData:filed]; + [file setRecognition:filed]; + [file setMime:item.mimeType]; + [resources addObject:file]; + [contentStr appendString:[NSString stringWithFormat:@"

%@

",[self enMediaTagWithResource:file width:0 height:0]]]; + } + [contentStr appendString:kENMLSuffix]; + [note setContent:contentStr]; + [contentStr release]; + } + + + //////////////////////////////////////////////// + // Replace HTML elements with en-media elements + //////////////////////////////////////////////// + + for(EDAMResource *res in resources) { + if(![res dataIsSet]&&[res attributesIsSet]&&res.attributes.sourceURL.length>0&&[res.mime isEqualToString:@"image/jpeg"]) { + @try { + NSData *rawimg = [NSData dataWithContentsOfURL:[NSURL URLWithString:res.attributes.sourceURL]]; + UIImage *img = [UIImage imageWithData:rawimg]; + if(img) { + EDAMData *imgd = [[[EDAMData alloc] initWithBodyHash:rawimg size:[rawimg length] body:rawimg] autorelease]; + [res setData:imgd]; + [res setRecognition:imgd]; + [note setContent: + [note.content stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"",res.attributes.sourceURL] + withString:[self enMediaTagWithResource:res width:img.size.width height:img.size.height]]]; + } + } + @catch (NSException * e) { + SHKLog(@"Caught: %@",e); + } + } + } + [note setResources:resources]; + [note setAttributes:atr]; + [resources release]; + [atr release]; + [note setCreated:(long long)[[NSDate date] timeIntervalSince1970] * 1000]; + EDAMNote *createdNote = [noteStore createNote:authToken :note]; + if (createdNote != NULL) { + SHKLog(@"Created note: %@", [createdNote title]); + success = YES; + } + } + @catch (EDAMUserException * e) + { + SHKLog(@"%@",e); + + NSString *errorName; + switch (e.errorCode) + { + case EDAMErrorCode_BAD_DATA_FORMAT: + errorName = @"Invalid format"; + break; + case EDAMErrorCode_PERMISSION_DENIED: + errorName = @"Permission Denied"; + break; + case EDAMErrorCode_INTERNAL_ERROR: + errorName = @"Internal Evernote Error"; + break; + case EDAMErrorCode_DATA_REQUIRED: + errorName = @"Data Required"; + break; + case EDAMErrorCode_QUOTA_REACHED: + errorName = @"Quota Reached"; + break; + case EDAMErrorCode_INVALID_AUTH: + errorName = @"Invalid Auth"; + shouldRelogin = YES; + break; + case EDAMErrorCode_AUTH_EXPIRED: + errorName = @"Auth Expired"; + shouldRelogin = YES; + break; + case EDAMErrorCode_DATA_CONFLICT: + errorName = @"Data Conflict"; + break; + default: + errorName = @"Unknown error from Evernote"; + break; + } + + errorMessage = [NSString stringWithFormat:@"Evernote Error on %@: %@", e.parameter, errorName]; + } + [self performSelectorOnMainThread:@selector(_sendFinished:) + withObject:[NSDictionary dictionaryWithObjectsAndKeys: + success?@"1":@"0",@"success", + errorMessage==nil?@"":errorMessage,@"errorMessage", + shouldRelogin?@"1":@"0",@"shouldRelogin", + nil] waitUntilDone:YES]; + [pool release]; +} + +- (NSString *)enMediaTagWithResource:(EDAMResource *)src width:(CGFloat)width height:(CGFloat)height { + NSString *sizeAtr = width > 0 && height > 0 ? [NSString stringWithFormat:@"height=\"%.0f\" width=\"%.0f\" ",height,width]:@""; + return [NSString stringWithFormat:@"",src.mime,sizeAtr,[src.data.body md5]]; +} + +- (void)_sendFinished:(NSDictionary *)args +{ + if (![[args valueForKey:@"success"] isEqualToString:@"1"]) + { + if ([[args valueForKey:@"shouldRelogin"] isEqualToString:@"1"]) + { + [self sendDidFailShouldRelogin]; + return; + } + + [self sendDidFailWithError:[SHK error:[args valueForKey:@"errorMessage"]]]; + return; + } + + [self sendDidFinish]; +} + + +- (void)sendFinished:(BOOL)success { + if (success) { + [self sendDidFinish]; + } else { + [self sendDidFailWithError:[SHK error:SHKLocalizedString(@"There was a problem sharing with Evernote")] shouldRelogin:NO]; + } +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Evernote/SHKEvernote.md b/Classes/ShareKit/Sharers/Services/Evernote/SHKEvernote.md new file mode 100644 index 00000000..ce2623f1 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Evernote/SHKEvernote.md @@ -0,0 +1,71 @@ +# Using SHKEvernote + +SHKEvernote supports sharing links, images, text and files. +In default: + ++ Links and text will be sent as rich text format. ++ Images and files will be sent as attachments. + +Evernote's consumer and secret key are required. +Request an API Key from [Evernote API Overview](http://www.evernote.com/about/developer/api/) page. + +When you received an API Key, define them to `SHKEvernoteConsumerKey` and `SHKEvernoteSecretKey` constants in `SHKConfig.h`. + + +## Sending custom EDAM content +If you want to send custom EDAM content, use `SHKEvernoteItem` instead of `SHKItem`. + +This is a subclass of SHKItem, extended for support `(EDAMNote *)note` property. + + + #import SHKEvernote.h + + ... + + NSString *noteTitle = @"My custom evernote."; + + EDAMNote *note = [[[EDAMNote alloc] init] autorelease]; + + // Note content as mutable string + // kENMLPrefix and kENMLSuffix are defined in SHKEvernote.h + NSMutableString *content = [NSMutableString stringWithString:kENMLPrefix]; + // Resources to embed + NSMutableArray *resources = [NSMutableArray array]; + + [content appendString:@"

Apple

"]; + + // Image to clip + NSString *myImageURL = @"http://images.apple.com/iphone/home/images/route-facetime-20100923.png"; + + EDAMResource *imgResource = [[[EDAMResource alloc] init] autorelease]; + EDAMResourceAttributes *imgAttr = [[[EDAMResourceAttributes alloc] init] autorelease]; + + // Automatically downloaded from the URL. + imgAttr.sourceURL = myImageURL; + imgResource.mime = @"image/jpeg"; + + imgResource.attributes = imgAttr; + + [resources addObject:imgResource]; + // Plural embed images are supported, + // but this makes slow sharing process + [content appendFormat:@"

",myImageURL]; + // img element will be replaced with en-media element automatically. + + + [content appendString:kENMLSuffix]; + + [note setTitle:noteTitle]; + [note setContent:content]; + [note setResources:resources]; + + SHKEvernoteItem *item = [[SHKEvernoteItem alloc] init] autorelease]; + item.title = noteTitle; + item.shareType = SHKShareTypeURL; + item.note = note; + + SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item]; + [actionSheet showFromToolbar:self.navigationController.toolbar]; + + +Learn more about `EDAMNote` at [Evernote official developer overview](http://www.evernote.com/about/developer/api/evernote-api.htm#_Toc272854029). \ No newline at end of file diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/close.png b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/close.png new file mode 100644 index 00000000..a89b82fa Binary files /dev/null and b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/close.png differ diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/fbicon.png b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/fbicon.png new file mode 100644 index 00000000..413396be Binary files /dev/null and b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/fbicon.png differ diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login.png b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login.png new file mode 100644 index 00000000..77bc30c2 Binary files /dev/null and b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login.png differ diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login2.png b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login2.png new file mode 100644 index 00000000..03e8eba9 Binary files /dev/null and b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login2.png differ diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login2_down.png b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login2_down.png new file mode 100644 index 00000000..6c4cb4ef Binary files /dev/null and b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login2_down.png differ diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login_down.png b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login_down.png new file mode 100644 index 00000000..b847a0a1 Binary files /dev/null and b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/login_down.png differ diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/logout.png b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/logout.png new file mode 100644 index 00000000..290272aa Binary files /dev/null and b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/logout.png differ diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/logout_down.png b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/logout_down.png new file mode 100644 index 00000000..1ab14b9d Binary files /dev/null and b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.bundle/images/logout_down.png differ diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.h b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.h new file mode 100644 index 00000000..80f5f0ff --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnect.h @@ -0,0 +1,22 @@ +/* + * Copyright 2009 Facebook + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#import "FBSession.h" +#import "FBRequest.h" +#import "FBLoginButton.h" +#import "FBLoginDialog.h" +#import "FBPermissionDialog.h" +#import "FBStreamDialog.h" diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnectGlobal.h b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnectGlobal.h new file mode 100644 index 00000000..99d51eee --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnectGlobal.h @@ -0,0 +1,218 @@ +/* + * Copyright 2009 Facebook + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#import +#import + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +extern const NSString* kFB_SDK_VersionNumber; + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef DEBUG +#define FBLOG +#define FBLOG2 +#else +#define FBLOG +#define FBLOG2 +#endif + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +typedef unsigned long long FBUID; +typedef unsigned long long FBID; + +#define FBAPI_ERROR_DOMAIN @"api.facebook.com" + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Error codes + +#define FBAPI_EC_SUCCESS 0 +#define FBAPI_EC_UNKNOWN 1 +#define FBAPI_EC_SERVICE 2 +#define FBAPI_EC_METHOD 3 +#define FBAPI_EC_TOO_MANY_CALLS 4 +#define FBAPI_EC_BAD_IP 5 +#define FBAPI_EC_HOST_API 6 +#define FBAPI_EC_HOST_UP 7 +#define FBAPI_EC_SECURE 8 +#define FBAPI_EC_RATE 9 +#define FBAPI_EC_PERMISSION_DENIED 10 +#define FBAPI_EC_DEPRECATED 11 +#define FBAPI_EC_VERSION 12 + +#define FBAPI_EC_PARAM 100 +#define FBAPI_EC_PARAM_FBAPI_KEY 101 +#define FBAPI_EC_PARAM_SESSION_KEY 102 +#define FBAPI_EC_PARAM_CALL_ID 103 +#define FBAPI_EC_PARAM_SIGNATURE 104 +#define FBAPI_EC_PARAM_TOO_MANY 105 +#define FBAPI_EC_PARAM_USER_ID 110 +#define FBAPI_EC_PARAM_USER_FIELD 111 +#define FBAPI_EC_PARAM_SOCIAL_FIELD 112 +#define FBAPI_EC_PARAM_EMAIL 113 +#define FBAPI_EC_PARAM_ALBUM_ID 120 +#define FBAPI_EC_PARAM_PHOTO_ID 121 +#define FBAPI_EC_PARAM_FEED_PRIORITY 130 +#define FBAPI_EC_PARAM_CATEGORY 140 +#define FBAPI_EC_PARAM_SUBCATEGORY 141 +#define FBAPI_EC_PARAM_TITLE 142 +#define FBAPI_EC_PARAM_DESCRIPTION 143 +#define FBAPI_EC_PARAM_BAD_JSON 144 +#define FBAPI_EC_PARAM_BAD_EID 150 +#define FBAPI_EC_PARAM_UNKNOWN_CITY 151 +#define FBAPI_EC_PARAM_BAD_PAGE_TYPE 152 + +#define FBAPI_EC_PERMISSION 200 +#define FBAPI_EC_PERMISSION_USER 210 +#define FBAPI_EC_PERMISSION_ALBUM 220 +#define FBAPI_EC_PERMISSION_PHOTO 221 +#define FBAPI_EC_PERMISSION_MESSAGE 230 +#define FBAPI_EC_PERMISSION_MARKUP_OTHER_USER 240 +#define FBAPI_EC_PERMISSION_STATUS_UPDATE 250 +#define FBAPI_EC_PERMISSION_PHOTO_UPLOAD 260 +#define FBAPI_EC_PERMISSION_SMS 270 +#define FBAPI_EC_PERMISSION_CREATE_LISTING 280 +#define FBAPI_EC_PERMISSION_EVENT 290 +#define FBAPI_EC_PERMISSION_LARGE_FBML_TEMPLATE 291 +#define FBAPI_EC_PERMISSION_LIVEMESSAGE 292 +#define FBAPI_EC_PERMISSION_RSVP_EVENT 299 + +#define FBAPI_EC_EDIT 300 +#define FBAPI_EC_EDIT_USER_DATA 310 +#define FBAPI_EC_EDIT_PHOTO 320 +#define FBAPI_EC_EDIT_ALBUM_SIZE 321 +#define FBAPI_EC_EDIT_PHOTO_TAG_SUBJECT 322 +#define FBAPI_EC_EDIT_PHOTO_TAG_PHOTO 323 +#define FBAPI_EC_EDIT_PHOTO_FILE 324 +#define FBAPI_EC_EDIT_PHOTO_PENDING_LIMIT 325 +#define FBAPI_EC_EDIT_PHOTO_TAG_LIMIT 326 +#define FBAPI_EC_EDIT_ALBUM_REORDER_PHOTO_NOT_IN_ALBUM 327 +#define FBAPI_EC_EDIT_ALBUM_REORDER_TOO_FEW_PHOTOS 328 +#define FBAPI_EC_MALFORMED_MARKUP 329 +#define FBAPI_EC_EDIT_MARKUP 330 +#define FBAPI_EC_EDIT_FEED_TOO_MANY_USER_CALLS 340 +#define FBAPI_EC_EDIT_FEED_TOO_MANY_USER_ACTION_CALLS 341 +#define FBAPI_EC_EDIT_FEED_TITLE_LINK 342 +#define FBAPI_EC_EDIT_FEED_TITLE_LENGTH 343 +#define FBAPI_EC_EDIT_FEED_TITLE_NAME 344 +#define FBAPI_EC_EDIT_FEED_TITLE_BLANK 345 +#define FBAPI_EC_EDIT_FEED_BODY_LENGTH 346 +#define FBAPI_EC_EDIT_FEED_PHOTO_SRC 347 +#define FBAPI_EC_EDIT_FEED_PHOTO_LINK 348 +#define FBAPI_EC_EDIT_VIDEO_SIZE 350 +#define FBAPI_EC_EDIT_VIDEO_INVALID_FILE 351 +#define FBAPI_EC_EDIT_VIDEO_INVALID_TYPE 352 +#define FBAPI_EC_EDIT_FEED_TITLE_ARRAY 360 +#define FBAPI_EC_EDIT_FEED_TITLE_PARAMS 361 +#define FBAPI_EC_EDIT_FEED_BODY_ARRAY 362 +#define FBAPI_EC_EDIT_FEED_BODY_PARAMS 363 +#define FBAPI_EC_EDIT_FEED_PHOTO 364 +#define FBAPI_EC_EDIT_FEED_TEMPLATE 365 +#define FBAPI_EC_EDIT_FEED_TARGET 366 +#define FBAPI_EC_USERS_CREATE_INVALID_EMAIL 370 +#define FBAPI_EC_USERS_CREATE_EXISTING_EMAIL 371 +#define FBAPI_EC_USERS_CREATE_BIRTHDAY 372 +#define FBAPI_EC_USERS_CREATE_PASSWORD 373 +#define FBAPI_EC_USERS_REGISTER_INVALID_CREDENTIAL 374 +#define FBAPI_EC_USERS_REGISTER_CONF_FAILURE 375 +#define FBAPI_EC_USERS_REGISTER_EXISTING 376 +#define FBAPI_EC_USERS_REGISTER_DEFAULT_ERROR 377 +#define FBAPI_EC_USERS_REGISTER_PASSWORD_BLANK 378 +#define FBAPI_EC_USERS_REGISTER_PASSWORD_INVALID_CHARS 379 +#define FBAPI_EC_USERS_REGISTER_PASSWORD_SHORT 380 +#define FBAPI_EC_USERS_REGISTER_PASSWORD_WEAK 381 +#define FBAPI_EC_USERS_REGISTER_USERNAME_ERROR 382 +#define FBAPI_EC_USERS_REGISTER_MISSING_INPUT 383 +#define FBAPI_EC_USERS_REGISTER_INCOMPLETE_BDAY 384 +#define FBAPI_EC_USERS_REGISTER_INVALID_EMAIL 385 +#define FBAPI_EC_USERS_REGISTER_EMAIL_DISABLED 386 +#define FBAPI_EC_USERS_REGISTER_ADD_USER_FAILED 387 +#define FBAPI_EC_USERS_REGISTER_NO_GENDER 388 + +#define FBAPI_EC_AUTH_EMAIL 400 +#define FBAPI_EC_AUTH_LOGIN 401 +#define FBAPI_EC_AUTH_SIG 402 +#define FBAPI_EC_AUTH_TIME 403 + +#define FBAPI_EC_SESSION_METHOD 451 +#define FBAPI_EC_SESSION_REQUIRED 453 +#define FBAPI_EC_SESSION_REQUIRED_FOR_SECRET 454 +#define FBAPI_EC_SESSION_CANNOT_USE_SESSION_SECRET 455 + +#define FBAPI_EC_MESG_BANNED 500 +#define FBAPI_EC_MESG_NO_BODY 501 +#define FBAPI_EC_MESG_TOO_LONG 502 +#define FBAPI_EC_MESG_RATE 503 +#define FBAPI_EC_MESG_INVALID_THREAD 504 +#define FBAPI_EC_MESG_INVALID_RECIP 505 +#define FBAPI_EC_POKE_INVALID_RECIP 510 +#define FBAPI_EC_POKE_OUTSTANDING 511 +#define FBAPI_EC_POKE_RATE 512 + +#define FQL_EC_UNKNOWN_ERROR 600 +#define FQL_EC_PARSER_ERROR 601 +#define FQL_EC_UNKNOWN_FIELD 602 +#define FQL_EC_UNKNOWN_TABLE 603 +#define FQL_EC_NO_INDEX 604 +#define FQL_EC_UNKNOWN_FUNCTION 605 +#define FQL_EC_INVALID_PARAM 606 +#define FQL_EC_INVALID_FIELD 607 +#define FQL_EC_INVALID_SESSION 608 + +#define FBAPI_EC_REF_SET_FAILED 700 +#define FBAPI_EC_FB_APP_UNKNOWN_ERROR 750 +#define FBAPI_EC_FB_APP_FETCH_FAILED 751 +#define FBAPI_EC_FB_APP_NO_DATA 752 +#define FBAPI_EC_FB_APP_NO_PERMISSIONS 753 +#define FBAPI_EC_FB_APP_TAG_MISSING 754 + +#define FBAPI_EC_DATA_UNKNOWN_ERROR 800 +#define FBAPI_EC_DATA_INVALID_OPERATION 801 +#define FBAPI_EC_DATA_QUOTA_EXCEEDED 802 +#define FBAPI_EC_DATA_OBJECT_NOT_FOUND 803 +#define FBAPI_EC_DATA_OBJECT_ALREADY_EXISTS 804 +#define FBAPI_EC_DATA_DATABASE_ERROR 805 +#define FBAPI_EC_DATA_CREATE_TEMPLATE_ERROR 806 +#define FBAPI_EC_DATA_TEMPLATE_EXISTS_ERROR 807 +#define FBAPI_EC_DATA_TEMPLATE_HANDLE_TOO_LONG 808 +#define FBAPI_EC_DATA_TEMPLATE_HANDLE_ALREADY_IN_USE 809 +#define FBAPI_EC_DATA_TOO_MANY_TEMPLATE_BUNDLES 810 +#define FBAPI_EC_DATA_MALFORMED_ACTION_LINK 811 +#define FBAPI_EC_DATA_TEMPLATE_USES_RESERVED_TOKEN 812 + +#define FBAPI_EC_NO_SUCH_APP 900 +#define FBAPI_BATCH_TOO_MANY_ITEMS 950 +#define FBAPI_EC_BATCH_ALREADY_STARTED 951 +#define FBAPI_EC_BATCH_NOT_STARTED 952 +#define FBAPI_EC_BATCH_METHOD_NOT_ALLOWED_IN_BATCH_MODE 953 + +#define FBAPI_EC_EVENT_INVALID_TIME 1000 +#define FBAPI_EC_INFO_NO_INFORMATION 1050 +#define FBAPI_EC_INFO_SET_FAILED 1051 + +#define FBAPI_EC_LIVEMESSAGE_SEND_FAILED 1100 +#define FBAPI_EC_LIVEMESSAGE_EVENT_NAME_TOO_LONG 1101 +#define FBAPI_EC_LIVEMESSAGE_MESSAGE_TOO_LONG 1102 + +#define FBAPI_EC_PAGES_CREATE 1201 + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +NSMutableArray* FBCreateNonRetainingArray(); + +BOOL FBIsDeviceIPad(); diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnectGlobal.m b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnectGlobal.m new file mode 100644 index 00000000..77ec5ca4 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBConnectGlobal.m @@ -0,0 +1,45 @@ +/* + * Copyright 2009 Facebook + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#import "FBConnectGlobal.h" + +const NSString* kFB_SDK_VersionNumber = @"iphone/1.3.0"; + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// private + +const void* RetainNoOp(CFAllocatorRef allocator, const void *value) { return value; } +void ReleaseNoOp(CFAllocatorRef allocator, const void *value) { } + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// public + +NSMutableArray* FBCreateNonRetainingArray() { + CFArrayCallBacks callbacks = kCFTypeArrayCallBacks; + callbacks.retain = RetainNoOp; + callbacks.release = ReleaseNoOp; + return (NSMutableArray*)CFArrayCreateMutable(nil, 0, &callbacks); +} + + +BOOL FBIsDeviceIPad() { +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200 + if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { + return YES; + } +#endif + return NO; +} diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBDialog.h b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBDialog.h new file mode 100644 index 00000000..097547bc --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBDialog.h @@ -0,0 +1,140 @@ +/* + * Copyright 2009 Facebook + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#import "FBConnectGlobal.h" + +@protocol FBDialogDelegate; +@class FBSession; + +@interface FBDialog : UIView { + id _delegate; + FBSession* _session; + NSURL* _loadingURL; + UIWebView* _webView; + UIActivityIndicatorView* _spinner; + UIImageView* _iconView; + UILabel* _titleLabel; + UIButton* _closeButton; + UIDeviceOrientation _orientation; + BOOL _showingKeyboard; +} + +/** + * The delegate. + */ +@property(nonatomic,assign) id delegate; + +/** + * The session for which the login is taking place. + */ +@property(nonatomic,assign) FBSession* session; + +/** + * The title that is shown in the header atop the view; + */ +@property(nonatomic,copy) NSString* title; + +/** + * Creates the view but does not display it. + */ +- (id)initWithSession:(FBSession*)session; + +/** + * Displays the view with an animation. + * + * The view will be added to the top of the current key window. + */ +- (void)show; + +/** + * Displays the first page of the dialog. + * + * Do not ever call this directly. It is intended to be overriden by subclasses. + */ +- (void)load; + +/** + * Displays a URL in the dialog. + */ +- (void)loadURL:(NSString*)url method:(NSString*)method get:(NSDictionary*)getParams + post:(NSDictionary*)postParams; + +/** + * Hides the view and notifies delegates of success or cancellation. + */ +- (void)dismissWithSuccess:(BOOL)success animated:(BOOL)animated; + +/** + * Hides the view and notifies delegates of an error. + */ +- (void)dismissWithError:(NSError*)error animated:(BOOL)animated; + +/** + * Subclasses may override to perform actions just prior to showing the dialog. + */ +- (void)dialogWillAppear; + +/** + * Subclasses may override to perform actions just after the dialog is hidden. + */ +- (void)dialogWillDisappear; + +/** + * Subclasses should override to process data returned from the server in a 'fbconnect' url. + * + * Implementations must call dismissWithSuccess:YES at some point to hide the dialog. + */ +- (void)dialogDidSucceed:(NSURL*)url; + +- (void)bounce2AnimationStopped; +- (void)keyboardWillShow:(NSNotification*)notification; +- (void)keyboardWillHide:(NSNotification*)notification; +@end + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +@protocol FBDialogDelegate + +@optional + +/** + * Called when the dialog succeeds and is about to be dismissed. + */ +- (void)dialogDidSucceed:(FBDialog*)dialog; + +/** + * Called when the dialog is cancelled and is about to be dismissed. + */ +- (void)dialogDidCancel:(FBDialog*)dialog; + +/** + * Called when dialog failed to load due to an error. + */ +- (void)dialog:(FBDialog*)dialog didFailWithError:(NSError*)error; + +/** + * Asks if a link touched by a user should be opened in an external browser. + * + * If a user touches a link, the default behavior is to open the link in the Safari browser, + * which will cause your app to quit. You may want to prevent this from happening, open the link + * in your own internal browser, or perhaps warn the user that they are about to leave your app. + * If so, implement this method on your delegate and return NO. If you warn the user, you + * should hold onto the URL and once you have received their acknowledgement open the URL yourself + * using [[UIApplication sharedApplication] openURL:]. + */ +- (BOOL)dialog:(FBDialog*)dialog shouldOpenURLInExternalBrowser:(NSURL*)url; + +@end diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBDialog.m b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBDialog.m new file mode 100644 index 00000000..1aaed9f4 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBDialog.m @@ -0,0 +1,628 @@ +/* + * Copyright 2009 Facebook + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#import "FBDialog.h" +#import "FBSession.h" + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// global + +static NSString* kDefaultTitle = @"Connect to Facebook"; +static NSString* kStringBoundary = @"3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f"; + +static CGFloat kFacebookBlue[4] = {0.42578125, 0.515625, 0.703125, 1.0}; +static CGFloat kBorderGray[4] = {0.3, 0.3, 0.3, 0.8}; +static CGFloat kBorderBlack[4] = {0.3, 0.3, 0.3, 1}; +static CGFloat kBorderBlue[4] = {0.23, 0.35, 0.6, 1.0}; + +static CGFloat kTransitionDuration = 0.3; + +static CGFloat kTitleMarginX = 8; +static CGFloat kTitleMarginY = 4; +static CGFloat kPadding = 10; +static CGFloat kBorderWidth = 10; + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +@implementation FBDialog + +@synthesize session = _session, delegate = _delegate; + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// private + +- (void)addRoundedRectToPath:(CGContextRef)context rect:(CGRect)rect radius:(float)radius { + CGContextBeginPath(context); + CGContextSaveGState(context); + + if (radius == 0) { + CGContextTranslateCTM(context, CGRectGetMinX(rect), CGRectGetMinY(rect)); + CGContextAddRect(context, rect); + } else { + rect = CGRectOffset(CGRectInset(rect, 0.5, 0.5), 0.5, 0.5); + CGContextTranslateCTM(context, CGRectGetMinX(rect)-0.5, CGRectGetMinY(rect)-0.5); + CGContextScaleCTM(context, radius, radius); + float fw = CGRectGetWidth(rect) / radius; + float fh = CGRectGetHeight(rect) / radius; + + CGContextMoveToPoint(context, fw, fh/2); + CGContextAddArcToPoint(context, fw, fh, fw/2, fh, 1); + CGContextAddArcToPoint(context, 0, fh, 0, fh/2, 1); + CGContextAddArcToPoint(context, 0, 0, fw/2, 0, 1); + CGContextAddArcToPoint(context, fw, 0, fw, fh/2, 1); + } + + CGContextClosePath(context); + CGContextRestoreGState(context); +} + +- (void)drawRect:(CGRect)rect fill:(const CGFloat*)fillColors radius:(CGFloat)radius { + CGContextRef context = UIGraphicsGetCurrentContext(); + CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB(); + + if (fillColors) { + CGContextSaveGState(context); + CGContextSetFillColor(context, fillColors); + if (radius) { + [self addRoundedRectToPath:context rect:rect radius:radius]; + CGContextFillPath(context); + } else { + CGContextFillRect(context, rect); + } + CGContextRestoreGState(context); + } + + CGColorSpaceRelease(space); +} + +- (void)strokeLines:(CGRect)rect stroke:(const CGFloat*)strokeColor { + CGContextRef context = UIGraphicsGetCurrentContext(); + CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB(); + + CGContextSaveGState(context); + CGContextSetStrokeColorSpace(context, space); + CGContextSetStrokeColor(context, strokeColor); + CGContextSetLineWidth(context, 1.0); + + { + CGPoint points[] = {rect.origin.x+0.5, rect.origin.y-0.5, + rect.origin.x+rect.size.width, rect.origin.y-0.5}; + CGContextStrokeLineSegments(context, points, 2); + } + { + CGPoint points[] = {rect.origin.x+0.5, rect.origin.y+rect.size.height-0.5, + rect.origin.x+rect.size.width-0.5, rect.origin.y+rect.size.height-0.5}; + CGContextStrokeLineSegments(context, points, 2); + } + { + CGPoint points[] = {rect.origin.x+rect.size.width-0.5, rect.origin.y, + rect.origin.x+rect.size.width-0.5, rect.origin.y+rect.size.height}; + CGContextStrokeLineSegments(context, points, 2); + } + { + CGPoint points[] = {rect.origin.x+0.5, rect.origin.y, + rect.origin.x+0.5, rect.origin.y+rect.size.height}; + CGContextStrokeLineSegments(context, points, 2); + } + + CGContextRestoreGState(context); + + CGColorSpaceRelease(space); +} + +- (BOOL)shouldRotateToOrientation:(UIDeviceOrientation)orientation { + if (orientation == _orientation) { + return NO; + } else { + return orientation == UIDeviceOrientationLandscapeLeft + || orientation == UIDeviceOrientationLandscapeRight + || orientation == UIDeviceOrientationPortrait + || orientation == UIDeviceOrientationPortraitUpsideDown; + } +} + +- (CGAffineTransform)transformForOrientation { + UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; + if (orientation == UIInterfaceOrientationLandscapeLeft) { + return CGAffineTransformMakeRotation(M_PI*1.5); + } else if (orientation == UIInterfaceOrientationLandscapeRight) { + return CGAffineTransformMakeRotation(M_PI/2); + } else if (orientation == UIInterfaceOrientationPortraitUpsideDown) { + return CGAffineTransformMakeRotation(-M_PI); + } else { + return CGAffineTransformIdentity; + } +} + +- (void)sizeToFitOrientation:(BOOL)transform { + if (transform) { + self.transform = CGAffineTransformIdentity; + } + + CGRect frame = [UIScreen mainScreen].applicationFrame; + CGPoint center = CGPointMake( + frame.origin.x + ceil(frame.size.width/2), + frame.origin.y + ceil(frame.size.height/2)); + + CGFloat scale_factor = 1.0f; + if (FBIsDeviceIPad()) { + // On the iPad the dialog's dimensions should only be 60% of the screen's + scale_factor = 0.6f; + } + + CGFloat width = floor(scale_factor * frame.size.width) - kPadding * 2; + CGFloat height = floor(scale_factor * frame.size.height) - kPadding * 2; + + _orientation = [UIApplication sharedApplication].statusBarOrientation; + if (UIInterfaceOrientationIsLandscape(_orientation)) { + self.frame = CGRectMake(kPadding, kPadding, height, width); + } else { + self.frame = CGRectMake(kPadding, kPadding, width, height); + } + self.center = center; + + if (transform) { + self.transform = [self transformForOrientation]; + } +} + +- (void)updateWebOrientation { + UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; + if (UIInterfaceOrientationIsLandscape(orientation)) { + [_webView stringByEvaluatingJavaScriptFromString: + @"document.body.setAttribute('orientation', 90);"]; + } else { + [_webView stringByEvaluatingJavaScriptFromString: + @"document.body.removeAttribute('orientation');"]; + } +} + +- (void)bounce1AnimationStopped { + [UIView beginAnimations:nil context:nil]; + [UIView setAnimationDuration:kTransitionDuration/2]; + [UIView setAnimationDelegate:self]; + [UIView setAnimationDidStopSelector:@selector(bounce2AnimationStopped)]; + self.transform = CGAffineTransformScale([self transformForOrientation], 0.9, 0.9); + [UIView commitAnimations]; +} + +- (void)bounce2AnimationStopped { + [UIView beginAnimations:nil context:nil]; + [UIView setAnimationDuration:kTransitionDuration/2]; + self.transform = [self transformForOrientation]; + [UIView commitAnimations]; +} + +- (NSURL*)generateURL:(NSString*)baseURL params:(NSDictionary*)params { + if (params) { + NSMutableArray* pairs = [NSMutableArray array]; + for (NSString* key in params.keyEnumerator) { + NSString* value = [params objectForKey:key]; + NSString* val = [value stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + NSString* pair = [NSString stringWithFormat:@"%@=%@", key, val]; + [pairs addObject:pair]; + } + + NSString* query = [pairs componentsJoinedByString:@"&"]; + NSString* url = [NSString stringWithFormat:@"%@?%@", baseURL, query]; + return [NSURL URLWithString:url]; + } else { + return [NSURL URLWithString:baseURL]; + } +} + +- (NSMutableData*)generatePostBody:(NSDictionary*)params { + if (!params) { + return nil; + } + + NSMutableData* body = [NSMutableData data]; + NSString* endLine = [NSString stringWithFormat:@"\r\n--%@\r\n", kStringBoundary]; + + [body appendData:[[NSString stringWithFormat:@"--%@\r\n", kStringBoundary] + dataUsingEncoding:NSUTF8StringEncoding]]; + + for (id key in [params keyEnumerator]) { + [body appendData:[[NSString + stringWithFormat:@"Content-Disposition: form-data; name=\"%@\"\r\n\r\n", key] + dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[[params valueForKey:key] dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[endLine dataUsingEncoding:NSUTF8StringEncoding]]; + } + + return body; +} + +- (void)addObservers { + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(deviceOrientationDidChange:) + name:@"UIDeviceOrientationDidChangeNotification" object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(keyboardWillShow:) name:@"UIKeyboardWillShowNotification" object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(keyboardWillHide:) name:@"UIKeyboardWillHideNotification" object:nil]; +} + +- (void)removeObservers { + [[NSNotificationCenter defaultCenter] removeObserver:self + name:@"UIDeviceOrientationDidChangeNotification" object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self + name:@"UIKeyboardWillShowNotification" object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self + name:@"UIKeyboardWillHideNotification" object:nil]; +} + +- (void)postDismissCleanup { + [self removeObservers]; + [self removeFromSuperview]; +} + +- (void)dismiss:(BOOL)animated { + [self dialogWillDisappear]; + + [_loadingURL release]; + _loadingURL = nil; + + if (animated) { + [UIView beginAnimations:nil context:nil]; + [UIView setAnimationDuration:kTransitionDuration]; + [UIView setAnimationDelegate:self]; + [UIView setAnimationDidStopSelector:@selector(postDismissCleanup)]; + self.alpha = 0; + [UIView commitAnimations]; + } else { + [self postDismissCleanup]; + } +} + +- (void)cancel { + [self dismissWithSuccess:NO animated:YES]; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// NSObject + +- (id)init { + return [self initWithSession:[FBSession session]]; +} + +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + +- (id)initWithSession:(FBSession*)session { + if (self = [super initWithFrame:CGRectZero]) { + _delegate = nil; + _session = [session retain]; + _loadingURL = nil; + _orientation = UIDeviceOrientationUnknown; + _showingKeyboard = NO; + + self.backgroundColor = [UIColor clearColor]; + self.autoresizesSubviews = YES; + self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + self.contentMode = UIViewContentModeRedraw; + + UIImage* iconImage = [UIImage imageNamed:@"FBConnect.bundle/images/fbicon.png"]; + UIImage* closeImage = [UIImage imageNamed:@"FBConnect.bundle/images/close.png"]; + + _iconView = [[UIImageView alloc] initWithImage:iconImage]; + [self addSubview:_iconView]; + + UIColor* color = [UIColor colorWithRed:167.0/255 green:184.0/255 blue:216.0/255 alpha:1]; + _closeButton = [[UIButton buttonWithType:UIButtonTypeCustom] retain]; + [_closeButton setImage:closeImage forState:UIControlStateNormal]; + [_closeButton setTitleColor:color forState:UIControlStateNormal]; + [_closeButton setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted]; + [_closeButton addTarget:self action:@selector(cancel) + forControlEvents:UIControlEventTouchUpInside]; + if ([_closeButton respondsToSelector:@selector(titleLabel)]) { + _closeButton.titleLabel.font = [UIFont boldSystemFontOfSize:12]; + } else { // This triggers a deprecation warning but at least it will work on OS 2.x + _closeButton.font = [UIFont boldSystemFontOfSize:12]; + } + _closeButton.showsTouchWhenHighlighted = YES; + _closeButton.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin + | UIViewAutoresizingFlexibleBottomMargin; + [self addSubview:_closeButton]; + + CGFloat titleLabelFontSize = (FBIsDeviceIPad() ? 18 : 14); + _titleLabel = [[UILabel alloc] initWithFrame:CGRectZero]; + _titleLabel.text = kDefaultTitle; + _titleLabel.backgroundColor = [UIColor clearColor]; + _titleLabel.textColor = [UIColor whiteColor]; + _titleLabel.font = [UIFont boldSystemFontOfSize:titleLabelFontSize]; + _titleLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin + | UIViewAutoresizingFlexibleBottomMargin; + [self addSubview:_titleLabel]; + + _webView = [[UIWebView alloc] initWithFrame:CGRectZero]; + _webView.delegate = self; + _webView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + [self addSubview:_webView]; + + _spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle: + UIActivityIndicatorViewStyleWhiteLarge]; + _spinner.autoresizingMask = + UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin + | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; + [self addSubview:_spinner]; + } + return self; +} + +- (void)dealloc { + _webView.delegate = nil; + [_webView release]; + [_spinner release]; + [_titleLabel release]; + [_iconView release]; + [_closeButton release]; + [_loadingURL release]; + [_session release]; + [super dealloc]; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// UIView + +- (void)drawRect:(CGRect)rect { + CGRect grayRect = CGRectOffset(rect, -0.5, -0.5); + [self drawRect:grayRect fill:kBorderGray radius:10]; + + CGRect headerRect = CGRectMake( + ceil(rect.origin.x + kBorderWidth), ceil(rect.origin.y + kBorderWidth), + rect.size.width - kBorderWidth*2, _titleLabel.frame.size.height); + [self drawRect:headerRect fill:kFacebookBlue radius:0]; + [self strokeLines:headerRect stroke:kBorderBlue]; + + CGRect webRect = CGRectMake( + ceil(rect.origin.x + kBorderWidth), headerRect.origin.y + headerRect.size.height, + rect.size.width - kBorderWidth*2, _webView.frame.size.height+1); + [self strokeLines:webRect stroke:kBorderBlack]; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// UIWebViewDelegate + +- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request + navigationType:(UIWebViewNavigationType)navigationType { + NSURL* url = request.URL; + if ([url.scheme isEqualToString:@"fbconnect"]) { + if ([url.resourceSpecifier isEqualToString:@"cancel"]) { + [self dismissWithSuccess:NO animated:YES]; + } else { + [self dialogDidSucceed:url]; + } + return NO; + } else if ([_loadingURL isEqual:url]) { + return YES; + } else if (navigationType == UIWebViewNavigationTypeLinkClicked) { + if ([_delegate respondsToSelector:@selector(dialog:shouldOpenURLInExternalBrowser:)]) { + if (![_delegate dialog:self shouldOpenURLInExternalBrowser:url]) { + return NO; + } + } + + [[UIApplication sharedApplication] openURL:request.URL]; + return NO; + } else { + return YES; + } +} + +- (void)webViewDidFinishLoad:(UIWebView *)webView { + [_spinner stopAnimating]; + _spinner.hidden = YES; + + self.title = [_webView stringByEvaluatingJavaScriptFromString:@"document.title"]; + [self updateWebOrientation]; +} + +- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { + // 102 == WebKitErrorFrameLoadInterruptedByPolicyChange + if (!([error.domain isEqualToString:@"WebKitErrorDomain"] && error.code == 102)) { + [self dismissWithError:error animated:YES]; + } +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// UIDeviceOrientationDidChangeNotification + +- (void)deviceOrientationDidChange:(void*)object { + UIDeviceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; + if (!_showingKeyboard && [self shouldRotateToOrientation:orientation]) { + [self updateWebOrientation]; + + CGFloat duration = [UIApplication sharedApplication].statusBarOrientationAnimationDuration; + [UIView beginAnimations:nil context:nil]; + [UIView setAnimationDuration:duration]; + [self sizeToFitOrientation:YES]; + [UIView commitAnimations]; + } +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// UIKeyboardNotifications + +- (void)keyboardWillShow:(NSNotification*)notification { + if (FBIsDeviceIPad()) { + // On the iPad the screen is large enough that we don't need to + // resize the dialog to accomodate the keyboard popping up + return; + } + + UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; + if (UIInterfaceOrientationIsLandscape(orientation)) { + _webView.frame = CGRectInset(_webView.frame, + -(kPadding + kBorderWidth), + -(kPadding + kBorderWidth) - _titleLabel.frame.size.height); + } + + _showingKeyboard = YES; +} + +- (void)keyboardWillHide:(NSNotification*)notification { + if (FBIsDeviceIPad()) { + return; + } + UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation; + if (UIInterfaceOrientationIsLandscape(orientation)) { + _webView.frame = CGRectInset(_webView.frame, + kPadding + kBorderWidth, + kPadding + kBorderWidth + _titleLabel.frame.size.height); + } + + _showingKeyboard = NO; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// public + +- (NSString*)title { + return _titleLabel.text; +} + +- (void)setTitle:(NSString*)title { + _titleLabel.text = title; +} + +- (void)show { + [self load]; + [self sizeToFitOrientation:NO]; + + CGFloat innerWidth = self.frame.size.width - (kBorderWidth+1)*2; + [_iconView sizeToFit]; + [_titleLabel sizeToFit]; + [_closeButton sizeToFit]; + + _titleLabel.frame = CGRectMake( + kBorderWidth + kTitleMarginX + _iconView.frame.size.width + kTitleMarginX, + kBorderWidth, + innerWidth - (_titleLabel.frame.size.height + _iconView.frame.size.width + kTitleMarginX*2), + _titleLabel.frame.size.height + kTitleMarginY*2); + + _iconView.frame = CGRectMake( + kBorderWidth + kTitleMarginX, + kBorderWidth + floor(_titleLabel.frame.size.height/2 - _iconView.frame.size.height/2), + _iconView.frame.size.width, + _iconView.frame.size.height); + + _closeButton.frame = CGRectMake( + self.frame.size.width - (_titleLabel.frame.size.height + kBorderWidth), + kBorderWidth, + _titleLabel.frame.size.height, + _titleLabel.frame.size.height); + + _webView.frame = CGRectMake( + kBorderWidth+1, + kBorderWidth + _titleLabel.frame.size.height, + innerWidth, + self.frame.size.height - (_titleLabel.frame.size.height + 1 + kBorderWidth*2)); + + [_spinner sizeToFit]; + [_spinner startAnimating]; + _spinner.center = _webView.center; + + UIWindow* window = [UIApplication sharedApplication].keyWindow; + if (!window) { + window = [[UIApplication sharedApplication].windows objectAtIndex:0]; + } + [window addSubview:self]; + + [self dialogWillAppear]; + + self.transform = CGAffineTransformScale([self transformForOrientation], 0.001, 0.001); + [UIView beginAnimations:nil context:nil]; + [UIView setAnimationDuration:kTransitionDuration/1.5]; + [UIView setAnimationDelegate:self]; + [UIView setAnimationDidStopSelector:@selector(bounce1AnimationStopped)]; + self.transform = CGAffineTransformScale([self transformForOrientation], 1.1, 1.1); + [UIView commitAnimations]; + + [self addObservers]; +} + +- (void)dismissWithSuccess:(BOOL)success animated:(BOOL)animated { + if (success) { + if ([_delegate respondsToSelector:@selector(dialogDidSucceed:)]) { + [_delegate dialogDidSucceed:self]; + } + } else { + if ([_delegate respondsToSelector:@selector(dialogDidCancel:)]) { + [_delegate dialogDidCancel:self]; + } + } + + [self dismiss:animated]; +} + +- (void)dismissWithError:(NSError*)error animated:(BOOL)animated { + if ([_delegate respondsToSelector:@selector(dialog:didFailWithError:)]) { + [_delegate dialog:self didFailWithError:error]; + } + + [self dismiss:animated]; +} + +- (void)load { + // Intended for subclasses to override +} + +- (void)loadURL:(NSString*)url method:(NSString*)method get:(NSDictionary*)getParams + post:(NSDictionary*)postParams { + // This "test cookie" is required by login.php, or it complains that you need to enable JavaScript + NSHTTPCookieStorage* cookies = [NSHTTPCookieStorage sharedHTTPCookieStorage]; + NSHTTPCookie* testCookie = [NSHTTPCookie cookieWithProperties: + [NSDictionary dictionaryWithObjectsAndKeys: + @"1", NSHTTPCookieValue, + @"test_cookie", NSHTTPCookieName, + @".facebook.com", NSHTTPCookieDomain, + @"/", NSHTTPCookiePath, + nil]]; + [cookies setCookie:testCookie]; + + [_loadingURL release]; + _loadingURL = [[self generateURL:url params:getParams] retain]; + NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:_loadingURL]; + + if (method) { + [request setHTTPMethod:method]; + + if ([[method uppercaseString] isEqualToString:@"POST"]) { + NSString* contentType = [NSString + stringWithFormat:@"multipart/form-data; boundary=%@", kStringBoundary]; + [request setValue:contentType forHTTPHeaderField:@"Content-Type"]; + + NSData* body = [self generatePostBody:postParams]; + if (body) { + [request setHTTPBody:body]; + } + } + } + + [_webView loadRequest:request]; +} + +- (void)dialogWillAppear { +} + +- (void)dialogWillDisappear { +} + +- (void)dialogDidSucceed:(NSURL*)url { + [self dismissWithSuccess:YES animated:YES]; +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBFeedDialog.h b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBFeedDialog.h new file mode 100644 index 00000000..50ba0f61 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBFeedDialog.h @@ -0,0 +1,42 @@ +/* + * Copyright 2009 Facebook + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#import "FBDialog.h" + +@interface FBFeedDialog : FBDialog { + long long _templateBundleId; + NSString* _templateData; + NSString* _bodyGeneral; +} + +/** + * The id for a previously registered template bundle. + */ +@property(nonatomic) long long templateBundleId; + +/** + * A JSON string containing template data. + * + * See http://wiki.developers.facebook.com/index.php/Template_Data + */ +@property(nonatomic,copy) NSString* templateData; + +/** + * Additional markup for a short story. + */ +@property(nonatomic,copy) NSString* bodyGeneral; + +@end diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBFeedDialog.m b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBFeedDialog.m new file mode 100644 index 00000000..cc310fef --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBFeedDialog.m @@ -0,0 +1,85 @@ +/* + * Copyright 2009 Facebook + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#import "FBFeedDialog.h" +#import "FBSession.h" + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// global + +static NSString* kFeedURL = @"http://www.facebook.com/connect/prompt_feed.php"; + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +@implementation FBFeedDialog + +@synthesize templateBundleId = _templateBundleId, templateData = _templateData, + bodyGeneral = _bodyGeneral; + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// private + +- (NSString*)generateFeedInfo { + NSMutableArray* pairs = [NSMutableArray array]; + + if (_templateBundleId) { + [pairs addObject:[NSString stringWithFormat:@"\"template_id\": %lld", _templateBundleId]]; + } + if (_templateData) { + [pairs addObject:[NSString stringWithFormat:@"\"template_data\": %@", _templateData]]; + } + if (_bodyGeneral) { + [pairs addObject:[NSString stringWithFormat:@"\"body_general\": \"%@\"", _bodyGeneral]]; + } + + return [NSString stringWithFormat:@"{%@}", [pairs componentsJoinedByString:@","]]; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// NSObject + +- (id)initWithSession:(FBSession*)session { + if (self = [super initWithSession:session]) { + _templateBundleId = 0; + _templateData = nil; + _bodyGeneral = nil; + } + return self; +} + +- (void)dealloc { + [_templateData release]; + [_bodyGeneral release]; + [super dealloc]; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// FBDialog + +- (void)load { + NSDictionary* getParams = [NSDictionary dictionaryWithObjectsAndKeys: + @"touch", @"display", nil]; + + NSString* feedInfo = [self generateFeedInfo]; + NSDictionary* postParams = [NSDictionary dictionaryWithObjectsAndKeys: + _session.apiKey, @"api_key", _session.sessionKey, @"session_key", + @"1", @"preview", @"fbconnect:success", @"callback", @"fbconnect:cancel", @"cancel", + feedInfo, @"feed_info", @"self_feed", @"feed_target_type", nil]; + + [self loadURL:kFeedURL method:@"POST" get:getParams post:postParams]; +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBLoginButton.h b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBLoginButton.h new file mode 100644 index 00000000..4f98f4f5 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBLoginButton.h @@ -0,0 +1,49 @@ +/* + * Copyright 2009 Facebook + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#import "FBSession.h" + +typedef enum { + FBLoginButtonStyleNormal, + FBLoginButtonStyleWide, +} FBLoginButtonStyle; + +/** + * Standard button which lets the user log in or out of the session. + * + * The button will automatically change to reflect the state of the session, showing + * "login" if the session is not connected, and "logout" if the session is connected. + */ +@interface FBLoginButton : UIControl { + FBLoginButtonStyle _style; + FBSession* _session; + UIImageView* _imageView; +} + +/** + * The visual style of the button. + */ +@property(nonatomic) FBLoginButtonStyle style; + +/** + * The session object that the button will log in and out of. + * + * The default value is the global session singleton, so there is usually no need to + * set this property yourself. + */ +@property(nonatomic,retain) FBSession* session; + +@end diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBLoginButton.m b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBLoginButton.m new file mode 100644 index 00000000..06b5818b --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBLoginButton.m @@ -0,0 +1,196 @@ +/* + * Copyright 2009 Facebook + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#import "FBLoginButton.h" +#import "FBLoginDialog.h" + +#import + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +static UIAccessibilityTraits *traitImage = nil, *traitButton = nil; + +@implementation FBLoginButton + +@synthesize session = _session, style = _style; + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// private + ++ (void)initialize { + if (self == [FBLoginButton class]) { + // Try to load the accessibility trait values on OS 3.0 + traitImage = dlsym(RTLD_SELF, "UIAccessibilityTraitImage"); + traitButton = dlsym(RTLD_SELF, "UIAccessibilityTraitButton"); + } +} + +- (UIImage*)buttonImage { + if (_session.isConnected) { + return [UIImage imageNamed:@"FBConnect.bundle/images/logout.png"]; + } else { + if (_style == FBLoginButtonStyleNormal) { + return [UIImage imageNamed:@"FBConnect.bundle/images/login.png"]; + } else if (_style == FBLoginButtonStyleWide) { + return [UIImage imageNamed:@"FBConnect.bundle/images/login2.png"]; + } else { + return nil; + } + } +} + +- (UIImage*)buttonHighlightedImage { + if (_session.isConnected) { + return [UIImage imageNamed:@"FBConnect.bundle/images/logout_down.png"]; + } else { + if (_style == FBLoginButtonStyleNormal) { + return [UIImage imageNamed:@"FBConnect.bundle/images/login_down.png"]; + } else if (_style == FBLoginButtonStyleWide) { + return [UIImage imageNamed:@"FBConnect.bundle/images/login2_down.png"]; + } else { + return nil; + } + } +} + +- (void)updateImage { + if (self.highlighted) { + _imageView.image = [self buttonHighlightedImage]; + } else { + _imageView.image = [self buttonImage]; + } +} + +- (void)touchUpInside { + if (_session.isConnected) { + [_session logout]; + } else { + FBLoginDialog* dialog = [[[FBLoginDialog alloc] initWithSession:_session] autorelease]; + [dialog show]; + } +} + +- (void)initButton { + _style = FBLoginButtonStyleNormal; + + _imageView = [[UIImageView alloc] initWithFrame:CGRectZero]; + _imageView.contentMode = UIViewContentModeCenter; + [self addSubview:_imageView]; + + self.backgroundColor = [UIColor clearColor]; + [self addTarget:self action:@selector(touchUpInside) + forControlEvents:UIControlEventTouchUpInside]; + + self.session = [FBSession session]; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// NSObject + +- (id)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { + [self initButton]; + if (CGRectIsEmpty(frame)) { + [self sizeToFit]; + } + } + return self; +} + +- (void)awakeFromNib { + [self initButton]; +} + +- (void)dealloc { + [_session.delegates removeObject:self]; + [_session release]; + [_imageView release]; + [super dealloc]; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// UIView + +- (CGSize)sizeThatFits:(CGSize)size { + return _imageView.image.size; +} + +- (void)layoutSubviews { + _imageView.frame = self.bounds; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// UIControl + +- (void)setHighlighted:(BOOL)highlighted { + [super setHighlighted:highlighted]; + [self updateImage]; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// FBSessionDelegate + +- (void)session:(FBSession*)session didLogin:(FBUID)uid { + [self updateImage]; +} + +- (void)sessionDidLogout:(FBSession*)session { + [self updateImage]; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// UIAccessibility informal protocol (on 3.0 only) + +- (BOOL)isAccessibilityElement { + return YES; +} + +- (UIAccessibilityTraits)accessibilityTraits { + if (traitImage && traitButton) + return [super accessibilityTraits]|*traitImage|*traitButton; + else + return [super accessibilityTraits]; +} + +- (NSString *)accessibilityLabel { + if (_session.isConnected) { + return NSLocalizedString(@"Disconnect from Facebook", @"Accessibility label"); + } else { + return NSLocalizedString(@"Connect to Facebook", @"Accessibility label"); + } +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// public + +- (void)setSession:(FBSession*)session { + if (session != _session) { + [_session.delegates removeObject:self]; + [_session release]; + _session = [session retain]; + [_session.delegates addObject:self]; + + [self updateImage]; + } +} + +- (void)setStyle:(FBLoginButtonStyle)style { + _style = style; + + [self updateImage]; +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBLoginDialog.h b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBLoginDialog.h new file mode 100644 index 00000000..8eb0b908 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBLoginDialog.h @@ -0,0 +1,24 @@ +/* + * Copyright 2009 Facebook + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#import "FBDialog.h" +#import "FBRequest.h" + +@interface FBLoginDialog : FBDialog { + FBRequest* _getSessionRequest; +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBLoginDialog.m b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBLoginDialog.m new file mode 100644 index 00000000..9d49f603 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBLoginDialog.m @@ -0,0 +1,131 @@ +/* + * Copyright 2009 Facebook + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#import "FBLoginDialog.h" +#import "FBSession.h" +#import "FBRequest.h" + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// global + +static NSString* kLoginURL = @"http://www.facebook.com/login.php"; + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +@implementation FBLoginDialog + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// private + +- (void)connectToGetSession:(NSString*)token { + _getSessionRequest = [[FBRequest requestWithSession:_session delegate:self] retain]; + NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObject:token forKey:@"auth_token"]; + if (!_session.apiSecret) { + [params setObject:@"1" forKey:@"generate_session_secret"]; + } + + if (_session.getSessionProxy) { + [_getSessionRequest post:_session.getSessionProxy params:params]; + } else { + [_getSessionRequest call:@"facebook.auth.getSession" params:params]; + } +} + +- (void)loadLoginPage { + NSDictionary* params = [NSDictionary dictionaryWithObjectsAndKeys: + @"1", @"fbconnect", @"touch", @"connect_display", _session.apiKey, @"api_key", + @"fbconnect://success", @"next", nil]; + + [self loadURL:kLoginURL method:@"GET" get:params post:nil]; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// NSObject + +- (id)initWithSession:(FBSession*)session { + if (self = [super initWithSession:session]) { + _getSessionRequest = nil; + } + return self; +} + +- (void)dealloc { + _getSessionRequest.delegate = nil; + [_getSessionRequest release]; + [super dealloc]; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// FBDialog + +- (void)load { + [self loadLoginPage]; +} + +- (void)dialogWillDisappear { + [_webView stringByEvaluatingJavaScriptFromString:@"email.blur();"]; + + [_getSessionRequest cancel]; + + if (![_session isConnected]) { + [_session cancelLogin]; + } +} + +- (void)dialogDidSucceed:(NSURL*)url { + NSString* q = url.query; + NSRange start = [q rangeOfString:@"auth_token="]; + if (start.location != NSNotFound) { + NSRange end = [q rangeOfString:@"&"]; + NSUInteger offset = start.location+start.length; + NSString* token = end.location == NSNotFound + ? [q substringFromIndex:offset] + : [q substringWithRange:NSMakeRange(offset, end.location-offset)]; + + if (token) { + [self connectToGetSession:token]; + } + } +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// FBRequestDelegate + +- (void)request:(FBRequest*)request didLoad:(id)result { + NSDictionary* object = result; + FBUID uid = [[object objectForKey:@"uid"] longLongValue]; + NSString* sessionKey = [object objectForKey:@"session_key"]; + NSString* sessionSecret = [object objectForKey:@"secret"]; + NSTimeInterval expires = [[object objectForKey:@"expires"] floatValue]; + NSDate* expiration = expires ? [NSDate dateWithTimeIntervalSince1970:expires] : nil; + + [_getSessionRequest release]; + _getSessionRequest = nil; + + [_session begin:uid sessionKey:sessionKey sessionSecret:sessionSecret expires:expiration]; + [_session resume]; + + [self dismissWithSuccess:YES animated:YES]; +} + +- (void)request:(FBRequest*)request didFailWithError:(NSError*)error { + [_getSessionRequest release]; + _getSessionRequest = nil; + + [self dismissWithError:error animated:YES]; +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBPermissionDialog.h b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBPermissionDialog.h new file mode 100644 index 00000000..d203ddbe --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBPermissionDialog.h @@ -0,0 +1,31 @@ +/* + * Copyright 2009 Facebook + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#import "FBLoginDialog.h" + +@interface FBPermissionDialog : FBLoginDialog { + NSString* _permission; + NSTimer* _redirectTimer; +} + +/** + * The extended permission to request. + * + * See http://wiki.developers.facebook.com/index.php/Extended_permissions + */ +@property(nonatomic,copy) NSString* permission; + +@end diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBPermissionDialog.m b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBPermissionDialog.m new file mode 100644 index 00000000..f604ef6e --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBPermissionDialog.m @@ -0,0 +1,101 @@ +/* + * Copyright 2009 Facebook + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#import "FBPermissionDialog.h" +#import "FBSession.h" + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// global + +static NSString* kPermissionURL = @"http://www.facebook.com/connect/prompt_permission.php"; + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +@implementation FBPermissionDialog + +@synthesize permission = _permission; + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// private + +- (void)redirectToLoginDelayed { + _redirectTimer = nil; + + // This loads the login page, which will just redirect back to the callback url + // since the login cookies are set + [super load]; +} + +- (void)redirectToLogin { + _redirectTimer = [NSTimer scheduledTimerWithTimeInterval:0.01 target:self + selector:@selector(redirectToLoginDelayed) userInfo:nil repeats:NO]; +} + + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// NSObject + +- (id)initWithSession:(FBSession*)session { + if (self = [super initWithSession:session]) { + _permission = nil; + _redirectTimer = nil; + } + return self; +} + +- (void)dealloc { + [_redirectTimer invalidate]; + [_permission release]; + [super dealloc]; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// FBDialog + +- (void)load { + NSDictionary* params = [NSDictionary dictionaryWithObjectsAndKeys: + @"touch", @"display", _session.apiKey, @"api_key", _session.sessionKey, @"session_key", + _permission, @"ext_perm", @"fbconnect:success", @"next", @"fbconnect:cancel", @"cancel", nil]; + + [self loadURL:kPermissionURL method:@"GET" get:params post:nil]; +} + +- (void)dialogDidSucceed:(NSURL*)url { + if ([_permission isEqualToString:@"offline_access"]) { + [super dialogDidSucceed:url]; + } else { + [self dismissWithSuccess:YES animated:YES]; + } +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// UIWebViewDelegate + +- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request + navigationType:(UIWebViewNavigationType)navigationType { + if ([_permission isEqualToString:@"offline_access"]) { + NSURL* url = request.URL; + if ([url.scheme isEqualToString:@"fbconnect"]) { + if ([url.resourceSpecifier isEqualToString:@"success"]) { + [self redirectToLogin]; + return NO; + } + } + } + return [super webView:webView shouldStartLoadWithRequest:request navigationType:navigationType]; +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBRequest.h b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBRequest.h new file mode 100644 index 00000000..75ac9e74 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBRequest.h @@ -0,0 +1,167 @@ +/* + * Copyright 2009 Facebook + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#import "FBConnectGlobal.h" + +@protocol FBRequestDelegate; +@class FBSession; + +@interface FBRequest : NSObject { + FBSession* _session; + id _delegate; + NSString* _url; + NSString* _method; + id _userInfo; + NSMutableDictionary* _params; + NSObject* _dataParam; + NSDate* _timestamp; + NSURLConnection* _connection; + NSMutableData* _responseText; +} + +/** + * Creates a new API request for the global session. + */ ++ (FBRequest*)request; + +/** + * Creates a new API request for the global session with a delegate. + */ ++ (FBRequest*)requestWithDelegate:(id)delegate; + +/** + * Creates a new API request for a particular session. + */ ++ (FBRequest*)requestWithSession:(FBSession*)session; + +/** + * Creates a new API request for the global session with a delegate. + */ ++ (FBRequest*)requestWithSession:(FBSession*)session delegate:(id)delegate; + +@property(nonatomic,assign) id delegate; + +/** + * The URL which will be contacted to execute the request. + */ +@property(nonatomic,readonly) NSString* url; + +/** + * The API method which will be called. + */ +@property(nonatomic,readonly) NSString* method; + +/** + * An object used by the user of the request to help identify the meaning of the request. + */ +@property(nonatomic,retain) id userInfo; + +/** + * The dictionary of parameters to pass to the method. + * + * These values in the dictionary will be converted to strings using the + * standard Objective-C object-to-string conversion facilities. + */ +@property(nonatomic,readonly) NSDictionary* params; + +/** + * A data parameter. + * + * Used for methods such as photos.upload, video.upload, events.create, and + * events.edit. + */ +@property(nonatomic,readonly) NSObject* dataParam; + +/** + * The timestamp of when the request was sent to the server. + */ +@property(nonatomic,readonly) NSDate* timestamp; + +/** + * Indicates if the request has been sent and is awaiting a response. + */ +@property(nonatomic,readonly) BOOL loading; + +/** + * Creates a new request paired to a session. + */ +- (id)initWithSession:(FBSession*)session; + +/** + * Calls a method on the server asynchronously. + * + * The delegate will be called for each stage of the loading process. + */ +- (void)call:(NSString*)method params:(NSDictionary*)params; + +/** + * Calls a method on the server asynchronously, with a file upload component. + * + * The delegate will be called for each stage of the loading process. + */ +- (void)call:(NSString*)method params:(NSDictionary*)params dataParam:(NSData*)dataParam; + +/** + * Calls a URL on the server asynchronously. + * + * The delegate will be called for each stage of the loading process. + */ +- (void)post:(NSString*)url params:(NSDictionary*)params; + +/** + * Stops an active request before the response has returned. + */ +- (void)cancel; + +- (void)connect; + +@end + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +@protocol FBRequestDelegate + +@optional + +/** + * Called just before the request is sent to the server. + */ +- (void)requestLoading:(FBRequest*)request; + +/** + * Called when the server responds and begins to send back data. + */ +- (void)request:(FBRequest*)request didReceiveResponse:(NSURLResponse*)response; + +/** + * Called when an error prevents the request from completing successfully. + */ +- (void)request:(FBRequest*)request didFailWithError:(NSError*)error; + +/** + * Called when a request returns and its response has been parsed into an object. + * + * The resulting object may be a dictionary, an array, a string, or a number, depending + * on thee format of the API response. + */ +- (void)request:(FBRequest*)request didLoad:(id)result; + +/** + * Called when the request was cancelled. + */ +- (void)requestWasCancelled:(FBRequest*)request; + +@end diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBRequest.m b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBRequest.m new file mode 100644 index 00000000..50dd54e5 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBRequest.m @@ -0,0 +1,378 @@ +/* + * Copyright 2009 Facebook + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#import "FBRequest.h" +#import "FBSession.h" +#import "FBXMLHandler.h" +#import + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// global + +static NSString* kAPIVersion = @"1.0"; +static NSString* kAPIFormat = @"XML"; +static NSString* kUserAgent = @"FacebookConnect"; +static NSString* kStringBoundary = @"3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f"; + +static const NSTimeInterval kTimeoutInterval = 180.0; + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +@implementation FBRequest + +@synthesize delegate = _delegate, + url = _url, + method = _method, + params = _params, + dataParam = _dataParam, + userInfo = _userInfo, + timestamp = _timestamp; + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// class public + ++ (FBRequest*)request { + return [self requestWithSession:[FBSession session]]; +} + ++ (FBRequest*)requestWithDelegate:(id)delegate { + return [self requestWithSession:[FBSession session] delegate:delegate]; +} + ++ (FBRequest*)requestWithSession:(FBSession*)session { + return [[[FBRequest alloc] initWithSession:session] autorelease]; +} + ++ (FBRequest*)requestWithSession:(FBSession*)session delegate:(id)delegate { + FBRequest* request = [[[FBRequest alloc] initWithSession:session] autorelease]; + request.delegate = delegate; + return request; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// private + +- (NSString*)md5HexDigest:(NSString*)input { + const char* str = [input UTF8String]; + unsigned char result[CC_MD5_DIGEST_LENGTH]; + CC_MD5(str, strlen(str), result); + + NSMutableString *ret = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH*2]; + for(int i = 0; i", _method ? _method : _url]; +} + +////////////////////////////////////////////////////////////////////////////////////////////////// +// NSURLConnectionDelegate + +- (void)connection:(NSURLConnection*)connection didReceiveResponse:(NSURLResponse*)response { + _responseText = [[NSMutableData alloc] init]; + + NSHTTPURLResponse* httpResponse = (NSHTTPURLResponse*)response; + if ([_delegate respondsToSelector:@selector(request:didReceiveResponse:)]) { + [_delegate request:self didReceiveResponse:httpResponse]; + } +} + +-(void)connection:(NSURLConnection*)connection didReceiveData:(NSData*)data { + [_responseText appendData:data]; +} + +- (NSCachedURLResponse*)connection:(NSURLConnection*)connection + willCacheResponse:(NSCachedURLResponse*)cachedResponse { + return nil; +} + +-(void)connectionDidFinishLoading:(NSURLConnection*)connection { + [self handleResponseData:_responseText]; + + [_responseText release]; + _responseText = nil; + [_connection release]; + _connection = nil; +} + +- (void)connection:(NSURLConnection*)connection didFailWithError:(NSError*)error { + [self failWithError:error]; + + [_responseText release]; + _responseText = nil; + [_connection release]; + _connection = nil; +} + +////////////////////////////////////////////////////////////////////////////////////////////////// +// public + +- (BOOL)loading { + return !!_connection; +} + +- (void)call:(NSString*)method params:(NSDictionary*)params { + [self call:method params:params dataParam:nil]; +} + +- (void)call:(NSString*)method params:(NSDictionary*)params dataParam:(NSData*)dataParam { + _url = [[self urlForMethod:method] retain]; + _method = [method copy]; + _params = params + ? [[NSMutableDictionary alloc] initWithDictionary:params] + : [[NSMutableDictionary alloc] init]; + _dataParam = dataParam; + + [_params setObject:_method forKey:@"method"]; + [_params setObject:_session.apiKey forKey:@"api_key"]; + [_params setObject:kAPIVersion forKey:@"v"]; + [_params setObject:kAPIFormat forKey:@"format"]; + + if (![self isSpecialMethod]) { + [_params setObject:_session.sessionKey forKey:@"session_key"]; + [_params setObject:[self generateCallId] forKey:@"call_id"]; + + if (_session.sessionSecret) { + [_params setObject:@"1" forKey:@"ss"]; + } + } + + [_params setObject:[self generateSig] forKey:@"sig"]; + + [_session send:self]; +} + +- (void)post:(NSString*)url params:(NSDictionary*)params { + _url = [url retain]; + _params = params + ? [[NSMutableDictionary alloc] initWithDictionary:params] + : [[NSMutableDictionary alloc] init]; + + [_session send:self]; +} + +- (void)cancel { + if (_connection) { + [_connection cancel]; + [_connection release]; + _connection = nil; + + if ([_delegate respondsToSelector:@selector(requestWasCancelled:)]) { + [_delegate requestWasCancelled:self]; + } + } +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBSession.h b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBSession.h new file mode 100644 index 00000000..15c77f50 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBSession.h @@ -0,0 +1,205 @@ +/* + * Copyright 2009 Facebook + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#import "FBConnectGlobal.h" + +@protocol FBSessionDelegate; +@class FBRequest; + +/** + * An FBSession represents a single user's authenticated session for a Facebook application. + * + * To create a session, you must use the session key of your application (which can + * be found on the Facebook developer website). You may then use the login dialog to ask + * the user to enter their email address and password. If successful, you will get back a + * session key which can be used to make requests to the Facebook API. + * + * Session keys are cached and stored on the disk of the device so that you do not need to ask + * the user to login every time they launch the app. To restore the last active session, call the + * resume method after instantiating your session. + */ +@interface FBSession : NSObject { + NSMutableArray* _delegates; + NSString* _apiKey; + NSString* _apiSecret; + NSString* _getSessionProxy; + FBUID _uid; + NSString* _sessionKey; + NSString* _sessionSecret; + NSDate* _expirationDate; + NSMutableArray* _requestQueue; + NSDate* _lastRequestTime; + int _requestBurstCount; + NSTimer* _requestTimer; +} + +/** + * Delegates which implement FBSessionDelegate. + */ +@property(nonatomic,readonly) NSMutableArray* delegates; + +/** + * The URL used for API HTTP requests. + */ +@property(nonatomic,readonly) NSString* apiURL; + +/** + * The URL used for secure API HTTP requests. + */ +@property(nonatomic,readonly) NSString* apiSecureURL; + +/** + * Your application's API key, as passed to the constructor. + */ +@property(nonatomic,readonly) NSString* apiKey; + +/** + * Your application's API secret, as passed to the constructor. + */ +@property(nonatomic,readonly) NSString* apiSecret; + +/** + * The URL to call to create a session key after login. + * + * This is an alternative to calling auth.getSession directly using the secret key. + */ +@property(nonatomic,readonly) NSString* getSessionProxy; + +/** + * The current user's Facebook id. + */ +@property(nonatomic,readonly) FBUID uid; + +/** + * The current user's session key. + */ +@property(nonatomic,readonly) NSString* sessionKey; + +/** + * The current user's session secret. + */ +@property(nonatomic,readonly) NSString* sessionSecret; + +/** + * The expiration date of the session key. + */ +@property(nonatomic,readonly) NSDate* expirationDate; + +/** + * Determines if the session is active and connected to a user. + */ +@property(nonatomic,readonly) BOOL isConnected; + +/** + * The globally shared session instance. + */ ++ (FBSession*)session; + +/** + * Sets the globally shared session instance. + * + * This session is not retained, so you are still responsible for retaining it yourself. The + * first session that is created is automatically stored here. + */ ++ (void)setSession:(FBSession*)session; + +/** + * Constructs a session and stores it as the globally shared session instance. + * + * @param secret the application secret (optional) + */ ++ (FBSession*)sessionForApplication:(NSString*)key secret:(NSString*)secret + delegate:(id)delegate; + +/** + * Constructs a session and stores it as the global singleton. + * + * @param getSessionProxy a url to that proxies auth.getSession (optional) + */ ++ (FBSession*)sessionForApplication:(NSString*)key getSessionProxy:(NSString*)getSessionProxy + delegate:(id)delegate; + +/** + * Constructs a session for an application. + * + * @param secret the application secret (optional) + * @param getSessionProxy a url to that proxies auth.getSession (optional) + */ +- (FBSession*)initWithKey:(NSString*)key secret:(NSString*)secret + getSessionProxy:(NSString*)getSessionProxy; + +/** + * Begins a session for a user with a given key and secret. + */ +- (void)begin:(FBUID)uid sessionKey:(NSString*)sessionKey sessionSecret:(NSString*)sessionSecret + expires:(NSDate*)expires; + +/** + * Resumes a previous session whose uid, session key, and secret are cached on disk. + */ +- (BOOL)resume; + +/** + * Cancels a login (no-op if the login is already complete). + */ +- (void)cancelLogin; + +/** + * Ends the current session and deletes the uid, session key, and secret from disk. + */ +- (void)logout; + +/** + * Sends a fully configured request to the server for execution. + */ +- (void)send:(FBRequest*)request; + +/** + * Deletes all cookies belonging to facebook + */ +- (void)deleteFacebookCookies; + +- (void)requestTimerReady; + +@end + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +@protocol FBSessionDelegate + +/** + * Called when a user has successfully logged in and begun a session. + */ +- (void)session:(FBSession*)session didLogin:(FBUID)uid; + +@optional + +/** + * Called when a user closes the login dialog without logging in. + */ +- (void)sessionDidNotLogin:(FBSession*)session; + +/** + * Called when a session is about to log out. + */ +- (void)session:(FBSession*)session willLogout:(FBUID)uid; + +/** + * Called when a session has logged out. + */ +- (void)sessionDidLogout:(FBSession*)session; + +@end diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBSession.m b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBSession.m new file mode 100644 index 00000000..c21f11bb --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBSession.m @@ -0,0 +1,301 @@ +/* + * Copyright 2009 Facebook + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#import "FBSession.h" +#import "FBRequest.h" + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// global + +static NSString* kAPIRestURL = @"http://api.facebook.com/restserver.php"; +static NSString* kAPIRestSecureURL = @"https://api.facebook.com/restserver.php"; + +static const int kMaxBurstRequests = 3; +static const NSTimeInterval kBurstDuration = 2; + +static FBSession* sharedSession = nil; + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +@implementation FBSession + +@synthesize delegates = _delegates, apiKey = _apiKey, apiSecret = _apiSecret, + getSessionProxy = _getSessionProxy, uid = _uid, sessionKey = _sessionKey, + sessionSecret = _sessionSecret, expirationDate = _expirationDate; + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// class public + ++ (FBSession*)session { + return sharedSession; +} + ++ (void)setSession:(FBSession*)session { + sharedSession = session; +} + ++ (FBSession*)sessionForApplication:(NSString*)key secret:(NSString*)secret + delegate:(id)delegate { + FBSession* session = [[[FBSession alloc] initWithKey:key secret:secret + getSessionProxy:nil] autorelease]; + [session.delegates addObject:delegate]; + return session; +} + ++ (FBSession*)sessionForApplication:(NSString*)key getSessionProxy:(NSString*)getSessionProxy + delegate:(id)delegate { + FBSession* session = [[[FBSession alloc] initWithKey:key secret:nil + getSessionProxy:getSessionProxy] autorelease]; + [session.delegates addObject:delegate]; + return session; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// private + +- (void)save { + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + if (_uid) { + [defaults setObject:[NSNumber numberWithLongLong:_uid] forKey:@"FBUserId"]; + } else { + [defaults removeObjectForKey:@"FBUserId"]; + } + + if (_sessionKey) { + [defaults setObject:_sessionKey forKey:@"FBSessionKey"]; + } else { + [defaults removeObjectForKey:@"FBSessionKey"]; + } + + if (_sessionSecret) { + [defaults setObject:_sessionSecret forKey:@"FBSessionSecret"]; + } else { + [defaults removeObjectForKey:@"FBSessionSecret"]; + } + + if (_expirationDate) { + [defaults setObject:_expirationDate forKey:@"FBSessionExpires"]; + } else { + [defaults removeObjectForKey:@"FBSessionExpires"]; + } + + [defaults synchronize]; +} + +- (void)unsave { + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + [defaults removeObjectForKey:@"FBUserId"]; + [defaults removeObjectForKey:@"FBSessionKey"]; + [defaults removeObjectForKey:@"FBSessionSecret"]; + [defaults removeObjectForKey:@"FBSessionExpires"]; + [defaults synchronize]; +} + +- (void)startFlushTimer { + if (!_requestTimer) { + NSTimeInterval t = kBurstDuration + [_lastRequestTime timeIntervalSinceNow]; + _requestTimer = [NSTimer scheduledTimerWithTimeInterval:t target:self + selector:@selector(requestTimerReady) userInfo:nil repeats:NO]; + } +} + +- (void)enqueueRequest:(FBRequest*)request { + [_requestQueue addObject:request]; + [self startFlushTimer]; +} + +- (BOOL)performRequest:(FBRequest*)request enqueue:(BOOL)enqueue { + // Stagger requests that happen in short bursts to prevent the server from rejecting + // them for making too many requests in a short time + NSTimeInterval t = [_lastRequestTime timeIntervalSinceNow]; + BOOL burst = t && t > -kBurstDuration; + if (burst && ++_requestBurstCount > kMaxBurstRequests) { + if (enqueue) { + [self enqueueRequest:request]; + } + return NO; + } else { + [request performSelector:@selector(connect)]; + + if (!burst) { + _requestBurstCount = 1; + [_lastRequestTime release]; + _lastRequestTime = [[request timestamp] retain]; + } + } + return YES; +} + +- (void)flushRequestQueue { + while (_requestQueue.count) { + FBRequest* request = [_requestQueue objectAtIndex:0]; + if ([self performRequest:request enqueue:NO]) { + [_requestQueue removeObjectAtIndex:0]; + } else { + [self startFlushTimer]; + break; + } + } +} + +- (void)requestTimerReady { + _requestTimer = nil; + [self flushRequestQueue]; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// NSObject + +- (FBSession*)initWithKey:(NSString*)key secret:(NSString*)secret + getSessionProxy:(NSString*)getSessionProxy { + if (self = [super init]) { + if (!sharedSession) { + sharedSession = self; + } + + _delegates = FBCreateNonRetainingArray(); + _apiKey = [key copy]; + _apiSecret = [secret copy]; + _getSessionProxy = [getSessionProxy copy]; + _uid = 0; + _sessionKey = nil; + _sessionSecret = nil; + _expirationDate = nil; + _requestQueue = [[NSMutableArray alloc] init]; + _lastRequestTime = nil; + _requestBurstCount = 0; + _requestTimer = nil; + } + return self; +} + +- (void)dealloc { + if (sharedSession == self) { + sharedSession = nil; + } + + [_delegates release]; + [_requestQueue release]; + [_apiKey release]; + [_apiSecret release]; + [_getSessionProxy release]; + [_sessionKey release]; + [_sessionSecret release]; + [_expirationDate release]; + [_lastRequestTime release]; + [super dealloc]; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// public + +- (NSString*)apiURL { + return kAPIRestURL; +} + +- (NSString*)apiSecureURL { + return kAPIRestSecureURL; +} + +- (BOOL)isConnected { + return !!_sessionKey; +} + +- (void)begin:(FBUID)uid sessionKey:(NSString*)sessionKey + sessionSecret:(NSString*)sessionSecret expires:(NSDate*)expires { + _uid = uid; + _sessionKey = [sessionKey copy]; + _sessionSecret = [sessionSecret copy]; + _expirationDate = [expires retain]; + + [self save]; +} + +- (BOOL)resume { + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + FBUID uid = [[defaults objectForKey:@"FBUserId"] longLongValue]; + if (uid) { + NSDate* expirationDate = [defaults objectForKey:@"FBSessionExpires"]; + if (!expirationDate || [expirationDate timeIntervalSinceNow] > 0) { + _uid = uid; + _sessionKey = [[defaults stringForKey:@"FBSessionKey"] copy]; + _sessionSecret = [[defaults stringForKey:@"FBSessionSecret"] copy]; + _expirationDate = [expirationDate retain]; + + for (id delegate in _delegates) { + [delegate session:self didLogin:_uid]; + } + return YES; + } + } + return NO; +} + +- (void)cancelLogin { + if (![self isConnected]) { + for (id delegate in _delegates) { + if ([delegate respondsToSelector:@selector(sessionDidNotLogin:)]) { + [delegate sessionDidNotLogin:self]; + } + } + } +} + +- (void)logout { + if (_sessionKey) { + for (id delegate in _delegates) { + if ([delegate respondsToSelector:@selector(session:willLogout:)]) { + [delegate session:self willLogout:_uid]; + } + } + + [self deleteFacebookCookies]; + + + _uid = 0; + [_sessionKey release]; + _sessionKey = nil; + [_sessionSecret release]; + _sessionSecret = nil; + [_expirationDate release]; + _expirationDate = nil; + [self unsave]; + + for (id delegate in _delegates) { + if ([delegate respondsToSelector:@selector(sessionDidLogout:)]) { + [delegate sessionDidLogout:self]; + } + } + } else { + [self deleteFacebookCookies]; + [self unsave]; + } +} + +- (void)send:(FBRequest*)request { + [self performRequest:request enqueue:YES]; +} + +- (void)deleteFacebookCookies { + NSHTTPCookieStorage* cookies = [NSHTTPCookieStorage sharedHTTPCookieStorage]; + NSArray* facebookCookies = [cookies cookiesForURL: + [NSURL URLWithString:@"http://login.facebook.com"]]; + for (NSHTTPCookie* cookie in facebookCookies) { + [cookies deleteCookie:cookie]; + } +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBStreamDialog.h b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBStreamDialog.h new file mode 100755 index 00000000..b926a01e --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBStreamDialog.h @@ -0,0 +1,62 @@ +/* + * Copyright 2009 Facebook + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FBDialog.h" + +@interface FBStreamDialog : FBDialog { + NSString* _attachment; + NSString* _actionLinks; + NSString* _targetId; + NSString* _userMessagePrompt; +} + +/** + * A JSON-encoded object containing the text of the post, relevant links, a + * media type (image, video, mp3, flash), as well as any other key/value pairs + * you may want to add. + * + * Note: If you want to use this call to update a user's status, don't pass an + * attachment; the content of the userMessage parameter will become the user's + * new status and will appear at the top of the user's profile. + * + * For more info, see http://wiki.developers.facebook.com/index.php/Attachment_(Streams) + */ +@property(nonatomic,copy) NSString* attachment; + +/** + * A JSON-encoded array of action link objects, containing the link text and a + * hyperlink. + */ +@property(nonatomic,copy) NSString* actionLinks; + +/** + * The ID of the user or the Page where you are publishing the content. If this + * is specified, the post appears on the Wall of the target user, not on the + * Wall of the user who published the post. This mimics the action of posting + * on a friend's Wall on Facebook itself. + * + * Note: To post on the user's own wall, leave this blank. + */ +@property(nonatomic,copy) NSString* targetId; + +/** + * Text you provide the user as a prompt to specify a userMessage. This appears + * above the box where the user enters a custom message. + * For example, "What's on your mind?" + */ +@property(nonatomic,copy) NSString* userMessagePrompt; + +@end diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBStreamDialog.m b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBStreamDialog.m new file mode 100755 index 00000000..99fdf142 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBStreamDialog.m @@ -0,0 +1,77 @@ +/* + * Copyright 2009 Facebook + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import "FBStreamDialog.h" +#import "FBSession.h" + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// global + +static NSString* kStreamURL = @"http://www.facebook.com/connect/prompt_feed.php"; + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +@implementation FBStreamDialog + +@synthesize attachment = _attachment, + actionLinks = _actionLinks, + targetId = _targetId, + userMessagePrompt = _userMessagePrompt; + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// NSObject + +- (id)initWithSession:(FBSession*)session { + if (self = [super initWithSession:session]) { + _attachment = @""; + _actionLinks = @""; + _targetId = @""; + _userMessagePrompt = @""; + } + return self; +} + +- (void)dealloc { + [_attachment release]; + [_actionLinks release]; + [_targetId release]; + [_userMessagePrompt release]; + [super dealloc]; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// FBDialog + +- (void)load { + NSDictionary* getParams = [NSDictionary dictionaryWithObjectsAndKeys: + @"touch", @"display", nil]; + + NSDictionary* postParams = [NSDictionary dictionaryWithObjectsAndKeys: + _session.apiKey, @"api_key", + _session.sessionKey, @"session_key", + @"1", @"preview", + @"fbconnect:success", @"callback", + @"fbconnect:cancel", @"cancel", + _attachment, @"attachment", + _actionLinks, @"action_links", + _targetId, @"target_id", + _userMessagePrompt, @"user_message_prompt", + nil]; + + [self loadURL:kStreamURL method:@"POST" get:getParams post:postParams]; +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBXMLHandler.h b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBXMLHandler.h new file mode 100644 index 00000000..a60ef6ad --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBXMLHandler.h @@ -0,0 +1,32 @@ +/* + * Copyright 2009 Facebook + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#import "FBConnectGlobal.h" + +@interface FBXMLHandler : NSObject { + NSMutableArray* _stack; + NSMutableArray* _nameStack; + id _rootObject; + NSString* _rootName; + NSMutableString* _chars; + NSError* _parseError; +} + +@property(nonatomic,readonly) id rootObject; +@property(nonatomic,readonly) NSString* rootName; +@property(nonatomic,readonly) NSError* parseError; + +@end diff --git a/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBXMLHandler.m b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBXMLHandler.m new file mode 100644 index 00000000..54de261f --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/FBConnect/FBXMLHandler.m @@ -0,0 +1,152 @@ +/* + * Copyright 2009 Facebook + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#import "FBXMLHandler.h" + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +@implementation FBXMLHandler + +@synthesize rootObject = _rootObject, rootName = _rootName, parseError = _parseError; + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// private + +- (NSString*)topName { + return [_nameStack lastObject]; +} + +- (id)topObject:(BOOL)create { + id object = [_stack objectAtIndex:_stack.count-1]; + if (object == [NSNull null] && create) { + object = [NSMutableDictionary dictionary]; + [_stack replaceObjectAtIndex:_stack.count-1 withObject:object]; + } + return object; +} + +- (id)topContainer { + if (_stack.count < 2) { + return nil; + } else { + id object = [_stack objectAtIndex:_stack.count-2]; + if (object == [NSNull null]) { + object = [NSMutableDictionary dictionary]; + [_stack replaceObjectAtIndex:_stack.count-2 withObject:object]; + } + return object; + } +} + +- (void)flushCharacters { + NSCharacterSet* whitespace = [NSCharacterSet whitespaceAndNewlineCharacterSet]; + for (NSInteger i = 0; i < _chars.length; ++i) { + unichar c = [_chars characterAtIndex:i]; + if (![whitespace characterIsMember:c]) { + id topContainer = self.topContainer; + if ([topContainer isKindOfClass:[NSMutableArray class]]) { + id object = [NSDictionary dictionaryWithObject:_chars forKey:self.topName]; + [_stack replaceObjectAtIndex:_stack.count-1 withObject:object]; + } else { + [_stack replaceObjectAtIndex:_stack.count-1 withObject:_chars]; + } + break; + } + } + + [_chars release]; + _chars = nil; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// NSObject + +- (id)init { + if (self = [super init]) { + _stack = [[NSMutableArray alloc] init]; + _nameStack = [[NSMutableArray alloc] init]; + _rootObject = nil; + _rootName = nil; + _chars = nil; + _parseError = nil; + } + return self; +} + +- (void)dealloc { + [_stack release]; + [_nameStack release]; + [_rootObject release]; + [_rootName release]; + [_chars release]; + [_parseError release]; + [super dealloc]; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// NSXMLParserDelegate + +- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName + namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName + attributes:(NSDictionary *)attributeDict { + [self flushCharacters]; + + id object = nil; + if ([[attributeDict objectForKey:@"list"] isEqualToString:@"true"]) { + object = [NSMutableArray array]; + } else { + object = [NSNull null]; + } + + [_stack addObject:object]; + [_nameStack addObject:elementName]; +} + +- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string { + if (!_chars) { + _chars = [string mutableCopy]; + } else { + [_chars appendString:string]; + } +} + +- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName + namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName { + [self flushCharacters]; + + id object = [[[self topObject:NO] retain] autorelease]; + NSString* name = [[self.topName retain] autorelease]; + [_stack removeLastObject]; + [_nameStack removeLastObject]; + + if (!_stack.count) { + _rootObject = [object retain]; + _rootName = [name retain]; + } else { + id topObject = [self topObject:YES]; + if ([topObject isKindOfClass:[NSMutableArray class]]) { + [topObject addObject:object]; + } else if ([topObject isKindOfClass:[NSMutableDictionary class]]) { + [topObject setObject:object forKey:name]; + } + } +} + +- (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)error { + _parseError = [error retain]; +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Facebook/SHKFBStreamDialog.h b/Classes/ShareKit/Sharers/Services/Facebook/SHKFBStreamDialog.h new file mode 100644 index 00000000..a5190a03 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/SHKFBStreamDialog.h @@ -0,0 +1,19 @@ +// +// SHKFBStreamDialog.h +// Adds a little bit extra control to FBStreamDialog +// +// Created by Nathan Weiner on 7/26/10. +// Copyright 2010 Idea Shower, LLC. All rights reserved. +// + +#import +#import "FBStreamDialog.h" + +@interface SHKFBStreamDialog : FBStreamDialog +{ + NSString *defaultStatus; +} + +@property (nonatomic, retain) NSString *defaultStatus; + +@end diff --git a/Classes/ShareKit/Sharers/Services/Facebook/SHKFBStreamDialog.m b/Classes/ShareKit/Sharers/Services/Facebook/SHKFBStreamDialog.m new file mode 100644 index 00000000..53ec2152 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/SHKFBStreamDialog.m @@ -0,0 +1,40 @@ +// +// SHKFBStreamDialog.m +// RIL +// +// Created by Nathan Weiner on 7/26/10. +// Copyright 2010 Idea Shower, LLC. All rights reserved. +// + +#import "SHKFBStreamDialog.h" +#import "SHK.h" + +@implementation SHKFBStreamDialog + +@synthesize defaultStatus; + +- (void)dealloc +{ + [defaultStatus release]; + [super dealloc]; +} + +- (void)webViewDidFinishLoad:(UIWebView *)webView +{ + [super webViewDidFinishLoad:webView]; + + if (defaultStatus) + { + // Set the pre-filled status message + [_webView stringByEvaluatingJavaScriptFromString: + [NSString stringWithFormat:@"document.getElementsByName('feedform_user_message')[0].value = decodeURIComponent('%@')", + [SHKEncode(defaultStatus) stringByReplacingOccurrencesOfString:@"'" withString:@"\\'"] + ] + ]; + + // Make the text field bigger + [_webView stringByEvaluatingJavaScriptFromString:@"document.getElementsByName('feedform_user_message')[0].style.height='100px'"]; + } +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Facebook/SHKFacebook.h b/Classes/ShareKit/Sharers/Services/Facebook/SHKFacebook.h new file mode 100644 index 00000000..ab0ee137 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/SHKFacebook.h @@ -0,0 +1,52 @@ +// +// SHKFacebook.h +// ShareKit +// +// Created by Nathan Weiner on 6/18/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import +#import "SHKSharer.h" +#import "FBConnect.h" + +typedef enum +{ + SHKFacebookPendingNone, + SHKFacebookPendingLogin, + SHKFacebookPendingStatus, + SHKFacebookPendingImage +} SHKFacebookPendingAction; + + +@interface SHKFacebook : SHKSharer +{ + FBSession *session; + SHKFacebookPendingAction pendingFacebookAction; + FBLoginDialog *login; +} + +@property (retain) FBSession *session; +@property SHKFacebookPendingAction pendingFacebookAction; +@property (retain) FBLoginDialog *login; + +@end diff --git a/Classes/ShareKit/Sharers/Services/Facebook/SHKFacebook.m b/Classes/ShareKit/Sharers/Services/Facebook/SHKFacebook.m new file mode 100644 index 00000000..4c42f835 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Facebook/SHKFacebook.m @@ -0,0 +1,304 @@ +// +// SHKFacebook.m +// ShareKit +// +// Created by Nathan Weiner on 6/18/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKFacebook.h" +#import "SHKFBStreamDialog.h" + +@implementation SHKFacebook + +@synthesize session; +@synthesize pendingFacebookAction; +@synthesize login; + +- (void)dealloc +{ + [session.delegates removeObject:self]; + [session release]; + [login release]; + [super dealloc]; +} + + +#pragma mark - +#pragma mark Configuration : Service Defination + ++ (NSString *)sharerTitle +{ + return @"Facebook"; +} + ++ (BOOL)canShareURL +{ + return YES; +} + ++ (BOOL)canShareText +{ + return YES; +} + ++ (BOOL)canShareImage +{ + return YES; +} + ++ (BOOL)canShareOffline +{ + return NO; // TODO - would love to make this work +} + +#pragma mark - +#pragma mark Configuration : Dynamic Enable + +- (BOOL)shouldAutoShare +{ + return YES; // FBConnect presents its own dialog +} + +#pragma mark - +#pragma mark Authentication + +- (BOOL)isAuthorized +{ + if (session == nil) + { + + if(!SHKFacebookUseSessionProxy){ + self.session = [FBSession sessionForApplication:SHKFacebookKey + secret:SHKFacebookSecret + delegate:self]; + + }else { + self.session = [FBSession sessionForApplication:SHKFacebookKey + getSessionProxy:SHKFacebookSessionProxyURL + delegate:self]; + } + + + return [session resume]; + } + + return [session isConnected]; +} + +- (void)promptAuthorization +{ + self.pendingFacebookAction = SHKFacebookPendingLogin; + self.login = [[[FBLoginDialog alloc] initWithSession:[self session]] autorelease]; + [login show]; +} + +- (void)authFinished:(SHKRequest *)request +{ + +} + ++ (void)logout +{ + FBSession *fbSession; + + if(!SHKFacebookUseSessionProxy){ + fbSession = [FBSession sessionForApplication:SHKFacebookKey + secret:SHKFacebookSecret + delegate:self]; + + }else { + fbSession = [FBSession sessionForApplication:SHKFacebookKey + getSessionProxy:SHKFacebookSessionProxyURL + delegate:self]; + } + + [fbSession logout]; +} + +#pragma mark - +#pragma mark Share API Methods + +- (BOOL)send +{ + if (item.shareType == SHKShareTypeURL) + { + self.pendingFacebookAction = SHKFacebookPendingStatus; + + SHKFBStreamDialog* dialog = [[[SHKFBStreamDialog alloc] init] autorelease]; + dialog.delegate = self; + dialog.userMessagePrompt = SHKLocalizedString(@"Enter your message:"); + + NSMutableString *additionnalData = [NSMutableString string]; + if ([item customValueForKey:@"caption"]) + { + [additionnalData appendFormat:@"\"caption\":\"%@\",", SHKEncode([item customValueForKey:@"caption"])]; + } + if ([item customValueForKey:@"description"]) + { + NSString *description = [[item customValueForKey:@"description"] stringByReplacingOccurrencesOfString:@"\n" withString:@"\\n"]; + [additionnalData appendFormat:@"\"description\":\"%@\",", SHKEncode(description)]; + } + + // Auto-detect Dailymotion links and generate an attached embed player + if ([item.URL.host hasSuffix:@"dailymotion.com"]) + { + BOOL idIsNextComponent = NO; + NSString *videoId = nil; + for (NSString *component in [item.URL.path componentsSeparatedByString:@"/"]) + { + if (idIsNextComponent) + { + videoId = component; + break; + } + else if ([component isEqualToString:@"video"]) + { + idIsNextComponent = YES; + } + } + + if (videoId) + { + [additionnalData appendFormat: + @"\"media\":[{" + "\"type\":\"flash\"," + "\"imgsrc\":\"http://www.dailymotion.com/thumbnail/160x120/video/%@\"," + "\"swfsrc\":\"http://www.dailymotion.com/swf/%@?autoPlay=1\"" + "}],", videoId, videoId]; + } + } + + dialog.attachment = [NSString stringWithFormat: + @"{%@\ + \"name\":\"%@\",\ + \"href\":\"%@\"\ + }", + additionnalData, + item.title == nil ? SHKEncodeURL(item.URL) : SHKEncode(item.title), + SHKEncodeURL(item.URL) + ]; + dialog.defaultStatus = item.text; + dialog.actionLinks = [NSString stringWithFormat:@"[{\"text\":\"Get %@\",\"href\":\"%@\"}]", + SHKEncode(SHKMyAppName), + SHKEncode(SHKMyAppURL)]; + [dialog show]; + + } + + else if (item.shareType == SHKShareTypeText) + { + self.pendingFacebookAction = SHKFacebookPendingStatus; + + SHKFBStreamDialog* dialog = [[[SHKFBStreamDialog alloc] init] autorelease]; + dialog.delegate = self; + dialog.userMessagePrompt = SHKLocalizedString(@"Enter your message:"); + dialog.defaultStatus = item.text; + dialog.actionLinks = [NSString stringWithFormat:@"[{\"text\":\"Get %@\",\"href\":\"%@\"}]", + SHKEncode(SHKMyAppName), + SHKEncode(SHKMyAppURL)]; + [dialog show]; + + } + + else if (item.shareType == SHKShareTypeImage) + { + self.pendingFacebookAction = SHKFacebookPendingImage; + + FBPermissionDialog* dialog = [[[FBPermissionDialog alloc] init] autorelease]; + dialog.delegate = self; + dialog.permission = @"photo_upload"; + [dialog show]; + } + + return YES; +} + +- (void)sendImage +{ + [self sendDidStart]; + + [[FBRequest requestWithDelegate:self] call:@"facebook.photos.upload" + params:[NSDictionary dictionaryWithObjectsAndKeys:item.title, @"caption", nil] + dataParam:UIImageJPEGRepresentation(item.image,1.0)]; +} + +- (void)dialogDidSucceed:(FBDialog*)dialog +{ + if (pendingFacebookAction == SHKFacebookPendingImage) + [self sendImage]; + + // TODO - the dialog has a SKIP button. Skipping still calls this even though it doesn't appear to post. + // - need to intercept the skip and handle it as a cancel? + else if (pendingFacebookAction == SHKFacebookPendingStatus) + [self sendDidFinish]; +} + +- (void)dialogDidCancel:(FBDialog*)dialog +{ + if (pendingFacebookAction == SHKFacebookPendingStatus) + [self sendDidCancel]; +} + +- (BOOL)dialog:(FBDialog*)dialog shouldOpenURLInExternalBrowser:(NSURL*)url +{ + return YES; +} + + +#pragma mark FBSessionDelegate methods + +- (void)session:(FBSession*)session didLogin:(FBUID)uid +{ + // Try to share again + if (pendingFacebookAction == SHKFacebookPendingLogin) + { + self.pendingFacebookAction = SHKFacebookPendingNone; + [self share]; + } +} + +- (void)session:(FBSession*)session willLogout:(FBUID)uid +{ + // Not handling this +} + + +#pragma mark FBRequestDelegate methods + +- (void)request:(FBRequest*)aRequest didLoad:(id)result +{ + if ([aRequest.method isEqualToString:@"facebook.photos.upload"]) + { + // PID is in [result objectForKey:@"pid"]; + [self sendDidFinish]; + } +} + +- (void)request:(FBRequest*)aRequest didFailWithError:(NSError*)error +{ + [self sendDidFailWithError:error]; +} + + + +@end diff --git a/Classes/ShareKit/Sharers/Services/Google Reader/SHKGoogleReader.h b/Classes/ShareKit/Sharers/Services/Google Reader/SHKGoogleReader.h new file mode 100644 index 00000000..9ac34068 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Google Reader/SHKGoogleReader.h @@ -0,0 +1,44 @@ +// +// SHKGoogleReader.h +// ShareKit +// +// Created by Nathan Weiner on 6/20/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import +#import "SHKSharer.h" + +@interface SHKGoogleReader : SHKSharer +{ + NSMutableDictionary *session; + BOOL sendAfterLogin; +} + +@property (nonatomic, retain) NSMutableDictionary *session; +@property (nonatomic) BOOL sendAfterLogin; + +- (void)sendWithToken:(NSString *)token; +- (void)getSession:(NSString *)email password:(NSString *)password; +- (void)signRequest:(SHKRequest *)aRequest; + +@end diff --git a/Classes/ShareKit/Sharers/Services/Google Reader/SHKGoogleReader.m b/Classes/ShareKit/Sharers/Services/Google Reader/SHKGoogleReader.m new file mode 100644 index 00000000..d2aa6b6b --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Google Reader/SHKGoogleReader.m @@ -0,0 +1,301 @@ +// +// SHKGoogleReader.m +// ShareKit +// +// Created by Nathan Weiner on 6/20/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + + +/* + +Google Reader API is unoffical, this was hobbled together from: + http://code.google.com/p/pyrfeed/wiki/GoogleReaderAPI + http://stackoverflow.com/questions/1041389/adding-notes-using-google-readers-api + http://www.google.com/support/reader/bin/answer.py?hl=en&answer=147149 +*/ + + +#import "SHKGoogleReader.h" + + +@implementation SHKGoogleReader + +@synthesize session; +@synthesize sendAfterLogin; + + +- (void)dealloc +{ + [session release]; + [super dealloc]; +} + + + +#pragma mark - +#pragma mark Configuration : Service Defination + ++ (NSString *)sharerTitle +{ + return @"Google Reader"; +} + ++ (BOOL)canShareURL +{ + return YES; +} + + + +#pragma mark - +#pragma mark Authorization + ++ (NSString *)authorizationFormCaption +{ + return SHKLocalizedString(@"Create a free account at %@", @"Google.com/reader"); +} + ++ (NSArray *)authorizationFormFields +{ + return [NSArray arrayWithObjects: + [SHKFormFieldSettings label:SHKLocalizedString(@"Email") key:@"email" type:SHKFormFieldTypeText start:nil], + [SHKFormFieldSettings label:SHKLocalizedString(@"Password") key:@"password" type:SHKFormFieldTypePassword start:nil], + nil]; +} + +- (void)authorizationFormValidate:(SHKFormController *)form +{ + // Display an activity indicator + if (!quiet) + [[SHKActivityIndicator currentIndicator] displayActivity:SHKLocalizedString(@"Logging In...")]; + + + // Authorize the user through the server + NSDictionary *formValues = [form formValues]; + + [self getSession:[formValues objectForKey:@"email"] + password:[formValues objectForKey:@"password"]]; + + self.pendingForm = form; +} + +- (void)getSession:(NSString *)email password:(NSString *)password +{ + NSString *params = [NSMutableString stringWithFormat:@"service=reader&source=%@&Email=%@&Passwd=%@&accountType=GOOGLE", + [NSString stringWithFormat:@"ShareKit-%@-%@", SHKEncode(SHKMyAppName), SHK_VERSION], + SHKEncode(email), + SHKEncode(password) + ]; + + self.request = [[[SHKRequest alloc] initWithURL:[NSURL URLWithString:@"https://www.google.com/accounts/ClientLogin"] + params:params + delegate:self + isFinishedSelector:@selector(authFinished:) + method:@"POST" + autostart:YES] autorelease]; +} + +- (void)authFinished:(SHKRequest *)aRequest +{ + // TODO - better error handling - use error codes from ( http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html ) + // TODO - capatcha support + + // Hide the activity indicator + if (!sendAfterLogin) + [[SHKActivityIndicator currentIndicator] hide]; + + // Parse Result + self.session = [NSMutableDictionary dictionaryWithCapacity:0]; + NSString *result = [request getResult]; + NSArray *parts; + + if (result != nil) + { + NSArray *lines = [result componentsSeparatedByString:@"\n"]; + for( NSString *line in lines) + { + parts = [line componentsSeparatedByString:@"="]; + if (parts.count == 2) + [session setObject:[parts objectAtIndex:1] forKey:[parts objectAtIndex:0]]; + } + } + + if (session != nil && [session objectForKey:@"Auth"]) + { + if (sendAfterLogin) + [self tryToSend]; + + else + [pendingForm saveForm]; + } + + else + { + NSString *error = [session objectForKey:@"Error"]; + NSString *message = nil; + + if (error != nil) + message = [error isEqualToString:@"BadAuthentication"] ? SHKLocalizedString(@"Incorrect username and password") : error; + + if (message == nil) // TODO - Could use some clearer message here. + message = SHKLocalizedString(@"There was an error logging into Google Reader"); + + [[[[UIAlertView alloc] initWithTitle:SHKLocalizedString(@"Login Error") + message:message + delegate:nil + cancelButtonTitle:SHKLocalizedString(@"Close") + otherButtonTitles:nil] autorelease] show]; + } +} + + +#pragma mark - +#pragma mark Share Form + +- (NSArray *)shareFormFieldsForType:(SHKShareType)type +{ + if (type == SHKShareTypeURL) + return [NSArray arrayWithObjects: + [SHKFormFieldSettings label:SHKLocalizedString(@"Note") key:@"text" type:SHKFormFieldTypeText start:item.text], + [SHKFormFieldSettings label:SHKLocalizedString(@"Public") key:@"share" type:SHKFormFieldTypeSwitch start:SHKFormFieldSwitchOff], + nil]; + + return nil; +} + + +#pragma mark - +#pragma mark Share API Methods + +- (void)signRequest:(SHKRequest *)aRequest +{ + // Add session cookie + NSDictionary *cookieDictionary; + NSHTTPCookie *cookie; + NSMutableArray *cookies = [NSMutableArray arrayWithCapacity:0]; + for (NSString *cookieName in session) + { + + cookieDictionary = [NSDictionary dictionaryWithObjectsAndKeys: + cookieName, NSHTTPCookieName, + [session objectForKey:cookieName], NSHTTPCookieValue, + @".google.com", NSHTTPCookieDomain, + @"/", NSHTTPCookiePath, + [NSDate dateWithTimeIntervalSinceNow:1600000000], NSHTTPCookieExpires, + nil]; + cookie = [NSHTTPCookie cookieWithProperties:cookieDictionary]; + [cookies addObject:cookie]; + } + NSMutableDictionary *headers = [[[NSHTTPCookie requestHeaderFieldsWithCookies:cookies] mutableCopy] autorelease]; + + [headers setObject:[NSString stringWithFormat:@"GoogleLogin auth=%@",[session objectForKey:@"Auth"]] forKey:@"Authorization"]; + + [aRequest setHeaderFields:headers]; +} + +- (BOOL)send +{ + if ([self validateItem]) + { + BOOL sentAfterLogin = sendAfterLogin; + + if (session == nil) + { + // Login first + self.sendAfterLogin = YES; + [self getSession:[self getAuthValueForKey:@"email"] + password:[self getAuthValueForKey:@"password"]]; + } + + else + { + + self.sendAfterLogin = NO; + + self.request = [[[SHKRequest alloc] initWithURL:[NSURL URLWithString: + [NSString stringWithFormat: + @"http://www.google.com/reader/api/0/token?ck=%i", + [[NSDate date] timeIntervalSince1970] + ]] + params:nil + delegate:self + isFinishedSelector:@selector(tokenFinished:) + method:@"GET" + autostart:NO] autorelease]; + [self signRequest:request]; + [request start]; + } + + // Notify delegate + if (!sentAfterLogin) + [self sendDidStart]; + + return YES; + } + + return NO; +} + +- (void)tokenFinished:(SHKRequest *)aRequest +{ + if (aRequest.success) + [self sendWithToken:[request getResult]]; + + else + [self sendDidFailWithError:[SHK error:SHKLocalizedString(@"There was a problem authenticating your account.")]]; // TODO better error handling/message +} + +- (void)sendWithToken:(NSString *)token +{ + NSString *params = [NSMutableString stringWithFormat:@"T=%@&linkify=false&snippet=%@&srcTitle=%@&srcUrl=%@&title=%@&url=%@&share=%@", + token, + SHKEncode(item.text), + SHKEncode(SHKMyAppName), + SHKEncode(SHKMyAppURL), + SHKEncode(item.title), + SHKEncodeURL(item.URL), + [item customBoolForSwitchKey:@"share"]?@"true":@"" + ]; + + self.request = [[[SHKRequest alloc] initWithURL:[NSURL URLWithString:@"https://www.google.com/reader/api/0/item/edit"] + params:params + delegate:self + isFinishedSelector:@selector(sendFinished:) + method:@"POST" + autostart:NO] autorelease]; + + [self signRequest:request]; + [request start]; +} + +- (void)sendFinished:(SHKRequest *)aRequest +{ + if (aRequest.success) + [self sendDidFinish]; + + else + [self sendDidFailWithError:[SHK error:SHKLocalizedString(@"There was a problem saving your note.")]]; // TODO better error handling/message +} + + +@end diff --git a/Classes/ShareKit/Sharers/Services/Instapaper/SHKInstapaper.h b/Classes/ShareKit/Sharers/Services/Instapaper/SHKInstapaper.h new file mode 100755 index 00000000..5c769162 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Instapaper/SHKInstapaper.h @@ -0,0 +1,34 @@ +// +// SHKInstapaper.h +// ShareKit +// +// Created by Sean Murphy on 7/8/10. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import +#import "SHKSharer.h" + +@interface SHKInstapaper : SHKSharer { + +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Instapaper/SHKInstapaper.m b/Classes/ShareKit/Sharers/Services/Instapaper/SHKInstapaper.m new file mode 100755 index 00000000..437c94bc --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Instapaper/SHKInstapaper.m @@ -0,0 +1,166 @@ +// +// SHKInstapaper.m +// ShareKit +// +// Created by Sean Murphy on 7/8/10. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKInstapaper.h" + +static NSString * const kInstapaperAuthenticationURL = @"https://www.instapaper.com/api/authenticate"; +static NSString * const kInstapaperSharingURL = @"https://www.instapaper.com/api/add"; + +@implementation SHKInstapaper + +#pragma mark - +#pragma mark Configuration : Service Defination + ++ (NSString *)sharerTitle +{ + return @"Instapaper"; +} + ++ (BOOL)canShareURL +{ + return YES; +} + +#pragma mark - +#pragma mark Configuration : Dynamic Enable + ++ (BOOL)canShare +{ + return YES; +} + +#pragma mark - +#pragma mark Authorization + ++ (NSString *)authorizationFormCaption +{ + return SHKLocalizedString(@"Create a free account at %@", @"Instapaper.com"); +} + +- (void)authorizationFormValidate:(SHKFormController *)form +{ + // Display an activity indicator + if (!quiet) + [[SHKActivityIndicator currentIndicator] displayActivity:SHKLocalizedString(@"Logging In...")]; + + + // Authorize the user through the server + NSDictionary *formValues = [form formValues]; + + NSString *params = [NSMutableString stringWithFormat:@"username=%@&password=%@", + SHKEncode([formValues objectForKey:@"username"]), + SHKEncode([formValues objectForKey:@"password"]) + ]; + + self.request = [[[SHKRequest alloc] initWithURL:[NSURL URLWithString:kInstapaperAuthenticationURL] + params:params + delegate:self + isFinishedSelector:@selector(authFinished:) + method:@"POST" + autostart:YES] autorelease]; + + self.pendingForm = form; +} + +- (void)authFinished:(SHKRequest *)aRequest +{ + [[SHKActivityIndicator currentIndicator] hide]; + + if (aRequest.success) + [pendingForm saveForm]; + + else { + NSString *errorMessage = nil; + if (aRequest.response.statusCode == 403) + errorMessage = SHKLocalizedString(@"Sorry, Instapaper did not accept your credentials. Please try again."); + else + errorMessage = SHKLocalizedString(@"Sorry, Instapaper encountered an error. Please try again."); + + [[[[UIAlertView alloc] initWithTitle:SHKLocalizedString(@"Login Error") + message:errorMessage + delegate:nil + cancelButtonTitle:SHKLocalizedString(@"Close") + otherButtonTitles:nil] autorelease] show]; + } +} + +#pragma mark - +#pragma mark Share Form + +- (NSArray *)shareFormFieldsForType:(SHKShareType)type +{ + // Instapaper will automatically obtain a title for the URL, so we do not need + // any other information. + return nil; +} + +#pragma mark - +#pragma mark Share API Methods + +- (BOOL)send +{ + if ([self validateItem]) { + NSString *params = [NSMutableString stringWithFormat:@"url=%@&username=%@&password=%@", + SHKEncodeURL(self.item.URL), + SHKEncode([self getAuthValueForKey:@"username"]), + SHKEncode([self getAuthValueForKey:@"password"])]; + + self.request = [[[SHKRequest alloc] initWithURL:[NSURL URLWithString:kInstapaperSharingURL] + params:params + delegate:self + isFinishedSelector:@selector(sendFinished:) + method:@"POST" + autostart:YES] autorelease]; + + // Notify delegate + [self sendDidStart]; + + return YES; + } + + return NO; +} + +- (void)sendFinished:(SHKRequest *)aRequest +{ + if (!aRequest.success) { + if (aRequest.response.statusCode == 403) { + [self sendDidFailWithError:[SHK error:SHKLocalizedString(@"Sorry, Instapaper did not accept your credentials. Please try again.")] shouldRelogin:YES]; + return; + } + else if (aRequest.response.statusCode == 500) { + [self sendDidFailWithError:[SHK error:SHKLocalizedString(@"The service encountered an error. Please try again later.")]]; + return; + } + + [self sendDidFailWithError:[SHK error:SHKLocalizedString(@"There was a problem saving to Instapaper.")]]; + return; + } + + [self sendDidFinish]; +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Pinboard/SHKPinboard.h b/Classes/ShareKit/Sharers/Services/Pinboard/SHKPinboard.h new file mode 100644 index 00000000..6995bb28 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Pinboard/SHKPinboard.h @@ -0,0 +1,36 @@ +// +// SHKPinboard.h +// ShareKit +// +// Created by Nathan Weiner on 6/21/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import +#import "SHKSharer.h" + +@interface SHKPinboard : SHKSharer +{ + +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Pinboard/SHKPinboard.m b/Classes/ShareKit/Sharers/Services/Pinboard/SHKPinboard.m new file mode 100644 index 00000000..b0d4911a --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Pinboard/SHKPinboard.m @@ -0,0 +1,173 @@ +// +// SHKPinboard.m +// ShareKit +// +// Created by Nathan Weiner on 6/21/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKPinboard.h" + + +@implementation SHKPinboard + + + +#pragma mark - +#pragma mark Configuration : Service Defination + ++ (NSString *)sharerTitle +{ + return @"Pinboard"; +} + ++ (BOOL)canShareURL +{ + return YES; +} + + +#pragma mark - +#pragma mark Authorization + ++ (NSString *)authorizationFormCaption +{ + return SHKLocalizedString(@"Create an account at %@", @"http://pinboard.in"); +} + +- (void)authorizationFormValidate:(SHKFormController *)form +{ + // Display an activity indicator + if (!quiet) + [[SHKActivityIndicator currentIndicator] displayActivity:SHKLocalizedString(@"Logging In...")]; + + + // Authorize the user through the server + NSDictionary *formValues = [form formValues]; + + self.request = [[[SHKRequest alloc] initWithURL:[NSURL URLWithString: + [NSString stringWithFormat:@"https://%@:%@@api.pinboard.in/v1/posts/get", + SHKEncode([formValues objectForKey:@"username"]), + SHKEncode([formValues objectForKey:@"password"]) + ]] + params:nil + delegate:self + isFinishedSelector:@selector(authFinished:) + method:@"POST" + autostart:YES] autorelease]; + + self.pendingForm = form; +} + +- (BOOL)handleResponse:(SHKRequest *)aRequest +{ + NSString *response = [aRequest getResult]; + + if ([response isEqualToString:SHKLocalizedString(@"401 Forbidden")]) + { + [self sendDidFailShouldRelogin]; + return NO; + } + + return YES; +} + +- (void)authFinished:(SHKRequest *)aRequest +{ + // Hide the activity indicator + [[SHKActivityIndicator currentIndicator] hide]; + + if ([self handleResponse:aRequest]) + { + [pendingForm saveForm]; + } +} + + +#pragma mark - +#pragma mark Share Form + +- (NSArray *)shareFormFieldsForType:(SHKShareType)type +{ + if (type == SHKShareTypeURL) + return [NSArray arrayWithObjects: + [SHKFormFieldSettings label:SHKLocalizedString(@"Title") key:@"title" type:SHKFormFieldTypeText start:item.title], + [SHKFormFieldSettings label:SHKLocalizedString(@"Tags") key:@"tags" type:SHKFormFieldTypeText start:item.tags], + [SHKFormFieldSettings label:SHKLocalizedString(@"Notes") key:@"text" type:SHKFormFieldTypeText start:item.text], + [SHKFormFieldSettings label:SHKLocalizedString(@"Shared") key:@"shared" type:SHKFormFieldTypeSwitch start:SHKFormFieldSwitchOff], + nil]; + + return nil; +} + + + +#pragma mark - +#pragma mark Share API Methods + +- (BOOL)send +{ + if ([self validateItem]) + { + self.request = [[[SHKRequest alloc] initWithURL:[NSURL URLWithString: + [NSString stringWithFormat:@"https://%@:%@@api.pinboard.in/v1/posts/add?url=%@&description=%@&tags=%@&extended=%@&shared=%@", + SHKEncode([self getAuthValueForKey:@"username"]), + SHKEncode([self getAuthValueForKey:@"password"]), + SHKEncodeURL(item.URL), + SHKEncode(item.title), + SHKEncode(item.tags), + SHKEncode(item.text), + [item customBoolForSwitchKey:@"shared"]?@"yes":@"no" + ]] + params:nil + delegate:self + isFinishedSelector:@selector(sendFinished:) + method:@"GET" + autostart:YES] autorelease]; + + + // Notify delegate + [self sendDidStart]; + + return YES; + } + + return NO; +} + +- (void)sendFinished:(SHKRequest *)aRequest +{ + if ([self handleResponse:aRequest]) + { + // TODO parse +#import "SHKSharer.h" + +@interface SHKReadItLater : SHKSharer +{ +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Read It Later/SHKReadItLater.m b/Classes/ShareKit/Sharers/Services/Read It Later/SHKReadItLater.m new file mode 100644 index 00000000..c9e42584 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Read It Later/SHKReadItLater.m @@ -0,0 +1,188 @@ + // +// SHKReadItLater.m +// ShareKit +// +// Created by Nathan Weiner on 6/8/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +// SHOULD FUNCS - can these be implemented like dataSource and delegate on tableview? + +#import "SHKReadItLater.h" + + +@implementation SHKReadItLater + + +#pragma mark - +#pragma mark Configuration : Service Defination + ++ (NSString *)sharerTitle +{ + return @"Read It Later"; +} + ++ (BOOL)canShareURL +{ + return YES; +} + + +#pragma mark - +#pragma mark Configuration : Dynamic Enable + +// Though manual sharing is supported (by changing removing this subclass), one tap to save is the ideal 'read later' behavior +- (BOOL)shouldAutoShare +{ + return YES; +} + + + +#pragma mark - +#pragma mark Authorization + ++ (NSString *)authorizationFormCaption +{ + return SHKLocalizedString(@"Create a free account at %@", @"Readitlaterlist.com"); +} + +- (void)authorizationFormValidate:(SHKFormController *)form +{ + // Display an activity indicator + if (!quiet) + [[SHKActivityIndicator currentIndicator] displayActivity:SHKLocalizedString(@"Logging In...")]; + + + // Authorize the user through the server + NSDictionary *formValues = [form formValues]; + + NSString *params = [NSMutableString stringWithFormat:@"apikey=%@&username=%@&password=%@", + SHKReadItLaterKey, + SHKEncode([formValues objectForKey:@"username"]), + SHKEncode([formValues objectForKey:@"password"]) + ]; + + self.request = [[[SHKRequest alloc] initWithURL:[NSURL URLWithString:@"http://readitlaterlist.com/v2/auth"] + params:params + delegate:self + isFinishedSelector:@selector(authFinished:) + method:@"POST" + autostart:YES] autorelease]; + + self.pendingForm = form; +} + +- (void)authFinished:(SHKRequest *)aRequest +{ + // Hide the activity indicator + [[SHKActivityIndicator currentIndicator] hide]; + + if (aRequest.success) + [pendingForm saveForm]; + + else + { + [[[[UIAlertView alloc] initWithTitle:SHKLocalizedString(@"Login Error") + message:[request.headers objectForKey:@"X-Error"] + delegate:nil + cancelButtonTitle:SHKLocalizedString(@"Close") + otherButtonTitles:nil] autorelease] show]; + } +} + + + +#pragma mark - +#pragma mark Share Form + +- (NSArray *)shareFormFieldsForType:(SHKShareType)type +{ + if (type == SHKShareTypeURL) + return [NSArray arrayWithObjects: + [SHKFormFieldSettings label:SHKLocalizedString(@"Title") key:@"title" type:SHKFormFieldTypeText start:item.title], + [SHKFormFieldSettings label:SHKLocalizedString(@"Tags") key:@"tags" type:SHKFormFieldTypeText start:item.tags], + nil]; + + return nil; +} + + +#pragma mark - +#pragma mark Share API Methods + +- (BOOL)send +{ + if ([self validateItem]) + { + NSString *new = [NSString stringWithFormat:@"&new={\"0\":{\"url\":\"%@\",\"title\":\"%@\"}}", + SHKEncodeURL(item.URL), + SHKEncode(item.title)]; + + NSString *tags = item.tags == nil || !item.tags.length ? @"" : + [NSString stringWithFormat:@"&update_tags={\"0\":{\"url\":\"%@\",\"tags\":\"%@\"}}", + SHKEncodeURL(item.URL), SHKEncode(item.tags)]; + + NSString *params = [NSMutableString stringWithFormat:@"apikey=%@&username=%@&password=%@%@%@", + SHKReadItLaterKey, + SHKEncode([self getAuthValueForKey:@"username"]), + SHKEncode([self getAuthValueForKey:@"password"]), + new, + tags]; + + self.request = [[[SHKRequest alloc] initWithURL:[NSURL URLWithString:@"http://readitlaterlist.com/v2/send"] + params:params + delegate:self + isFinishedSelector:@selector(sendFinished:) + method:@"POST" + autostart:YES] autorelease]; + + + // Notify delegate + [self sendDidStart]; + + return YES; + } + + return NO; +} + +- (void)sendFinished:(SHKRequest *)aRequest +{ + if (!aRequest.success) + { + if (aRequest.response.statusCode == 401) + { + [self sendDidFailShouldRelogin]; + return; + } + + [self sendDidFailWithError:[SHK error:[request.headers objectForKey:@"X-Error"]]]; + return; + } + + [self sendDidFinish]; +} + + + +@end diff --git a/Classes/ShareKit/Sharers/Services/Tumblr/SHKTumblr.h b/Classes/ShareKit/Sharers/Services/Tumblr/SHKTumblr.h new file mode 100644 index 00000000..3ba93c4b --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Tumblr/SHKTumblr.h @@ -0,0 +1,18 @@ +// +// SHKTumblr.h +// ShareKit +// +// Created by Jamie Pinkham on 7/10/10. +// Copyright 2010 Mobelux. All rights reserved. +// + +#import +#import "SHKSharer.h" + +@interface SHKTumblr : SHKSharer { + //for photo posts + NSMutableData *data; + NSHTTPURLResponse *response; +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Tumblr/SHKTumblr.m b/Classes/ShareKit/Sharers/Services/Tumblr/SHKTumblr.m new file mode 100644 index 00000000..e6157af1 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Tumblr/SHKTumblr.m @@ -0,0 +1,401 @@ +// +// SHKTumblr.m +// ShareKit +// +// Created by Jamie Pinkham on 7/10/10. +// Copyright 2010 Mobelux. All rights reserved. +// + +#import "SHKTumblr.h" + +static NSString * const kTumblrAuthenticationURL = @"https://www.tumblr.com/api/authenticate"; +static NSString * const kTumblrWriteURL = @"https://www.tumblr.com/api/write"; + +@interface SHKTumblr() +- (void)finish; +@end + +@implementation SHKTumblr + +#pragma mark - +#pragma mark Memory management +- (void)dealloc{ + [data release]; + [response release]; + [super dealloc]; +} + +#pragma mark - +#pragma mark Configuration : Service Defination + ++ (NSString *)sharerTitle{ + return @"Tumblr"; +} + ++ (BOOL)canShareURL{ + return YES; +} + ++ (BOOL)canShareText{ + return YES; +} + ++ (BOOL)canShareImage{ + return YES; +} + +#pragma mark - +#pragma mark Configuration : Dynamic Enable + ++ (BOOL)canShare{ + return YES; +} + +- (BOOL)shouldAutoShare{ + return NO; +} + +#pragma mark - +#pragma mark Authorization + +- (NSString *)authorizationFormCaption{ + return SHKLocalizedString(@"Create a free account at %@", @"Tumblr.com"); +} + +- (void)authorizationFormValidate:(SHKFormController *)form{ + // Display an activity indicator + if (!quiet) + [[SHKActivityIndicator currentIndicator] displayActivity:SHKLocalizedString(@"Logging In...")]; + + + // Authorize the user through the server + NSDictionary *formValues = [form formValues]; + + NSString *params = [NSMutableString stringWithFormat:@"email=%@&password=%@", + SHKEncode([formValues objectForKey:@"email"]), + SHKEncode([formValues objectForKey:@"password"]) + ]; + + self.request = [[[SHKRequest alloc] initWithURL:[NSURL URLWithString:kTumblrAuthenticationURL] + params:params + delegate:self + isFinishedSelector:@selector(authFinished:) + method:@"POST" + autostart:YES] autorelease]; + + self.pendingForm = form; +} + +- (void)authFinished:(SHKRequest *)aRequest{ + [[SHKActivityIndicator currentIndicator] hide]; + if (aRequest.success) + [pendingForm saveForm]; + + else { + NSString *errorMessage = nil; + if (aRequest.response.statusCode == 403) + errorMessage = SHKLocalizedString(@"Invalid email or password."); + else + errorMessage = SHKLocalizedString(@"The service encountered an error. Please try again later."); + + [[[[UIAlertView alloc] initWithTitle:SHKLocalizedString(@"Login Error") + message:errorMessage + delegate:nil + cancelButtonTitle:SHKLocalizedString(@"Close") + otherButtonTitles:nil] autorelease] show]; + } +} + +#pragma mark - +#pragma mark Authorize form +- (NSArray *)authorizationFormFields{ + return [NSArray arrayWithObjects: + [SHKFormFieldSettings label:SHKLocalizedString(@"Email") + key:@"email" + type:SHKFormFieldTypeText + start:nil], + [SHKFormFieldSettings label:SHKLocalizedString(@"Password") + key:@"password" + type:SHKFormFieldTypePassword + start:nil], + nil]; +} + +#pragma mark - +#pragma mark Share Form + +- (NSArray *)shareFormFieldsForType:(SHKShareType)type{ + NSMutableArray *baseArray = [NSMutableArray arrayWithObjects: + [SHKFormFieldSettings label:SHKLocalizedString(@"Tags") + key:@"tags" + type:SHKFormFieldTypeText + start:item.tags], + [SHKFormFieldSettings label:SHKLocalizedString(@"Slug") + key:@"slug" + type:SHKFormFieldTypeText + start:nil], + [SHKFormFieldSettings label:SHKLocalizedString(@"Private") + key:@"private" + type:SHKFormFieldTypeSwitch + start:SHKFormFieldSwitchOff], + [SHKFormFieldSettings label:SHKLocalizedString(@"Send to Twitter") + key:@"twitter" + type:SHKFormFieldTypeSwitch + start:SHKFormFieldSwitchOff], + nil + ]; + if([item shareType] == SHKShareTypeImage){ + [baseArray insertObject:[SHKFormFieldSettings label:SHKLocalizedString(@"Caption") + key:@"caption" + type:SHKFormFieldTypeText + start:nil] + atIndex:0]; + }else{ + [baseArray insertObject:[SHKFormFieldSettings label:SHKLocalizedString(@"Title") + key:@"title" + type:SHKFormFieldTypeText + start:item.title] + atIndex:0]; + } + + if([item shareType] == SHKShareTypeURL){ + // Auto-detect Dailymotion links and generate an attached embed player + if ([item.URL.host hasSuffix:@"dailymotion.com"]){ + NSString *videoId = nil; + BOOL idIsNextComponent = NO; + for (NSString *component in [item.URL.path componentsSeparatedByString:@"/"]){ + if (idIsNextComponent){ + videoId = [[component componentsSeparatedByString:@"_"] objectAtIndex:0]; + break; + }else if ([component isEqualToString:@"video"]){ + idIsNextComponent = YES; + } + } + + if (videoId){ + [item setCustomValue:[NSString stringWithFormat:@"", videoId] forKey:@"iframe"]; + } + } + } + + if ([item customValueForKey:@"iframe"]) + { + [baseArray insertObject:[SHKFormFieldSettings label:SHKLocalizedString(@"Text") key:@"text" type:SHKFormFieldTypeText start:item.text] atIndex:1]; + } + + return baseArray; +} + +#pragma mark - +#pragma mark Share API Methods + +- (BOOL)send{ + if ([self validateItem]) { + if([item shareType] == SHKShareTypeText || [item shareType] == SHKShareTypeURL){ + NSMutableString *params = [NSMutableString stringWithFormat:@"email=%@&password=%@", + SHKEncode([self getAuthValueForKey:@"email"]), + SHKEncode([self getAuthValueForKey:@"password"])]; + + //set send to twitter param + if([item customBoolForSwitchKey:@"twitter"]){ + [params appendFormat:@"&send-to-twitter=auto"]; + }else{ + [params appendFormat:@"&send-to-twitter=no"]; + } + + //set tags param + NSString *tags = [item tags]; + if(tags){ + [params appendFormat:@"&tags=%@",[item tags]]; + } + + //set slug param + NSString *slug = [item customValueForKey:@"slug"]; + if(slug){ + [params appendFormat:@"&slug=%@", slug]; + } + + //set private param + if([item customBoolForSwitchKey:@"private"]){ + [params appendFormat:@"&private=1"]; + }else{ + [params appendFormat:@"&private=0"]; + } + + //set type param + if ([item shareType] == SHKShareTypeURL){ + if ([item customValueForKey:@"iframe"]){ + [params appendString:@"&type=regular"]; + if([item title]){ + [params appendFormat:@"&title=%@", SHKEncode([item title])]; + } + [params appendFormat:@"&body=%@", SHKEncode([NSString stringWithFormat:@"%@

%@

", [item customValueForKey:@"iframe"], [item text]])]; + }else{ + [params appendString:@"&type=link"]; + [params appendFormat:@"&url=%@",SHKEncodeURL([item URL])]; + if([item title]){ + [params appendFormat:@"&name=%@", SHKEncode([item title])]; + } + } + }else{ + [params appendString:@"&type=regular"]; + if([item title]){ + [params appendFormat:@"&title=%@", SHKEncode([item title])]; + } + [params appendFormat:@"&body=%@", SHKEncode([item text])]; + } + self.request = [[[SHKRequest alloc] initWithURL:[NSURL URLWithString:kTumblrWriteURL] + params:params + delegate:self + isFinishedSelector:@selector(sendFinished:) + method:@"POST" + autostart:YES] autorelease]; + } + else if([item shareType] == SHKShareTypeImage){ + + NSData *imageData = UIImageJPEGRepresentation([item image], 0.9); + NSMutableURLRequest *aRequest = [[[NSMutableURLRequest alloc] init] autorelease]; + [aRequest setURL:[NSURL URLWithString:kTumblrWriteURL]]; + [aRequest setHTTPMethod:@"POST"]; + NSString *boundary = @"0xKhTmLbOuNdArY"; + //NSString *boundary = [NSString stringWithString:@"---------------------------14737809831466499882746641449"]; + NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary]; + [aRequest addValue:contentType forHTTPHeaderField: @"Content-Type"]; + + /* + now lets create the body of the post + */ + NSMutableData *body = [NSMutableData data]; + [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] + dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[@"Content-Disposition: form-data; name=\"email\"\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[[self getAuthValueForKey:@"email"] dataUsingEncoding:NSUTF8StringEncoding]]; + + [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] + dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[@"Content-Disposition: form-data; name=\"password\"\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[[self getAuthValueForKey:@"password"] dataUsingEncoding:NSUTF8StringEncoding]]; + + [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] + dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[@"Content-Disposition: form-data; name=\"type\"\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[@"photo" dataUsingEncoding:NSUTF8StringEncoding]]; + + if([item tags]){ + [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] + dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[@"Content-Disposition: form-data; name=\"tags\"\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[[item tags] dataUsingEncoding:NSUTF8StringEncoding]]; + } + if([item customValueForKey:@"caption"]){ + [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] + dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[@"Content-Disposition: form-data; name=\"caption\"\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[[item customValueForKey:@"caption"] dataUsingEncoding:NSUTF8StringEncoding]]; + + } + if([item customValueForKey:@"slug"]){ + [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] + dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[@"Content-Disposition: form-data; name=\"slug\"\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[[item customValueForKey:@"slug"] dataUsingEncoding:NSUTF8StringEncoding]]; + } + [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] + dataUsingEncoding:NSUTF8StringEncoding]]; + if([item customBoolForSwitchKey:@"private"]){ + [body appendData:[@"Content-Disposition: form-data; name=\"private\"\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[@"1" dataUsingEncoding:NSUTF8StringEncoding]]; + }else{ + [body appendData:[@"Content-Disposition: form-data; name=\"private\"\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[@"0" dataUsingEncoding:NSUTF8StringEncoding]]; + } + + [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] + dataUsingEncoding:NSUTF8StringEncoding]]; + if([item customBoolForSwitchKey:@"twitter"]){ + [body appendData:[@"Content-Disposition: form-data; name=\"twitter\"\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[@"auto" dataUsingEncoding:NSUTF8StringEncoding]]; + }else{ + [body appendData:[@"Content-Disposition: form-data; name=\"twitter\"\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[@"no" dataUsingEncoding:NSUTF8StringEncoding]]; + } + + [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[@"Content-Disposition: form-data; name=\"data\"; filename=\"upload.jpg\"\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[@"Content-Transfer-Encoding: image/jpg\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:imageData]; + [body appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; + + // setting the body of the post to the reqeust + [aRequest setHTTPBody:body]; + [NSURLConnection connectionWithRequest:aRequest delegate:self]; + } + + + // Notify delegate + [self sendDidStart]; + + return YES; + } + + return NO; +} + +- (void)sendFinished:(SHKRequest *)aRequest{ + if (!aRequest.success) { + if (aRequest.response.statusCode == 403) { + [self sendDidFailWithError:[SHK error:SHKLocalizedString(@"Invalid email or password.")] shouldRelogin:YES]; + return; + } + else if (aRequest.response.statusCode == 500) { + [self sendDidFailWithError:[SHK error:SHKLocalizedString(@"The service encountered an error. Please try again later.")]]; + return; + } + + [self sendDidFailWithError:[SHK error:SHKLocalizedString(@"There was an error sending your post to Tumblr.")]]; + return; + } + + [self sendDidFinish]; +} + +#pragma mark - +#pragma mark NSURLConnection delegate methods for image posts +- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSHTTPURLResponse *)theResponse { + [response release]; + response = [theResponse retain]; + + [data setLength:0]; +} + +- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)d { + [data appendData:d]; +} + +- (void)connectionDidFinishLoading:(NSURLConnection *)connection { + [self finish]; +} + +- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { + + [self finish]; +} + +- (void)finish{ + if(response.statusCode == 200 || response.statusCode == 201){ + [self sendDidFinish]; + }else{ + if(response.statusCode == 403) { + [self sendDidFailWithError:[SHK error:SHKLocalizedString(@"Invalid email or password.")] shouldRelogin:YES]; + return; + } + else if (response.statusCode == 500) { + [self sendDidFailWithError:[SHK error:SHKLocalizedString(@"The service encountered an error. Please try again later.")]]; + return; + } + [self sendDidFailWithError:[SHK error:SHKLocalizedString(@"There was a sending your post to Tumblr.")]]; + } + +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Twitter/SHKTwitter.h b/Classes/ShareKit/Sharers/Services/Twitter/SHKTwitter.h new file mode 100644 index 00000000..cbb02783 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Twitter/SHKTwitter.h @@ -0,0 +1,62 @@ +// +// SHKTwitter.h +// ShareKit +// +// Created by Nathan Weiner on 6/21/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import +#import "SHKOAuthSharer.h" +#import "SHKTwitterForm.h" + +@interface SHKTwitter : SHKOAuthSharer +{ + BOOL xAuth; +} + +@property BOOL xAuth; + + +#pragma mark - +#pragma mark UI Implementation + +- (void)showTwitterForm; + +#pragma mark - +#pragma mark Share API Methods + +- (void)shortenURL; +- (void)shortenURLFinished:(SHKRequest *)aRequest; + +- (void)sendForm:(SHKTwitterForm *)form; + +- (void)sendStatus; +- (void)sendStatusTicket:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data; +- (void)sendStatusTicket:(OAServiceTicket *)ticket didFailWithError:(NSError*)error; +- (void)sendImage; +- (void)sendImageTicket:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data; +- (void)sendImageTicket:(OAServiceTicket *)ticket didFailWithError:(NSError*)error; + +- (void)followMe; + +@end diff --git a/Classes/ShareKit/Sharers/Services/Twitter/SHKTwitter.m b/Classes/ShareKit/Sharers/Services/Twitter/SHKTwitter.m new file mode 100644 index 00000000..eb81dc25 --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Twitter/SHKTwitter.m @@ -0,0 +1,550 @@ +// +// SHKTwitter.m +// ShareKit +// +// Created by Nathan Weiner on 6/21/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +// TODO - SHKTwitter supports offline sharing, however the url cannot be shortened without an internet connection. Need a graceful workaround for this. + + +#import "SHKTwitter.h" + +@implementation SHKTwitter + +@synthesize xAuth; + +- (id)init +{ + if (self = [super init]) + { + // OAUTH + self.consumerKey = SHKTwitterConsumerKey; + self.secretKey = SHKTwitterSecret; + self.authorizeCallbackURL = [NSURL URLWithString:SHKTwitterCallbackUrl];// HOW-TO: In your Twitter application settings, use the "Callback URL" field. If you do not have this field in the settings, set your application type to 'Browser'. + + // XAUTH + self.xAuth = SHKTwitterUseXAuth?YES:NO; + + + // -- // + + + // You do not need to edit these, they are the same for everyone + self.authorizeURL = [NSURL URLWithString:@"https://twitter.com/oauth/authorize"]; + self.requestURL = [NSURL URLWithString:@"https://twitter.com/oauth/request_token"]; + self.accessURL = [NSURL URLWithString:@"https://twitter.com/oauth/access_token"]; + } + return self; +} + + +#pragma mark - +#pragma mark Configuration : Service Defination + ++ (NSString *)sharerTitle +{ + return @"Twitter"; +} + ++ (BOOL)canShareURL +{ + return YES; +} + ++ (BOOL)canShareText +{ + return YES; +} + +// TODO use img.ly to support this ++ (BOOL)canShareImage +{ + return YES; +} + + +#pragma mark - +#pragma mark Configuration : Dynamic Enable + +- (BOOL)shouldAutoShare +{ + return NO; +} + + +#pragma mark - +#pragma mark Authorization + +- (BOOL)isAuthorized +{ + return [self restoreAccessToken]; +} + +- (void)promptAuthorization +{ + if (xAuth) + [super authorizationFormShow]; // xAuth process + + else + [super promptAuthorization]; // OAuth process +} + + +#pragma mark xAuth + ++ (NSString *)authorizationFormCaption +{ + return SHKLocalizedString(@"Create a free account at %@", @"Twitter.com"); +} + ++ (NSArray *)authorizationFormFields +{ + if ([SHKTwitterUsername isEqualToString:@""]) + return [super authorizationFormFields]; + + return [NSArray arrayWithObjects: + [SHKFormFieldSettings label:SHKLocalizedString(@"Username") key:@"username" type:SHKFormFieldTypeText start:nil], + [SHKFormFieldSettings label:SHKLocalizedString(@"Password") key:@"password" type:SHKFormFieldTypePassword start:nil], + [SHKFormFieldSettings label:SHKLocalizedString(@"Follow %@", SHKTwitterUsername) key:@"followMe" type:SHKFormFieldTypeSwitch start:SHKFormFieldSwitchOn], + nil]; +} + +- (void)authorizationFormValidate:(SHKFormController *)form +{ + self.pendingForm = form; + [self tokenAccess]; +} + +- (void)tokenAccessModifyRequest:(OAMutableURLRequest *)oRequest +{ + if (xAuth) + { + NSDictionary *formValues = [pendingForm formValues]; + + OARequestParameter *username = [[[OARequestParameter alloc] initWithName:@"x_auth_username" + value:[formValues objectForKey:@"username"]] autorelease]; + + OARequestParameter *password = [[[OARequestParameter alloc] initWithName:@"x_auth_password" + value:[formValues objectForKey:@"password"]] autorelease]; + + OARequestParameter *mode = [[[OARequestParameter alloc] initWithName:@"x_auth_mode" + value:@"client_auth"] autorelease]; + + [oRequest setParameters:[NSArray arrayWithObjects:username, password, mode, nil]]; + } +} + +- (void)tokenAccessTicket:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data +{ + if (xAuth) + { + if (ticket.didSucceed) + { + [item setCustomValue:[[pendingForm formValues] objectForKey:@"followMe"] forKey:@"followMe"]; + [pendingForm close]; + } + + else + { + NSString *response = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]; + + SHKLog(@"tokenAccessTicket Response Body: %@", response); + + [self tokenAccessTicket:ticket didFailWithError:[SHK error:response]]; + return; + } + } + + [super tokenAccessTicket:ticket didFinishWithData:data]; +} + + +#pragma mark - +#pragma mark UI Implementation + +- (void)show +{ + if (item.shareType == SHKShareTypeURL) + { + [self shortenURL]; + } + + else if (item.shareType == SHKShareTypeImage) + { + [item setCustomValue:item.title forKey:@"status"]; + [self showTwitterForm]; + } + + else if (item.shareType == SHKShareTypeText) + { + [item setCustomValue:item.text forKey:@"status"]; + [self showTwitterForm]; + } +} + +- (void)showTwitterForm +{ + SHKTwitterForm *rootView = [[SHKTwitterForm alloc] initWithNibName:nil bundle:nil]; + rootView.delegate = self; + + // force view to load so we can set textView text + [rootView view]; + + rootView.textView.text = [item customValueForKey:@"status"]; + rootView.hasAttachment = item.image != nil; + + [self pushViewController:rootView animated:NO]; + + [[SHK currentHelper] showViewController:self]; +} + +- (void)sendForm:(SHKTwitterForm *)form +{ + [item setCustomValue:form.textView.text forKey:@"status"]; + [self tryToSend]; +} + + +#pragma mark - + +- (void)shortenURL +{ + if (![SHK connected]) + { + [item setCustomValue:[NSString stringWithFormat:@"%@ %@", item.title, [item.URL.absoluteString stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] forKey:@"status"]; + [self showTwitterForm]; + return; + } + + if (!quiet) + [[SHKActivityIndicator currentIndicator] displayActivity:SHKLocalizedString(@"Shortening URL...")]; + + self.request = [[[SHKRequest alloc] initWithURL:[NSURL URLWithString:[NSMutableString stringWithFormat:@"http://api.bit.ly/v3/shorten?login=%@&apikey=%@&longUrl=%@&format=txt", + SHKBitLyLogin, + SHKBitLyKey, + SHKEncodeURL(item.URL) + ]] + params:nil + delegate:self + isFinishedSelector:@selector(shortenURLFinished:) + method:@"GET" + autostart:YES] autorelease]; +} + +- (void)shortenURLFinished:(SHKRequest *)aRequest +{ + [[SHKActivityIndicator currentIndicator] hide]; + + NSString *result = [[aRequest getResult] stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]]; + + if (result == nil || [NSURL URLWithString:result] == nil) + { + // TODO - better error message + [[[[UIAlertView alloc] initWithTitle:SHKLocalizedString(@"Shorten URL Error") + message:SHKLocalizedString(@"We could not shorten the URL.") + delegate:nil + cancelButtonTitle:SHKLocalizedString(@"Continue") + otherButtonTitles:nil] autorelease] show]; + + [item setCustomValue:[NSString stringWithFormat:@"%@ %@", item.text ? item.text : item.title, [item.URL.absoluteString stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] forKey:@"status"]; + } + + else + { + ///if already a bitly login, use url instead + if ([result isEqualToString:@"ALREADY_A_BITLY_LINK"]) + result = [item.URL.absoluteString stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + + [item setCustomValue:[NSString stringWithFormat:@"%@ %@", item.text ? item.text : item.title, result] forKey:@"status"]; + } + + [self showTwitterForm]; +} + + +#pragma mark - +#pragma mark Share API Methods + +- (BOOL)validate +{ + NSString *status = [item customValueForKey:@"status"]; + return status != nil && status.length >= 0 && status.length <= 140; +} + +- (BOOL)send +{ + // Check if we should send follow request too + if (xAuth && [item customBoolForSwitchKey:@"followMe"]) + [self followMe]; + + if (![self validate]) + [self show]; + + else + { + if (item.shareType == SHKShareTypeImage) { + [self sendImage]; + } else { + [self sendStatus]; + } + + // Notify delegate + [self sendDidStart]; + + return YES; + } + + return NO; +} + +- (void)sendStatus +{ + OAMutableURLRequest *oRequest = [[OAMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://api.twitter.com/1/statuses/update.json"] + consumer:consumer + token:accessToken + realm:nil + signatureProvider:nil]; + + [oRequest setHTTPMethod:@"POST"]; + + OARequestParameter *statusParam = [[OARequestParameter alloc] initWithName:@"status" + value:[item customValueForKey:@"status"]]; + NSArray *params = [NSArray arrayWithObjects:statusParam, nil]; + [oRequest setParameters:params]; + [statusParam release]; + + OAAsynchronousDataFetcher *fetcher = [OAAsynchronousDataFetcher asynchronousFetcherWithRequest:oRequest + delegate:self + didFinishSelector:@selector(sendStatusTicket:didFinishWithData:) + didFailSelector:@selector(sendStatusTicket:didFailWithError:)]; + + [fetcher start]; + [oRequest release]; +} + +- (void)sendStatusTicket:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data +{ + // TODO better error handling here + + if (ticket.didSucceed) + [self sendDidFinish]; + + else + { + if (SHKDebugShowLogs) + SHKLog(@"Twitter Send Status Error: %@", [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]); + + // CREDIT: Oliver Drobnik + + NSString *string = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]; + + // in case our makeshift parsing does not yield an error message + NSString *errorMessage = @"Unknown Error"; + + NSScanner *scanner = [NSScanner scannerWithString:string]; + + // skip until error message + [scanner scanUpToString:@"\"error\":\"" intoString:nil]; + + + if ([scanner scanString:@"\"error\":\"" intoString:nil]) + { + // get the message until the closing double quotes + [scanner scanUpToCharactersFromSet:[NSCharacterSet characterSetWithCharactersInString:@"\""] intoString:&errorMessage]; + } + + + // this is the error message for revoked access + if ([errorMessage isEqualToString:@"Invalid / used nonce"] || [errorMessage isEqualToString:@"Could not authenticate with OAuth."]) + { + [self sendDidFailShouldRelogin]; + } + else + { + NSError *error = [NSError errorWithDomain:@"Twitter" code:2 userInfo:[NSDictionary dictionaryWithObject:errorMessage forKey:NSLocalizedDescriptionKey]]; + [self sendDidFailWithError:error]; + } + } +} + +- (void)sendStatusTicket:(OAServiceTicket *)ticket didFailWithError:(NSError*)error +{ + [self sendDidFailWithError:error]; +} + +- (void)sendImage { + + NSURL *serviceURL = nil; + if([item customValueForKey:@"profile_update"]){ + serviceURL = [NSURL URLWithString:@"http://api.twitter.com/1/account/update_profile_image.json"]; + } else { + serviceURL = [NSURL URLWithString:@"https://api.twitter.com/1/account/verify_credentials.json"]; + } + + OAMutableURLRequest *oRequest = [[OAMutableURLRequest alloc] initWithURL:serviceURL + consumer:consumer + token:accessToken + realm:@"http://api.twitter.com/" + signatureProvider:signatureProvider]; + [oRequest setHTTPMethod:@"GET"]; + + if([item customValueForKey:@"profile_update"]){ + [oRequest prepare]; + } else { + [oRequest prepare]; + + NSDictionary * headerDict = [oRequest allHTTPHeaderFields]; + NSString * oauthHeader = [NSString stringWithString:[headerDict valueForKey:@"Authorization"]]; + + [oRequest release]; + oRequest = nil; + + serviceURL = [NSURL URLWithString:@"http://img.ly/api/2/upload.xml"]; + oRequest = [[OAMutableURLRequest alloc] initWithURL:serviceURL + consumer:consumer + token:accessToken + realm:@"http://api.twitter.com/" + signatureProvider:signatureProvider]; + [oRequest setHTTPMethod:@"POST"]; + [oRequest setValue:@"https://api.twitter.com/1/account/verify_credentials.json" forHTTPHeaderField:@"X-Auth-Service-Provider"]; + [oRequest setValue:oauthHeader forHTTPHeaderField:@"X-Verify-Credentials-Authorization"]; + } + + CGFloat compression = 0.9f; + NSData *imageData = UIImageJPEGRepresentation([item image], compression); + + // TODO + // Note from Nate to creator of sendImage method - This seems like it could be a source of sluggishness. + // For example, if the image is large (say 3000px x 3000px for example), it would be better to resize the image + // to an appropriate size (max of img.ly) and then start trying to compress. + + while ([imageData length] > 700000 && compression > 0.1) { + // NSLog(@"Image size too big, compression more: current data size: %d bytes",[imageData length]); + compression -= 0.1; + imageData = UIImageJPEGRepresentation([item image], compression); + + } + + NSString *boundary = @"0xKhTmLbOuNdArY"; + NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary]; + [oRequest setValue:contentType forHTTPHeaderField:@"Content-Type"]; + + NSMutableData *body = [NSMutableData data]; + NSString *dispKey = @""; + if([item customValueForKey:@"profile_update"]){ + dispKey = @"Content-Disposition: form-data; name=\"image\"; filename=\"upload.jpg\"\r\n"; + } else { + dispKey = @"Content-Disposition: form-data; name=\"media\"; filename=\"upload.jpg\"\r\n"; + } + + + [body appendData:[[NSString stringWithFormat:@"--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[dispKey dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[@"Content-Type: image/jpg\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:imageData]; + [body appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; + + if([item customValueForKey:@"profile_update"]){ + // no ops + } else { + [body appendData:[[NSString stringWithFormat:@"--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"message\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[[item customValueForKey:@"status"] dataUsingEncoding:NSUTF8StringEncoding]]; + [body appendData:[@"\r\n" dataUsingEncoding:NSUTF8StringEncoding]]; + } + + [body appendData:[[NSString stringWithFormat:@"--%@--\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; + + // setting the body of the post to the reqeust + [oRequest setHTTPBody:body]; + + // Notify delegate + [self sendDidStart]; + + // Start the request + OAAsynchronousDataFetcher *fetcher = [OAAsynchronousDataFetcher asynchronousFetcherWithRequest:oRequest + delegate:self + didFinishSelector:@selector(sendImageTicket:didFinishWithData:) + didFailSelector:@selector(sendImageTicket:didFailWithError:)]; + + [fetcher start]; + + + [oRequest release]; +} + +- (void)sendImageTicket:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data { + // TODO better error handling here + // NSLog([[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]); + + if (ticket.didSucceed) { + [self sendDidFinish]; + // Finished uploading Image, now need to posh the message and url in twitter + NSString *dataString = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]; + NSRange startingRange = [dataString rangeOfString:@"" options:NSCaseInsensitiveSearch]; + //NSLog(@"found start string at %d, len %d",startingRange.location,startingRange.length); + NSRange endingRange = [dataString rangeOfString:@"" options:NSCaseInsensitiveSearch]; + //NSLog(@"found end string at %d, len %d",endingRange.location,endingRange.length); + + if (startingRange.location != NSNotFound && endingRange.location != NSNotFound) { + NSString *urlString = [dataString substringWithRange:NSMakeRange(startingRange.location + startingRange.length, endingRange.location - (startingRange.location + startingRange.length))]; + //NSLog(@"extracted string: %@",urlString); + [item setCustomValue:[NSString stringWithFormat:@"%@ %@",[item customValueForKey:@"status"],urlString] forKey:@"status"]; + [self sendStatus]; + } + + + } else { + [self sendDidFailWithError:nil]; + } +} + +- (void)sendImageTicket:(OAServiceTicket *)ticket didFailWithError:(NSError*)error { + [self sendDidFailWithError:error]; +} + + +- (void)followMe +{ + // remove it so in case of other failures this doesn't get hit again + [item setCustomValue:nil forKey:@"followMe"]; + + OAMutableURLRequest *oRequest = [[OAMutableURLRequest alloc] initWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://api.twitter.com/1/friendships/create/%@.json", SHKTwitterUsername]] + consumer:consumer + token:accessToken + realm:nil + signatureProvider:nil]; + + [oRequest setHTTPMethod:@"POST"]; + + OAAsynchronousDataFetcher *fetcher = [OAAsynchronousDataFetcher asynchronousFetcherWithRequest:oRequest + delegate:nil // Currently not doing any error handling here. If it fails, it's probably best not to bug the user to follow you again. + didFinishSelector:nil + didFailSelector:nil]; + + [fetcher start]; + [oRequest release]; +} + +@end diff --git a/Classes/ShareKit/Sharers/Services/Twitter/SHKTwitterForm.h b/Classes/ShareKit/Sharers/Services/Twitter/SHKTwitterForm.h new file mode 100644 index 00000000..422c8f1c --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Twitter/SHKTwitterForm.h @@ -0,0 +1,48 @@ +// +// SHKTwitterForm.h +// ShareKit +// +// Created by Nathan Weiner on 6/22/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import + + +@interface SHKTwitterForm : UIViewController +{ + id delegate; + UITextView *textView; + UILabel *counter; + BOOL hasAttachment; +} + +@property (nonatomic, retain) id delegate; +@property (nonatomic, retain) UITextView *textView; +@property (nonatomic, retain) UILabel *counter; +@property BOOL hasAttachment; + +- (void)layoutCounter; +- (void)save; +- (void)keyboardWillShow:(NSNotification *)notification; + +@end diff --git a/Classes/ShareKit/Sharers/Services/Twitter/SHKTwitterForm.m b/Classes/ShareKit/Sharers/Services/Twitter/SHKTwitterForm.m new file mode 100644 index 00000000..123f36de --- /dev/null +++ b/Classes/ShareKit/Sharers/Services/Twitter/SHKTwitterForm.m @@ -0,0 +1,238 @@ +// +// SHKTwitterForm.m +// ShareKit +// +// Created by Nathan Weiner on 6/22/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKTwitterForm.h" +#import "SHK.h" +#import "SHKTwitter.h" + + +@implementation SHKTwitterForm + +@synthesize delegate; +@synthesize textView; +@synthesize counter; +@synthesize hasAttachment; + +- (void)dealloc +{ + [delegate release]; + [textView release]; + [counter release]; + [super dealloc]; +} + +- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil +{ + if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) + { + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel + target:self + action:@selector(cancel)]; + + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:SHKLocalizedString(@"Send to Twitter") + style:UIBarButtonItemStyleDone + target:self + action:@selector(save)]; + } + return self; +} + + + +- (void)loadView +{ + [super loadView]; + + self.view.backgroundColor = [UIColor whiteColor]; + + self.textView = [[UITextView alloc] initWithFrame:self.view.bounds]; + textView.delegate = self; + textView.font = [UIFont systemFontOfSize:15]; + textView.contentInset = UIEdgeInsetsMake(5,5,0,0); + textView.backgroundColor = [UIColor whiteColor]; + textView.autoresizesSubviews = YES; + textView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + + [self.view addSubview:textView]; +} + +- (void)viewDidAppear:(BOOL)animated +{ + [super viewDidAppear:animated]; + + NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; + [nc addObserver:self selector:@selector(keyboardWillShow:) name: UIKeyboardWillShowNotification object:nil]; + + [self.textView becomeFirstResponder]; +} + +- (void)viewDidDisappear:(BOOL)animated +{ + [super viewDidDisappear:animated]; + + // Remove observers + NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; + [nc removeObserver:self name: UIKeyboardWillShowNotification object:nil]; + + // Remove the SHK view wrapper from the window + [[SHK currentHelper] viewWasDismissed]; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + +//#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +- (void)keyboardWillShow:(NSNotification *)notification +{ + CGRect keyboardFrame; + CGFloat keyboardHeight; + + // 3.2 and above + /*if (UIKeyboardFrameEndUserInfoKey) + { + [[notification.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] getValue:&keyboardFrame]; + if ([[UIDevice currentDevice] orientation] == UIDeviceOrientationPortrait || [[UIDevice currentDevice] orientation] == UIDeviceOrientationPortraitUpsideDown) + keyboardHeight = keyboardFrame.size.height; + else + keyboardHeight = keyboardFrame.size.width; + } + + // < 3.2 + else + {*/ + + [[notification.userInfo valueForKey:UIKeyboardBoundsUserInfoKey] getValue:&keyboardFrame]; + keyboardHeight = keyboardFrame.size.height; + //} + + // Find the bottom of the screen (accounting for keyboard overlay) + // This is pretty much only for pagesheet's on the iPad + UIInterfaceOrientation orient = [[UIApplication sharedApplication] statusBarOrientation]; + BOOL inLandscape = orient == UIInterfaceOrientationLandscapeLeft || orient == UIInterfaceOrientationLandscapeRight; + BOOL upsideDown = orient == UIInterfaceOrientationPortraitUpsideDown || orient == UIInterfaceOrientationLandscapeRight; + + CGPoint topOfViewPoint = [self.view convertPoint:CGPointZero toView:nil]; + CGFloat topOfView = inLandscape ? topOfViewPoint.x : topOfViewPoint.y; + + CGFloat screenHeight = inLandscape ? [[UIScreen mainScreen] applicationFrame].size.width : [[UIScreen mainScreen] applicationFrame].size.height; + + CGFloat distFromBottom = screenHeight - ((upsideDown ? screenHeight - topOfView : topOfView ) + self.view.bounds.size.height) + ([UIApplication sharedApplication].statusBarHidden || upsideDown ? 0 : 20); + CGFloat maxViewHeight = self.view.bounds.size.height - keyboardHeight + distFromBottom; + + textView.frame = CGRectMake(0,0,self.view.bounds.size.width,maxViewHeight); + [self layoutCounter]; +} +//#pragma GCC diagnostic pop + +#pragma mark - + +- (void)updateCounter +{ + if (counter == nil) + { + self.counter = [[UILabel alloc] initWithFrame:CGRectZero]; + counter.backgroundColor = [UIColor clearColor]; + counter.opaque = NO; + counter.font = [UIFont boldSystemFontOfSize:14]; + counter.textAlignment = UITextAlignmentRight; + + counter.autoresizesSubviews = YES; + counter.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin; + + [self.view addSubview:counter]; + [self layoutCounter]; + + [counter release]; + } + + int count = (hasAttachment?115:140) - textView.text.length; + counter.text = [NSString stringWithFormat:@"%@%i", hasAttachment ? @"Image + ":@"" , count]; + counter.textColor = count >= 0 ? [UIColor blackColor] : [UIColor redColor]; +} + +- (void)layoutCounter +{ + counter.frame = CGRectMake(textView.bounds.size.width-150-15, + textView.bounds.size.height-15-9, + 150, + 15); +} + +- (void)textViewDidBeginEditing:(UITextView *)textView +{ + [self updateCounter]; +} + +- (void)textViewDidChange:(UITextView *)textView +{ + [self updateCounter]; +} + +- (void)textViewDidEndEditing:(UITextView *)textView +{ + [self updateCounter]; +} + +#pragma mark - + +- (void)cancel +{ + [[SHK currentHelper] hideCurrentViewControllerAnimated:YES]; + [(SHKTwitter *)delegate sendDidCancel]; +} + +- (void)save +{ + if (textView.text.length > (hasAttachment?115:140)) + { + [[[[UIAlertView alloc] initWithTitle:SHKLocalizedString(@"Message is too long") + message:SHKLocalizedString(@"Twitter posts can only be 140 characters in length.") + delegate:nil + cancelButtonTitle:SHKLocalizedString(@"Close") + otherButtonTitles:nil] autorelease] show]; + return; + } + + else if (textView.text.length == 0) + { + [[[[UIAlertView alloc] initWithTitle:SHKLocalizedString(@"Message is empty") + message:SHKLocalizedString(@"You must enter a message in order to post.") + delegate:nil + cancelButtonTitle:SHKLocalizedString(@"Close") + otherButtonTitles:nil] autorelease] show]; + return; + } + + [(SHKTwitter *)delegate sendForm:self]; + + [[SHK currentHelper] hideCurrentViewControllerAnimated:YES]; +} + +@end diff --git a/Classes/ShareKit/UI/SHKActionSheet.h b/Classes/ShareKit/UI/SHKActionSheet.h new file mode 100644 index 00000000..0d2d76b3 --- /dev/null +++ b/Classes/ShareKit/UI/SHKActionSheet.h @@ -0,0 +1,45 @@ +// +// SHKActionSheet.h +// ShareKit +// +// Created by Nathan Weiner on 6/10/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import +#import "SHK.h" + +@interface SHKActionSheet : UIActionSheet +{ + NSMutableArray *sharers; + + SHKItem *item; +} + +@property (retain) NSMutableArray *sharers; + +@property (retain) SHKItem *item; + ++ (SHKActionSheet *)actionSheetForType:(SHKShareType)type; ++ (SHKActionSheet *)actionSheetForItem:(SHKItem *)i; + +@end \ No newline at end of file diff --git a/Classes/ShareKit/UI/SHKActionSheet.m b/Classes/ShareKit/UI/SHKActionSheet.m new file mode 100644 index 00000000..ba96ae1a --- /dev/null +++ b/Classes/ShareKit/UI/SHKActionSheet.m @@ -0,0 +1,108 @@ +// +// SHKActionSheet.m +// ShareKit +// +// Created by Nathan Weiner on 6/10/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKActionSheet.h" +#import "SHK.h" +#import "SHKSharer.h" +#import "SHKCustomShareMenu.h" +#import + +@implementation SHKActionSheet + +@synthesize item, sharers; + +- (void)dealloc +{ + [item release]; + [sharers release]; + [super dealloc]; +} + ++ (SHKActionSheet *)actionSheetForType:(SHKShareType)type +{ + SHKActionSheet *as = [[SHKActionSheet alloc] initWithTitle:SHKLocalizedString(@"Share") + delegate:nil + cancelButtonTitle:nil + destructiveButtonTitle:nil + otherButtonTitles:nil]; + as.delegate = as; + as.item = [[[SHKItem alloc] init] autorelease]; + as.item.shareType = type; + + as.sharers = [NSMutableArray arrayWithCapacity:0]; + NSArray *favoriteSharers = [SHK favoriteSharersForType:type]; + + // Add buttons for each favorite sharer + id class; + for(NSString *sharerId in favoriteSharers) + { + class = NSClassFromString(sharerId); + if ([class canShare]) + { + [as addButtonWithTitle: [class sharerTitle] ]; + [as.sharers addObject:sharerId]; + } + } + + // Add More button + [as addButtonWithTitle:SHKLocalizedString(@"More...")]; + + // Add Cancel button + [as addButtonWithTitle:SHKLocalizedString(@"Cancel")]; + as.cancelButtonIndex = as.numberOfButtons -1; + + return [as autorelease]; +} + ++ (SHKActionSheet *)actionSheetForItem:(SHKItem *)i +{ + SHKActionSheet *as = [self actionSheetForType:i.shareType]; + as.item = i; + return as; +} + +- (void)dismissWithClickedButtonIndex:(NSInteger)buttonIndex animated:(BOOL)animated +{ + // Sharers + if (buttonIndex >= 0 && buttonIndex < sharers.count) + { + [NSClassFromString([sharers objectAtIndex:buttonIndex]) performSelector:@selector(shareItem:) withObject:item]; + } + + // More + else if (buttonIndex == sharers.count) + { + SHKShareMenu *shareMenu = [[SHKCustomShareMenu alloc] initWithStyle:UITableViewStyleGrouped]; + shareMenu.item = item; + [[SHK currentHelper] showViewController:shareMenu]; + [shareMenu release]; + } + + [super dismissWithClickedButtonIndex:buttonIndex animated:animated]; +} + +@end \ No newline at end of file diff --git a/Classes/ShareKit/UI/SHKActivityIndicator.h b/Classes/ShareKit/UI/SHKActivityIndicator.h new file mode 100644 index 00000000..122bd911 --- /dev/null +++ b/Classes/ShareKit/UI/SHKActivityIndicator.h @@ -0,0 +1,59 @@ +// +// SHKActivityIndicator.h +// ShareKit +// +// Created by Nathan Weiner on 6/16/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import + + +@interface SHKActivityIndicator : UIView +{ + UILabel *centerMessageLabel; + UILabel *subMessageLabel; + + UIActivityIndicatorView *spinner; +} + +@property (nonatomic, retain) UILabel *centerMessageLabel; +@property (nonatomic, retain) UILabel *subMessageLabel; + +@property (nonatomic, retain) UIActivityIndicatorView *spinner; + + ++ (SHKActivityIndicator *)currentIndicator; + +- (void)show; +- (void)hideAfterDelay; +- (void)hide; +- (void)hidden; +- (void)displayActivity:(NSString *)m; +- (void)displayCompleted:(NSString *)m; +- (void)setCenterMessage:(NSString *)message; +- (void)setSubMessage:(NSString *)message; +- (void)showSpinner; +- (void)setProperRotation; +- (void)setProperRotation:(BOOL)animated; + +@end diff --git a/Classes/ShareKit/UI/SHKActivityIndicator.m b/Classes/ShareKit/UI/SHKActivityIndicator.m new file mode 100644 index 00000000..3354f238 --- /dev/null +++ b/Classes/ShareKit/UI/SHKActivityIndicator.m @@ -0,0 +1,280 @@ +// +// SHKActivityIndicator.m +// ShareKit +// +// Created by Nathan Weiner on 6/16/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKActivityIndicator.h" +#import + +#define SHKdegreesToRadians(x) (M_PI * x / 180.0) + +@implementation SHKActivityIndicator + +@synthesize centerMessageLabel, subMessageLabel; +@synthesize spinner; + +static SHKActivityIndicator *currentIndicator = nil; + + ++ (SHKActivityIndicator *)currentIndicator +{ + if (currentIndicator == nil) + { + UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow]; + + CGFloat width = 160; + CGFloat height = 160; + CGRect centeredFrame = CGRectMake(round(keyWindow.bounds.size.width/2 - width/2), + round(keyWindow.bounds.size.height/2 - height/2), + width, + height); + + currentIndicator = [[SHKActivityIndicator alloc] initWithFrame:centeredFrame]; + + currentIndicator.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5]; + currentIndicator.opaque = NO; + currentIndicator.alpha = 0; + + currentIndicator.layer.cornerRadius = 10; + + currentIndicator.userInteractionEnabled = NO; + currentIndicator.autoresizesSubviews = YES; + currentIndicator.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin; + + [currentIndicator setProperRotation:NO]; + + [[NSNotificationCenter defaultCenter] addObserver:currentIndicator + selector:@selector(setProperRotation) + name:UIDeviceOrientationDidChangeNotification + object:nil]; + } + + return currentIndicator; +} + +#pragma mark - + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self name:UIDeviceOrientationDidChangeNotification object:nil]; + + [centerMessageLabel release]; + [subMessageLabel release]; + [spinner release]; + + [super dealloc]; +} + +#pragma mark Creating Message + +- (void)show +{ + if ([self superview] != [[UIApplication sharedApplication] keyWindow]) + [[[UIApplication sharedApplication] keyWindow] addSubview:self]; + + [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(hide) object:nil]; + + [UIView beginAnimations:nil context:NULL]; + [UIView setAnimationDuration:0.3]; + + self.alpha = 1; + + [UIView commitAnimations]; +} + +- (void)hideAfterDelay +{ + [self performSelector:@selector(hide) withObject:nil afterDelay:0.6]; +} + +- (void)hide +{ + [UIView beginAnimations:nil context:NULL]; + [UIView setAnimationDuration:0.4]; + [UIView setAnimationDelegate:self]; + [UIView setAnimationDidStopSelector:@selector(hidden)]; + + self.alpha = 0; + + [UIView commitAnimations]; +} + +- (void)persist +{ + [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(hide) object:nil]; + + [UIView beginAnimations:nil context:NULL]; + [UIView setAnimationBeginsFromCurrentState:YES]; + [UIView setAnimationDuration:0.1]; + + self.alpha = 1; + + [UIView commitAnimations]; +} + +- (void)hidden +{ + if (currentIndicator.alpha > 0) + return; + + [currentIndicator removeFromSuperview]; + currentIndicator = nil; +} + +- (void)displayActivity:(NSString *)m +{ + [self setSubMessage:m]; + [self showSpinner]; + + [centerMessageLabel removeFromSuperview]; + self.centerMessageLabel = nil; + + if ([self superview] == nil) + [self show]; + else + [self persist]; +} + +- (void)displayCompleted:(NSString *)m +{ + [self setCenterMessage:@"✓"]; + [self setSubMessage:m]; + + [spinner removeFromSuperview]; + self.spinner = nil; + + if ([self superview] == nil) + [self show]; + else + [self persist]; + + [self hideAfterDelay]; +} + +- (void)setCenterMessage:(NSString *)message +{ + if (message == nil && centerMessageLabel != nil) + self.centerMessageLabel = nil; + + else if (message != nil) + { + if (centerMessageLabel == nil) + { + self.centerMessageLabel = [[[UILabel alloc] initWithFrame:CGRectMake(12,round(self.bounds.size.height/2-50/2),self.bounds.size.width-24,50)] autorelease]; + centerMessageLabel.backgroundColor = [UIColor clearColor]; + centerMessageLabel.opaque = NO; + centerMessageLabel.textColor = [UIColor whiteColor]; + centerMessageLabel.font = [UIFont boldSystemFontOfSize:40]; + centerMessageLabel.textAlignment = UITextAlignmentCenter; + centerMessageLabel.shadowColor = [UIColor darkGrayColor]; + centerMessageLabel.shadowOffset = CGSizeMake(1,1); + centerMessageLabel.adjustsFontSizeToFitWidth = YES; + + [self addSubview:centerMessageLabel]; + } + + centerMessageLabel.text = message; + } +} + +- (void)setSubMessage:(NSString *)message +{ + if (message == nil && subMessageLabel != nil) + self.subMessageLabel = nil; + + else if (message != nil) + { + if (subMessageLabel == nil) + { + self.subMessageLabel = [[[UILabel alloc] initWithFrame:CGRectMake(12,self.bounds.size.height-45,self.bounds.size.width-24,30)] autorelease]; + subMessageLabel.backgroundColor = [UIColor clearColor]; + subMessageLabel.opaque = NO; + subMessageLabel.textColor = [UIColor whiteColor]; + subMessageLabel.font = [UIFont boldSystemFontOfSize:17]; + subMessageLabel.textAlignment = UITextAlignmentCenter; + subMessageLabel.shadowColor = [UIColor darkGrayColor]; + subMessageLabel.shadowOffset = CGSizeMake(1,1); + subMessageLabel.adjustsFontSizeToFitWidth = YES; + + [self addSubview:subMessageLabel]; + } + + subMessageLabel.text = message; + } +} + +- (void)showSpinner +{ + if (spinner == nil) + { + self.spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; + + spinner.frame = CGRectMake(round(self.bounds.size.width/2 - spinner.frame.size.width/2), + round(self.bounds.size.height/2 - spinner.frame.size.height/2), + spinner.frame.size.width, + spinner.frame.size.height); + [spinner release]; + } + + [self addSubview:spinner]; + [spinner startAnimating]; +} + +#pragma mark - +#pragma mark Rotation + +- (void)setProperRotation +{ + [self setProperRotation:YES]; +} + +- (void)setProperRotation:(BOOL)animated +{ + UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]; + + if (animated) + { + [UIView beginAnimations:nil context:NULL]; + [UIView setAnimationDuration:0.3]; + } + + if (orientation == UIDeviceOrientationPortraitUpsideDown) + self.transform = CGAffineTransformRotate(CGAffineTransformIdentity, SHKdegreesToRadians(180)); + + else if (orientation == UIDeviceOrientationPortrait) + self.transform = CGAffineTransformRotate(CGAffineTransformIdentity, SHKdegreesToRadians(0)); + + else if (orientation == UIDeviceOrientationLandscapeLeft) + self.transform = CGAffineTransformRotate(CGAffineTransformIdentity, SHKdegreesToRadians(90)); + + else if (orientation == UIDeviceOrientationLandscapeRight) + self.transform = CGAffineTransformRotate(CGAffineTransformIdentity, SHKdegreesToRadians(-90)); + + if (animated) + [UIView commitAnimations]; +} + + +@end diff --git a/Classes/ShareKit/UI/SHKFormController.h b/Classes/ShareKit/UI/SHKFormController.h new file mode 100644 index 00000000..2d7fa35b --- /dev/null +++ b/Classes/ShareKit/UI/SHKFormController.h @@ -0,0 +1,82 @@ +// +// SHKFormController.h +// ShareKit +// +// Created by Nathan Weiner on 6/17/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import +#import "SHKFormFieldSettings.h" +#import "SHKCustomFormFieldCell.h" + +@interface SHKFormController : UITableViewController +{ + id delegate; + SEL validateSelector; + SEL saveSelector; + + NSMutableArray *sections; + NSMutableDictionary *values; + + CGFloat labelWidth; + + UITextField *activeField; + + BOOL autoSelect; +} + +@property (retain) id delegate; +@property SEL validateSelector; +@property SEL saveSelector; + +@property (retain) NSMutableArray *sections; +@property (retain) NSMutableDictionary *values; + +@property CGFloat labelWidth; + +@property (nonatomic, retain) UITextField *activeField; + +@property BOOL autoSelect; + + +- (id)initWithStyle:(UITableViewStyle)style title:(NSString *)barTitle rightButtonTitle:(NSString *)rightButtonTitle; +- (void)addSection:(NSArray *)fields header:(NSString *)header footer:(NSString *)footer; + +#pragma mark - + +- (SHKFormFieldSettings *)rowSettingsForIndexPath:(NSIndexPath *)indexPath; + +#pragma mark - +#pragma mark Completion + +- (void)close; +- (void)cancel; +- (void)validateForm; +- (void)saveForm; + +#pragma mark - + +- (NSMutableDictionary *)formValues; +- (NSMutableDictionary *)formValuesForSection:(int)section; + +@end diff --git a/Classes/ShareKit/UI/SHKFormController.m b/Classes/ShareKit/UI/SHKFormController.m new file mode 100644 index 00000000..6d687432 --- /dev/null +++ b/Classes/ShareKit/UI/SHKFormController.m @@ -0,0 +1,288 @@ +// +// SHKFormController.m +// ShareKit +// +// Created by Nathan Weiner on 6/17/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHK.h" +#import "SHKCustomFormController.h" +#import "SHKCustomFormFieldCell.h" + + +@implementation SHKFormController + +@synthesize delegate, validateSelector, saveSelector; +@synthesize sections, values; +@synthesize labelWidth; +@synthesize activeField; +@synthesize autoSelect; + + +- (void)dealloc +{ + [delegate release]; + [sections release]; + [values release]; + [activeField release]; + + [super dealloc]; +} + + +#pragma mark - +#pragma mark Initialization + +- (id)initWithStyle:(UITableViewStyle)style title:(NSString *)barTitle rightButtonTitle:(NSString *)rightButtonTitle +{ + if (self = [super initWithStyle:style]) + { + self.title = barTitle; + + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel + target:self + action:@selector(cancel)]; + + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:rightButtonTitle + style:UIBarButtonItemStyleDone + target:self + action:@selector(validateForm)]; + + self.values = [NSMutableDictionary dictionaryWithCapacity:0]; + } + return self; +} + +- (void)addSection:(NSArray *)fields header:(NSString *)header footer:(NSString *)footer +{ + if (sections == nil) + self.sections = [NSMutableArray arrayWithCapacity:0]; + + NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithCapacity:0]; + [dict setObject:fields forKey:@"rows"]; + + if (header) + [dict setObject:header forKey:@"header"]; + + if (footer) + [dict setObject:footer forKey:@"footer"]; + + + [sections addObject:dict]; + + // Find the max length of the labels so we can use this value to align the left side of all form fields + // TODO - should probably save this per section for flexibility + if (sections.count == 1) + { + CGFloat newWidth = 0; + CGSize size; + + for (SHKFormFieldSettings *field in fields) + { + // only use text field rows + if (field.type != SHKFormFieldTypeText && field.type != SHKFormFieldTypePassword) + continue; + + size = [field.label sizeWithFont:[UIFont boldSystemFontOfSize:17]]; + if (size.width > newWidth) + newWidth = size.width; + } + + self.labelWidth = newWidth; + } +} + +#pragma mark - + +- (void)viewDidAppear:(BOOL)animated +{ + [super viewDidAppear:animated]; + + if (autoSelect) + [self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:UITableViewScrollPositionNone]; +} + +- (void)viewDidDisappear:(BOOL)animated +{ + [super viewDidDisappear:animated]; + + // Remove the SHK view wrapper from the window + [[SHK currentHelper] viewWasDismissed]; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + if (SHKFormBgColorRed != -1) + self.tableView.backgroundColor = [UIColor colorWithRed:SHKFormBgColorRed/255 green:SHKFormBgColorGreen/255 blue:SHKFormBgColorBlue/255 alpha:1]; +} + + +#pragma mark - +#pragma mark Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return sections.count; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return [[[sections objectAtIndex:section] objectForKey:@"rows"] count]; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *CellIdentifier = @"Cell"; + + SHKCustomFormFieldCell *cell = (SHKCustomFormFieldCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; + if (cell == nil) + { + cell = [[[SHKCustomFormFieldCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; + cell.form = self; + + if (SHKFormFontColorRed != -1) + cell.textLabel.textColor = [UIColor colorWithRed:SHKFormFontColorRed/255 green:SHKFormFontColorGreen/255 blue:SHKFormFontColorBlue/255 alpha:1]; + } + + // Since we are reusing table cells, make sure to save any existing values before overwriting + if (cell.settings.key != nil && [cell getValue]) + [values setObject:[cell getValue] forKey:cell.settings.key]; + + cell.settings = [self rowSettingsForIndexPath:indexPath]; + cell.labelWidth = labelWidth; + cell.textLabel.text = cell.settings.label; + + NSString *value = [values objectForKey:cell.settings.key]; + if (value == nil && cell.settings.start != nil) + value = cell.settings.start; + + [cell setValue:value]; + + return cell; +} + +- (SHKFormFieldSettings *)rowSettingsForIndexPath:(NSIndexPath *)indexPath +{ + return [[[sections objectAtIndex:indexPath.section] objectForKey:@"rows"] objectAtIndex:indexPath.row]; +} + +- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +{ + return [[sections objectAtIndex:section] objectForKey:@"header"]; +} + +- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section +{ + return [[sections objectAtIndex:section] objectForKey:@"footer"]; +} + + +#pragma mark - + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + + +#pragma mark - +#pragma mark UITextFieldDelegate + +- (BOOL)textFieldShouldReturn:(UITextField *)textField +{ + [self validateForm]; + return YES; +} + +- (void)textFieldDidBeginEditing:(UITextField *)textField +{ + self.activeField = textField; +} + + +#pragma mark - +#pragma mark Completion + +- (void)close +{ + [[SHK currentHelper] hideCurrentViewControllerAnimated:YES]; +} + +- (void)cancel +{ + [self close]; +} + +- (void)validateForm +{ + [activeField resignFirstResponder]; + [delegate performSelector:validateSelector withObject:self]; +} + +- (void)saveForm +{ + [delegate performSelector:saveSelector withObject:self]; + [self close]; +} + +#pragma mark - + +- (NSMutableDictionary *)formValues +{ + return [self formValuesForSection:0]; +} + +- (NSMutableDictionary *)formValuesForSection:(int)section +{ + // go through all form fields and get values + NSMutableDictionary *formValues = [NSMutableDictionary dictionaryWithCapacity:0]; + + SHKCustomFormFieldCell *cell; + int row = 0; + NSArray *fields = [[sections objectAtIndex:section] objectForKey:@"rows"]; + + for(SHKFormFieldSettings *field in fields) + { + cell = (SHKCustomFormFieldCell *)[self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:row inSection:section]]; + + // Use text field if visible first + if ([cell.settings.key isEqualToString:field.key] && [cell getValue] != nil) + [formValues setObject:[cell getValue] forKey:field.key]; + + // If field is not visible, use cached value + else if ([values objectForKey:field.key] != nil) + [formValues setObject:[values objectForKey:field.key] forKey:field.key]; + + row++; + } + + return formValues; +} + + + + +@end + diff --git a/Classes/ShareKit/UI/SHKFormFieldCell.h b/Classes/ShareKit/UI/SHKFormFieldCell.h new file mode 100644 index 00000000..14fc015a --- /dev/null +++ b/Classes/ShareKit/UI/SHKFormFieldCell.h @@ -0,0 +1,61 @@ +// +// SHKFormFieldCell.h +// ShareKit +// +// Created by Nathan Weiner on 6/17/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import +#import "SHK.h" + +@class SHKFormController; + +@interface SHKFormFieldCell : UITableViewCell +{ + SHKFormFieldSettings *settings; + + CGFloat labelWidth; + + UITextField *textField; + UISwitch *toggle; + + NSString *tmpValue; + + SHKFormController *form; +} + +@property (nonatomic, retain) SHKFormFieldSettings *settings; + +@property (nonatomic) CGFloat labelWidth; + +@property (nonatomic, retain, getter=getTextField) UITextField *textField; +@property (nonatomic, retain) UISwitch *toggle; + +@property (nonatomic, retain) NSString *tmpValue; + +@property (nonatomic, assign) SHKFormController *form; + +- (void)setValue:(NSString *)value; +- (NSString *)getValue; + +@end diff --git a/Classes/ShareKit/UI/SHKFormFieldCell.m b/Classes/ShareKit/UI/SHKFormFieldCell.m new file mode 100644 index 00000000..8a97abb2 --- /dev/null +++ b/Classes/ShareKit/UI/SHKFormFieldCell.m @@ -0,0 +1,161 @@ +// +// SHKFormFieldCell.m +// ShareKit +// +// Created by Nathan Weiner on 6/17/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKFormFieldCell.h" +#import "SHKCustomFormController.h" + +@implementation SHKFormFieldCell + +@synthesize settings; +@synthesize labelWidth; +@synthesize textField, toggle, tmpValue; +@synthesize form; + +#define SHK_FORM_CELL_PAD_LEFT 24 +#define SHK_FORM_CELL_PAD_RIGHT 10 + + +- (void)dealloc +{ + [settings release]; + [textField release]; + [toggle release]; + [tmpValue release]; + [super dealloc]; +} + +- (UITextField *)getTextField +{ + if (textField == nil) + { + self.textField = [[UITextField alloc] initWithFrame:CGRectMake(0,0,0,25)]; + textField.clearsOnBeginEditing = NO; + textField.returnKeyType = UIReturnKeyDone; + textField.font = [UIFont systemFontOfSize:17]; + textField.textColor = [UIColor darkGrayColor]; + textField.autocapitalizationType = UITextAutocapitalizationTypeNone; + textField.autocorrectionType = UITextAutocorrectionTypeNo; + textField.delegate = form; + [self.contentView addSubview:textField]; + [textField release]; + + [self setValue:tmpValue]; + } + return textField; +} + +- (void)layoutSubviews +{ + [super layoutSubviews]; + + if (settings.type == SHKFormFieldTypeText || settings.type == SHKFormFieldTypePassword) + { + self.textField.secureTextEntry = settings.type == SHKFormFieldTypePassword; + + textField.frame = CGRectMake(labelWidth + SHK_FORM_CELL_PAD_LEFT, + 2 + round(self.contentView.bounds.size.height/2 - textField.bounds.size.height/2), + self.contentView.bounds.size.width - SHK_FORM_CELL_PAD_RIGHT - SHK_FORM_CELL_PAD_LEFT - labelWidth, + textField.bounds.size.height); + + if (toggle != nil) + [toggle removeFromSuperview]; + } + + else if (settings.type == SHKFormFieldTypeSwitch) + { + if (toggle == nil) + { + self.toggle = [[UISwitch alloc] initWithFrame:CGRectZero]; + [self.contentView addSubview:toggle]; + [self setValue:tmpValue]; + [toggle release]; + } + + toggle.frame = CGRectMake(self.contentView.bounds.size.width-toggle.bounds.size.width-SHK_FORM_CELL_PAD_RIGHT, + round(self.contentView.bounds.size.height/2-toggle.bounds.size.height/2), + toggle.bounds.size.width, + toggle.bounds.size.height); + + if (textField != nil) + [textField removeFromSuperview]; + } + + [self.contentView bringSubviewToFront:textField]; +} + +- (void)setSelected:(BOOL)selected animated:(BOOL)animated +{ + // don't actually select the row + //[super setSelected:selected animated:animated]; + + if (selected) + [textField becomeFirstResponder]; + + else + [textField resignFirstResponder]; +} + + +#pragma mark - + +- (void)setSettings:(SHKFormFieldSettings *)s +{ + [settings release]; + settings = [s retain]; + [self setNeedsLayout]; +} + +- (void)setValue:(NSString *)value +{ + self.tmpValue = value; // used to hold onto the value in case the form field element is created after this is set + + switch (settings.type) + { + case SHKFormFieldTypeSwitch: + [toggle setOn:[value isEqualToString:SHKFormFieldSwitchOn] animated:NO]; + break; + + case SHKFormFieldTypeText: + case SHKFormFieldTypePassword: + textField.text = value; + break; + } +} + +- (NSString *)getValue +{ + switch (settings.type) + { + case SHKFormFieldTypeSwitch: + return toggle.on ? SHKFormFieldSwitchOn : SHKFormFieldSwitchOff; + break; + } + + return textField.text; +} + +@end diff --git a/Classes/ShareKit/UI/SHKFormFieldSettings.h b/Classes/ShareKit/UI/SHKFormFieldSettings.h new file mode 100644 index 00000000..4db9aba8 --- /dev/null +++ b/Classes/ShareKit/UI/SHKFormFieldSettings.h @@ -0,0 +1,55 @@ +// +// SHKFormFieldSettings.h +// ShareKit +// +// Created by Nathan Weiner on 6/22/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import + +typedef enum +{ + SHKFormFieldTypeText, + SHKFormFieldTypePassword, + SHKFormFieldTypeSwitch +} SHKFormFieldType; + +#define SHKFormFieldSwitchOff @"0" +#define SHKFormFieldSwitchOn @"1" + +@interface SHKFormFieldSettings : NSObject +{ + NSString *label; + NSString *key; + SHKFormFieldType type; + NSString *start; +} + +@property (nonatomic, retain) NSString *label; +@property (nonatomic, retain) NSString *key; +@property SHKFormFieldType type; +@property (nonatomic, retain) NSString *start; + ++ (id)label:(NSString *)l key:(NSString *)k type:(SHKFormFieldType)t start:(NSString *)s; + +@end diff --git a/Classes/ShareKit/UI/SHKFormFieldSettings.m b/Classes/ShareKit/UI/SHKFormFieldSettings.m new file mode 100644 index 00000000..c58826fb --- /dev/null +++ b/Classes/ShareKit/UI/SHKFormFieldSettings.m @@ -0,0 +1,54 @@ +// +// SHKFormFieldSettings.m +// ShareKit +// +// Created by Nathan Weiner on 6/22/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKFormFieldSettings.h" + + +@implementation SHKFormFieldSettings + +@synthesize label, key, type, start; + +- (void)dealloc +{ + [label release]; + [key release]; + [start release]; + + [super dealloc]; +} + ++ (id)label:(NSString *)l key:(NSString *)k type:(SHKFormFieldType)t start:(NSString *)s +{ + SHKFormFieldSettings *settings = [[SHKFormFieldSettings alloc] init]; + settings.label = l; + settings.key = k; + settings.type = t; + settings.start = s; + return [settings autorelease]; +} + +@end diff --git a/Classes/ShareKit/UI/SHKOAuthView.h b/Classes/ShareKit/UI/SHKOAuthView.h new file mode 100644 index 00000000..7604ee51 --- /dev/null +++ b/Classes/ShareKit/UI/SHKOAuthView.h @@ -0,0 +1,58 @@ +// +// SHKTwitterAuthView.h +// ShareKit +// +// Created by Nathan Weiner on 6/21/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import + +@class SHKOAuthView; +@class SHKOAuthSharer; + +@protocol SHKOAuthViewDelegate + +- (void)tokenAuthorizeView:(SHKOAuthView *)authView didFinishWithSuccess:(BOOL)success queryParams:(NSMutableDictionary *)queryParams error:(NSError *)error; +- (void)tokenAuthorizeCancelledView:(SHKOAuthView *)authView; +- (NSURL *)authorizeCallbackURL; + +@end + + +@interface SHKOAuthView : UIViewController +{ + UIWebView *webView; + id delegate; + UIActivityIndicatorView *spinner; +} + +@property (nonatomic, retain) UIWebView *webView; +@property (retain) id delegate; +@property (nonatomic, retain) UIActivityIndicatorView *spinner; + +- (id)initWithURL:(NSURL *)authorizeURL delegate:(id)d; + +- (void)startSpinner; +- (void)stopSpinner; + +@end diff --git a/Classes/ShareKit/UI/SHKOAuthView.m b/Classes/ShareKit/UI/SHKOAuthView.m new file mode 100644 index 00000000..7b735ca0 --- /dev/null +++ b/Classes/ShareKit/UI/SHKOAuthView.m @@ -0,0 +1,163 @@ + // +// SHKTwitterAuthView.m +// ShareKit +// +// Created by Nathan Weiner on 6/21/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKOAuthView.h" +#import "SHK.h" +#import "SHKOAuthSharer.h" + +@implementation SHKOAuthView + +@synthesize webView, delegate, spinner; + +- (void)dealloc +{ + [webView release]; + [delegate release]; + [spinner release]; + [super dealloc]; +} + +- (id)initWithURL:(NSURL *)authorizeURL delegate:(id)d +{ + if ((self = [super initWithNibName:nil bundle:nil])) + { + [self.navigationItem setLeftBarButtonItem:[[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel + target:self + action:@selector(cancel)] autorelease] animated:NO]; + + self.delegate = d; + + self.webView = [[UIWebView alloc] initWithFrame:CGRectZero]; + webView.delegate = self; + webView.scalesPageToFit = YES; + webView.dataDetectorTypes = UIDataDetectorTypeNone; + [webView release]; + + [webView loadRequest:[NSURLRequest requestWithURL:authorizeURL]]; + + } + return self; +} + +- (void)loadView +{ + self.view = webView; +} + +- (void)viewDidDisappear:(BOOL)animated +{ + [super viewDidDisappear:animated]; + + // Remove the SHK view wrapper from the window + [[SHK currentHelper] viewWasDismissed]; +} + + +- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType +{ + if ([request.URL.absoluteString rangeOfString:[delegate authorizeCallbackURL].absoluteString].location != NSNotFound) + { + // Get query + NSMutableDictionary *queryParams = nil; + if (request.URL.query != nil) + { + queryParams = [NSMutableDictionary dictionaryWithCapacity:0]; + NSArray *vars = [request.URL.query componentsSeparatedByString:@"&"]; + NSArray *parts; + for(NSString *var in vars) + { + parts = [var componentsSeparatedByString:@"="]; + if (parts.count == 2) + [queryParams setObject:[parts objectAtIndex:1] forKey:[parts objectAtIndex:0]]; + } + } + + [delegate tokenAuthorizeView:self didFinishWithSuccess:YES queryParams:queryParams error:nil]; + self.delegate = nil; + + return NO; + } + + return YES; +} + +- (void)webViewDidStartLoad:(UIWebView *)webView +{ + [self startSpinner]; +} + +- (void)webViewDidFinishLoad:(UIWebView *)aWebView +{ + [self stopSpinner]; + + // Extra sanity check for Twitter OAuth users to make sure they are using BROWSER with a callback instead of pin based auth + if ([webView.request.URL.host isEqualToString:@"twitter.com"] && [webView stringByEvaluatingJavaScriptFromString:@"document.getElementById('oauth_pin').innerHTML"].length) + [delegate tokenAuthorizeView:self didFinishWithSuccess:NO queryParams:nil error:[SHK error:@"Your SHKTwitter config is incorrect. You must set your application type to Browser and define a callback url. See SHKConfig.h for more details"]]; +} + +- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error +{ + if ([error code] != NSURLErrorCancelled && [error code] != 102 && [error code] != NSURLErrorFileDoesNotExist) + { + [self stopSpinner]; + [delegate tokenAuthorizeView:self didFinishWithSuccess:NO queryParams:nil error:error]; + } +} + +- (void)startSpinner +{ + if (spinner == nil) + { + self.spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; + [self.navigationItem setRightBarButtonItem:[[[UIBarButtonItem alloc] initWithCustomView:spinner] autorelease] animated:NO]; + spinner.hidesWhenStopped = YES; + [spinner release]; + } + + [spinner startAnimating]; +} + +- (void)stopSpinner +{ + [spinner stopAnimating]; +} + + +#pragma mark - + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + +- (void)cancel +{ + [delegate tokenAuthorizeCancelledView:self]; + [[SHK currentHelper] hideCurrentViewControllerAnimated:YES]; +} + +@end diff --git a/Classes/ShareKit/UI/SHKShareMenu.h b/Classes/ShareKit/UI/SHKShareMenu.h new file mode 100644 index 00000000..24ed9573 --- /dev/null +++ b/Classes/ShareKit/UI/SHKShareMenu.h @@ -0,0 +1,56 @@ +// +// SHKShareMenu.h +// ShareKit +// +// Created by Nathan Weiner on 6/18/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import +#import "SHK.h" + +@interface SHKShareMenu : UITableViewController +{ + SHKItem *item; + NSMutableArray *tableData; + NSMutableDictionary *exclusions; +} + +@property (nonatomic, retain) SHKItem *item; +@property (retain) NSMutableArray *tableData; +@property (retain) NSMutableDictionary *exclusions; + + +- (void)rebuildTableDataAnimated:(BOOL)animated; +- (NSMutableArray *)section:(NSString *)section; +- (NSDictionary *)rowDataAtIndexPath:(NSIndexPath *)indexPath; + +#pragma mark - +#pragma mark Toolbar Buttons + +- (void)cancel; +- (void)edit; +- (void)save; + + + +@end diff --git a/Classes/ShareKit/UI/SHKShareMenu.m b/Classes/ShareKit/UI/SHKShareMenu.m new file mode 100644 index 00000000..a496a112 --- /dev/null +++ b/Classes/ShareKit/UI/SHKShareMenu.m @@ -0,0 +1,325 @@ +// +// SHKShareMenu.m +// ShareKit +// +// Created by Nathan Weiner on 6/18/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKShareMenu.h" +#import "SHK.h" +#import "SHKSharer.h" +#import "SHKCustomShareMenuCell.h" + +@implementation SHKShareMenu + +@synthesize item; +@synthesize tableData; +@synthesize exclusions; + +#pragma mark - +#pragma mark Initialization + +- (void)dealloc +{ + [item release]; + [tableData release]; + [exclusions release]; + [super dealloc]; +} + + +- (id)initWithStyle:(UITableViewStyle)style +{ + if (self = [super initWithStyle:style]) + { + self.title = SHKLocalizedString(@"Share"); + + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel + target:self + action:@selector(cancel)]; + + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:SHKLocalizedString(@"Edit") + style:UIBarButtonItemStyleBordered + target:self + action:@selector(edit)]; + + } + return self; +} + +- (void)viewDidDisappear:(BOOL)animated +{ + [super viewDidDisappear:animated]; + + // Remove the SHK view wrapper from the window + [[SHK currentHelper] viewWasDismissed]; +} + + +- (void)setItem:(SHKItem *)i +{ + [item release]; + item = [i retain]; + + [self rebuildTableDataAnimated:NO]; +} + +- (void)rebuildTableDataAnimated:(BOOL)animated +{ + self.tableView.allowsSelectionDuringEditing = YES; + self.tableData = [NSMutableArray arrayWithCapacity:0]; + [tableData addObject:[self section:@"actions"]]; + [tableData addObject:[self section:@"services"]]; + + // Handling Excluded items + // If in editing mode, show them + // If not editing, hide them + self.exclusions = [[[[NSUserDefaults standardUserDefaults] objectForKey:@"SHKExcluded"] mutableCopy] autorelease]; + + if (exclusions == nil) + self.exclusions = [NSMutableDictionary dictionaryWithCapacity:0]; + + NSMutableArray *excluded = [NSMutableArray arrayWithCapacity:0]; + + if (!self.tableView.editing || animated) + { + int s = 0; + int r = 0; + + // Use temp objects so we can mutate as we are enumerating + NSMutableArray *sectionCopy; + NSMutableDictionary *tableDataCopy = [[tableData mutableCopy] autorelease]; + NSMutableIndexSet *indexes = [[NSMutableIndexSet alloc] init]; + + for(NSMutableArray *section in tableDataCopy) + { + r = 0; + [indexes removeAllIndexes]; + + sectionCopy = [[section mutableCopy] autorelease]; + + for (NSMutableDictionary *row in section) + { + if ([exclusions objectForKey:[row objectForKey:@"className"]]) + { + [excluded addObject:[NSIndexPath indexPathForRow:r inSection:s]]; + + if (!self.tableView.editing) + [indexes addIndex:r]; + } + + r++; + } + + if (!self.tableView.editing) + { + [sectionCopy removeObjectsAtIndexes:indexes]; + [tableData replaceObjectAtIndex:s withObject:sectionCopy]; + } + + s++; + } + + [indexes release]; + + if (animated) + { + [self.tableView beginUpdates]; + + if (!self.tableView.editing) + [self.tableView deleteRowsAtIndexPaths:excluded withRowAnimation:UITableViewRowAnimationFade]; + else + [self.tableView insertRowsAtIndexPaths:excluded withRowAnimation:UITableViewRowAnimationFade]; + + [self.tableView endUpdates]; + } + } + +} + +- (NSMutableArray *)section:(NSString *)section +{ + id class; + NSMutableArray *sectionData = [NSMutableArray arrayWithCapacity:0]; + NSArray *source = [[SHK sharersDictionary] objectForKey:section]; + + for( NSString *sharerClassName in source) + { + class = NSClassFromString(sharerClassName); + if ( [class canShare] && [class canShareType:item.shareType] ) + [sectionData addObject:[NSDictionary dictionaryWithObjectsAndKeys:sharerClassName,@"className",[class sharerTitle],@"name",nil]]; + } + + if (sectionData.count && SHKShareMenuAlphabeticalOrder) + [sectionData sortUsingDescriptors:[NSArray arrayWithObject:[[[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES selector:@selector(localizedCaseInsensitiveCompare:)] autorelease]]]; + + return sectionData; +} + +#pragma mark - +#pragma mark View lifecycle + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + + +#pragma mark - +#pragma mark Table view data source + +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView +{ + return tableData.count; +} + + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +{ + return [[tableData objectAtIndex:section] count]; +} + + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +{ + static NSString *CellIdentifier = @"Cell"; + + SHKCustomShareMenuCell *cell = (SHKCustomShareMenuCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; + if (cell == nil) + { + cell = [[[SHKCustomShareMenuCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; + cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; + } + + NSDictionary *rowData = [self rowDataAtIndexPath:indexPath]; + cell.textLabel.text = [rowData objectForKey:@"name"]; + + if (cell.editingAccessoryView == nil) + { + UISwitch *toggle = [[UISwitch alloc] initWithFrame:CGRectZero]; + toggle.userInteractionEnabled = NO; + cell.editingAccessoryView = toggle; + [toggle release]; + } + + [(UISwitch *)cell.editingAccessoryView setOn:[exclusions objectForKey:[rowData objectForKey:@"className"]] == nil]; + + return cell; +} + +- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath +{ + return UITableViewCellEditingStyleNone; +} + +- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath +{ + return NO; +} + + +#pragma mark - +#pragma mark Table view delegate + +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + NSDictionary *rowData = [self rowDataAtIndexPath:indexPath]; + + if (tableView.editing) + { + UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; + + UISwitch *toggle = (UISwitch *)[cell editingAccessoryView]; + [toggle setOn:!toggle.on animated:YES]; + + if (toggle.on) + [exclusions removeObjectForKey:[rowData objectForKey:@"className"]]; + + else + [exclusions setObject:@"1" forKey:[rowData objectForKey:@"className"]]; + + [self.tableView deselectRowAtIndexPath:indexPath animated:NO]; + } + + else + { + [NSClassFromString([rowData objectForKey:@"className"]) shareItem:item]; + + [[SHK currentHelper] hideCurrentViewControllerAnimated:YES]; + } +} + +- (NSDictionary *)rowDataAtIndexPath:(NSIndexPath *)indexPath +{ + return [[tableData objectAtIndex:indexPath.section] objectAtIndex:indexPath.row]; +} + +- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section +{ + if ([[tableData objectAtIndex:section] count]) + { + if (section == 0) + return SHKLocalizedString(@"Actions"); + + else if (section == 1) + return SHKLocalizedString(@"Services"); + } + + return nil; +} + + +#pragma mark - +#pragma mark Toolbar Buttons + +- (void)cancel +{ + [[SHK currentHelper] hideCurrentViewControllerAnimated:YES]; +} + +- (void)edit +{ + [self.tableView setEditing:YES animated:YES]; + [self rebuildTableDataAnimated:YES]; + + [self.navigationItem setRightBarButtonItem:[[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone + target:self + action:@selector(save)] autorelease] animated:YES]; +} + +- (void)save +{ + [[NSUserDefaults standardUserDefaults] setObject:exclusions forKey:@"SHKExcluded"]; + + [self.tableView setEditing:NO animated:YES]; + [self rebuildTableDataAnimated:YES]; + + [self.navigationItem setRightBarButtonItem:[[[UIBarButtonItem alloc] initWithTitle:SHKLocalizedString(@"Edit") + style:UIBarButtonItemStyleBordered + target:self + action:@selector(edit)] autorelease] animated:YES]; + +} + +@end + diff --git a/Classes/ShareKit/UI/SHKViewControllerWrapper.h b/Classes/ShareKit/UI/SHKViewControllerWrapper.h new file mode 100644 index 00000000..c672216a --- /dev/null +++ b/Classes/ShareKit/UI/SHKViewControllerWrapper.h @@ -0,0 +1,35 @@ +// +// SHKViewControllerWrapper.h +// ShareKit +// +// Created by Nathan Weiner on 6/28/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import + + +@interface SHKViewControllerWrapper : UIViewController { + +} + +@end diff --git a/Classes/ShareKit/UI/SHKViewControllerWrapper.m b/Classes/ShareKit/UI/SHKViewControllerWrapper.m new file mode 100644 index 00000000..5da50bce --- /dev/null +++ b/Classes/ShareKit/UI/SHKViewControllerWrapper.m @@ -0,0 +1,38 @@ + // +// SHKViewControllerWrapper.m +// ShareKit +// +// Created by Nathan Weiner on 6/28/10. + +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// +// + +#import "SHKViewControllerWrapper.h" + + +@implementation SHKViewControllerWrapper + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + return YES; +} + +@end diff --git a/MainWindow.xib b/MainWindow.xib new file mode 100644 index 00000000..0cac026c --- /dev/null +++ b/MainWindow.xib @@ -0,0 +1,279 @@ + + + + 800 + 10D541 + 760 + 1038.29 + 460.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 81 + + + YES + + + + YES + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + YES + + YES + + + YES + + + + YES + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + IBCocoaTouchFramework + + + + 1316 + + {320, 480} + + 1 + MSAxIDEAA + + NO + NO + + IBCocoaTouchFramework + YES + + + + IBCocoaTouchFramework + + + 256 + {0, 0} + NO + YES + YES + IBCocoaTouchFramework + + + YES + + + + IBCocoaTouchFramework + + + RootViewController + + IBCocoaTouchFramework + + + + + + + YES + + + delegate + + + + 4 + + + + window + + + + 5 + + + + navigationController + + + + 15 + + + + + YES + + 0 + + + + + + 2 + + + YES + + + + + -1 + + + File's Owner + + + 3 + + + + + -2 + + + + + 9 + + + YES + + + + + + + 11 + + + + + 13 + + + YES + + + + + + 14 + + + + + + + YES + + YES + -1.CustomClassName + -2.CustomClassName + 11.IBPluginDependency + 13.CustomClassName + 13.IBPluginDependency + 2.IBAttributePlaceholdersKey + 2.IBEditorWindowLastContentRect + 2.IBPluginDependency + 3.CustomClassName + 3.IBPluginDependency + 9.IBEditorWindowLastContentRect + 9.IBPluginDependency + + + YES + UIApplication + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + RootViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + YES + + + YES + + + {{673, 376}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + ShareKitAppDelegate + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + {{186, 376}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 15 + + + + YES + + RootViewController + UITableViewController + + IBProjectSource + Classes/RootViewController.h + + + + ShareKitAppDelegate + NSObject + + YES + + YES + navigationController + window + + + YES + UINavigationController + UIWindow + + + + IBProjectSource + Classes/ShareKitAppDelegate.h + + + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 + + + YES + ShareKit.xcodeproj + 3 + 81 + + diff --git a/README b/README index b938907e..87f0bac7 100644 --- a/README +++ b/README @@ -1,9 +1,22 @@ -The project hosted on github is for contributions and ongoing development. It should not be used in existing projects. +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. -For stable releases, please visit: -http://getsharekit.com +*** + +To download a stable release visit: +http://getsharekit.com/install -For documentation and install instructions, please visit: +Installation instructions: http://getsharekit.com/install +How to add new services: +http://getsharekit.com/add + +How to customize the look of ShareKit: +http://getsharekit.com/customize + +Full documentation: +http://getsharekit.com/docs + *** + +Follow @IdeaShower or http://getsharekit.com/blog for updates diff --git a/Resources-iPad/MainWindow-iPad.xib b/Resources-iPad/MainWindow-iPad.xib new file mode 100644 index 00000000..7497640a --- /dev/null +++ b/Resources-iPad/MainWindow-iPad.xib @@ -0,0 +1,304 @@ + + + + 1024 + 10D573 + 788 + 1038.29 + 460.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 117 + + + YES + + + YES + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + YES + + YES + + + YES + + + + YES + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + IBCocoaTouchFramework + + + + 1316 + + {320, 480} + + 1 + MSAxIDEAA + + NO + NO + + IBCocoaTouchFramework + YES + + + + + 1 + + IBCocoaTouchFramework + NO + + + 256 + {0, 0} + NO + YES + YES + IBCocoaTouchFramework + + + YES + + + IBCocoaTouchFramework + + + RootViewController + + + 1 + + IBCocoaTouchFramework + NO + + + + + + + YES + + + delegate + + + + 4 + + + + window + + + + 5 + + + + navigationController + + + + 15 + + + + + YES + + 0 + + + + + + 2 + + + YES + + + + + -1 + + + File's Owner + + + 3 + + + + + -2 + + + + + 9 + + + YES + + + + + + + 11 + + + + + 13 + + + YES + + + + + + 14 + + + + + + + YES + + YES + -1.CustomClassName + -2.CustomClassName + 11.IBPluginDependency + 13.CustomClassName + 13.IBPluginDependency + 2.IBAttributePlaceholdersKey + 2.IBEditorWindowLastContentRect + 2.IBPluginDependency + 3.CustomClassName + 3.IBPluginDependency + 9.IBEditorWindowLastContentRect + 9.IBPluginDependency + + + YES + UIApplication + UIResponder + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + RootViewController + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + YES + + + YES + + + {{673, 376}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + ShareKitAppDelegate + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + {{186, 376}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 15 + + + + YES + + RootViewController + UITableViewController + + IBProjectSource + Classes/RootViewController.h + + + + ShareKitAppDelegate + NSObject + + YES + + YES + navigationController + window + + + YES + UINavigationController + UIWindow + + + + YES + + YES + navigationController + window + + + YES + + navigationController + UINavigationController + + + window + UIWindow + + + + + IBProjectSource + Classes/ShareKitAppDelegate.h + + + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 + + + YES + ShareKit.xcodeproj + 3 + 117 + + diff --git a/RootViewController.xib b/RootViewController.xib new file mode 100644 index 00000000..de9ed051 --- /dev/null +++ b/RootViewController.xib @@ -0,0 +1,384 @@ + + + + 784 + 10D541 + 760 + 1038.29 + 460.00 + + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + 81 + + + YES + + + + YES + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + YES + + YES + + + YES + + + + YES + + IBFilesOwner + IBCocoaTouchFramework + + + IBFirstResponder + IBCocoaTouchFramework + + + + 274 + {320, 247} + + + 3 + MQA + + NO + YES + NO + IBCocoaTouchFramework + NO + 1 + 0 + YES + 44 + 22 + 22 + + + + + YES + + + view + + + + 3 + + + + dataSource + + + + 4 + + + + delegate + + + + 5 + + + + + YES + + 0 + + + + + + -1 + + + File's Owner + + + -2 + + + + + 2 + + + + + + + YES + + YES + -1.CustomClassName + -2.CustomClassName + 2.IBEditorWindowLastContentRect + 2.IBPluginDependency + + + YES + RootViewController + UIResponder + {{144, 609}, {320, 247}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + YES + + + YES + + + + + YES + + + YES + + + + 5 + + + + YES + + RootViewController + UITableViewController + + IBProjectSource + Classes/RootViewController.h + + + + + YES + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSError.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSFileManager.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueCoding.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyValueObserving.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSKeyedArchiver.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSNetServices.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSObject.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSPort.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSRunLoop.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSStream.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSThread.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURL.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSURLConnection.h + + + + NSObject + + IBFrameworkSource + Foundation.framework/Headers/NSXMLParser.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIAccessibility.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UINibLoading.h + + + + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UIResponder.h + + + + UIResponder + NSObject + + + + UIScrollView + UIView + + IBFrameworkSource + UIKit.framework/Headers/UIScrollView.h + + + + UISearchBar + UIView + + IBFrameworkSource + UIKit.framework/Headers/UISearchBar.h + + + + UISearchDisplayController + NSObject + + IBFrameworkSource + UIKit.framework/Headers/UISearchDisplayController.h + + + + UITableView + UIScrollView + + IBFrameworkSource + UIKit.framework/Headers/UITableView.h + + + + UITableViewController + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UITableViewController.h + + + + UIView + + IBFrameworkSource + UIKit.framework/Headers/UITextField.h + + + + UIView + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIView.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UINavigationController.h + + + + UIViewController + + IBFrameworkSource + UIKit.framework/Headers/UITabBarController.h + + + + UIViewController + UIResponder + + IBFrameworkSource + UIKit.framework/Headers/UIViewController.h + + + + + 0 + IBCocoaTouchFramework + + com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS + + + + com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 + + + YES + ShareKit.xcodeproj + 3 + 81 + + diff --git a/ShareKit-Info.plist b/ShareKit-Info.plist new file mode 100644 index 00000000..d5dc4bd3 --- /dev/null +++ b/ShareKit-Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.yourcompany.${PRODUCT_NAME:rfc1034identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + NSMainNibFile + MainWindow + NSMainNibFile~ipad + MainWindow-iPad + + diff --git a/ShareKit.xcodeproj/project.pbxproj b/ShareKit.xcodeproj/project.pbxproj new file mode 100755 index 00000000..adcbf90e --- /dev/null +++ b/ShareKit.xcodeproj/project.pbxproj @@ -0,0 +1,1170 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXBuildFile section */ + 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + 2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */; }; + 28AD73600D9D9599002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD735F0D9D9599002E5188 /* MainWindow.xib */; }; + 28F335F11007B36200424DE2 /* RootViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28F335F01007B36200424DE2 /* RootViewController.xib */; }; + 4312CF7C11CB33E200E61D7A /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4312CF7B11CB33E200E61D7A /* MessageUI.framework */; }; + 43150A8D11E78697008C6B68 /* SHKInstapaper.m in Sources */ = {isa = PBXBuildFile; fileRef = 43150A8C11E78697008C6B68 /* SHKInstapaper.m */; }; + 432B147C11FF4B0700291B37 /* SHKPhotoAlbum.m in Sources */ = {isa = PBXBuildFile; fileRef = 432B147B11FF4B0700291B37 /* SHKPhotoAlbum.m */; }; + 4379F2B31291AC9700D2A41E /* EDAMLimits.m in Sources */ = {isa = PBXBuildFile; fileRef = 4379F28D1291AC9700D2A41E /* EDAMLimits.m */; }; + 4379F2B41291AC9700D2A41E /* Errors.m in Sources */ = {isa = PBXBuildFile; fileRef = 4379F28F1291AC9700D2A41E /* Errors.m */; }; + 4379F2B51291AC9700D2A41E /* NoteStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 4379F2911291AC9700D2A41E /* NoteStore.m */; }; + 4379F2B61291AC9700D2A41E /* Types.m in Sources */ = {isa = PBXBuildFile; fileRef = 4379F2931291AC9700D2A41E /* Types.m */; }; + 4379F2B71291AC9700D2A41E /* UserStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 4379F2951291AC9700D2A41E /* UserStore.m */; }; + 4379F2B81291AC9700D2A41E /* TBinaryProtocol.m in Sources */ = {isa = PBXBuildFile; fileRef = 4379F2991291AC9700D2A41E /* TBinaryProtocol.m */; }; + 4379F2B91291AC9700D2A41E /* TProtocolException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4379F29C1291AC9700D2A41E /* TProtocolException.m */; }; + 4379F2BA1291AC9700D2A41E /* TProtocolUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 4379F29F1291AC9700D2A41E /* TProtocolUtil.m */; }; + 4379F2BB1291AC9700D2A41E /* TApplicationException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4379F2A11291AC9700D2A41E /* TApplicationException.m */; }; + 4379F2BC1291AC9700D2A41E /* TException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4379F2A31291AC9700D2A41E /* TException.m */; }; + 4379F2BD1291AC9700D2A41E /* THTTPClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 4379F2A81291AC9700D2A41E /* THTTPClient.m */; }; + 4379F2BE1291AC9700D2A41E /* TMemoryBuffer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4379F2AA1291AC9700D2A41E /* TMemoryBuffer.m */; }; + 4379F2BF1291AC9700D2A41E /* TTransportException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4379F2AD1291AC9700D2A41E /* TTransportException.m */; }; + 4379F2C01291AC9700D2A41E /* TSharedProcessorFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 4379F2AF1291AC9700D2A41E /* TSharedProcessorFactory.m */; }; + 4379F2C11291AC9700D2A41E /* SHKEvernote.m in Sources */ = {isa = PBXBuildFile; fileRef = 4379F2B11291AC9700D2A41E /* SHKEvernote.m */; }; + 4379F2C21291AC9700D2A41E /* SHKEvernote.md in Resources */ = {isa = PBXBuildFile; fileRef = 4379F2B21291AC9700D2A41E /* SHKEvernote.md */; }; + 4379F2EA1291AE5700D2A41E /* NSData+md5.m in Sources */ = {isa = PBXBuildFile; fileRef = 4379F2E91291AE5700D2A41E /* NSData+md5.m */; }; + 4379F3B21291C45700D2A41E /* SHKTextMessage.m in Sources */ = {isa = PBXBuildFile; fileRef = 4379F3B11291C45700D2A41E /* SHKTextMessage.m */; }; + 43A5370011DBE3B9004A1712 /* SHKOAuthSharer.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A5367511DBE3B9004A1712 /* SHKOAuthSharer.m */; }; + 43A5370111DBE3B9004A1712 /* SHKSharer.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A5367711DBE3B9004A1712 /* SHKSharer.m */; }; + 43A5370211DBE3B9004A1712 /* UIWebView+SHK.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A5367A11DBE3B9004A1712 /* UIWebView+SHK.m */; }; + 43A5370311DBE3B9004A1712 /* SFHFKeychainUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A5367E11DBE3B9004A1712 /* SFHFKeychainUtils.m */; }; + 43A5370411DBE3B9004A1712 /* NSMutableURLRequest+Parameters.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A5368211DBE3B9004A1712 /* NSMutableURLRequest+Parameters.m */; }; + 43A5370511DBE3B9004A1712 /* NSString+URLEncoding.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A5368411DBE3B9004A1712 /* NSString+URLEncoding.m */; }; + 43A5370611DBE3B9004A1712 /* NSURL+Base.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A5368611DBE3B9004A1712 /* NSURL+Base.m */; }; + 43A5370711DBE3B9004A1712 /* Base64Transcoder.c in Sources */ = {isa = PBXBuildFile; fileRef = 43A5368811DBE3B9004A1712 /* Base64Transcoder.c */; }; + 43A5370811DBE3B9004A1712 /* hmac.c in Sources */ = {isa = PBXBuildFile; fileRef = 43A5368A11DBE3B9004A1712 /* hmac.c */; }; + 43A5370911DBE3B9004A1712 /* sha1.c in Sources */ = {isa = PBXBuildFile; fileRef = 43A5368C11DBE3B9004A1712 /* sha1.c */; }; + 43A5370A11DBE3B9004A1712 /* OAAsynchronousDataFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A5368F11DBE3B9004A1712 /* OAAsynchronousDataFetcher.m */; }; + 43A5370B11DBE3B9004A1712 /* OAConsumer.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A5369111DBE3B9004A1712 /* OAConsumer.m */; }; + 43A5370C11DBE3B9004A1712 /* OADataFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A5369311DBE3B9004A1712 /* OADataFetcher.m */; }; + 43A5370D11DBE3B9004A1712 /* OAHMAC_SHA1SignatureProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A5369511DBE3B9004A1712 /* OAHMAC_SHA1SignatureProvider.m */; }; + 43A5370E11DBE3B9004A1712 /* OAMutableURLRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A5369711DBE3B9004A1712 /* OAMutableURLRequest.m */; }; + 43A5370F11DBE3B9004A1712 /* OAPlaintextSignatureProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A5369911DBE3B9004A1712 /* OAPlaintextSignatureProvider.m */; }; + 43A5371111DBE3B9004A1712 /* OARequestParameter.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A5369D11DBE3B9004A1712 /* OARequestParameter.m */; }; + 43A5371211DBE3B9004A1712 /* OAServiceTicket.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A5369F11DBE3B9004A1712 /* OAServiceTicket.m */; }; + 43A5371311DBE3B9004A1712 /* OAToken.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536A211DBE3B9004A1712 /* OAToken.m */; }; + 43A5371411DBE3B9004A1712 /* SHKRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536A511DBE3B9004A1712 /* SHKRequest.m */; }; + 43A5371511DBE3B9004A1712 /* SHK.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536A711DBE3B9004A1712 /* SHK.m */; }; + 43A5371611DBE3B9004A1712 /* SHKItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536A911DBE3B9004A1712 /* SHKItem.m */; }; + 43A5371711DBE3B9004A1712 /* SHKOfflineSharer.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536AB11DBE3B9004A1712 /* SHKOfflineSharer.m */; }; + 43A5371811DBE3B9004A1712 /* SHKSharers.plist in Resources */ = {isa = PBXBuildFile; fileRef = 43A536AC11DBE3B9004A1712 /* SHKSharers.plist */; }; + 43A5371911DBE3B9004A1712 /* SHKCustomFormController.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536AF11DBE3B9004A1712 /* SHKCustomFormController.m */; }; + 43A5371A11DBE3B9004A1712 /* SHKCustomFormFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536B111DBE3B9004A1712 /* SHKCustomFormFieldCell.m */; }; + 43A5371B11DBE3B9004A1712 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536B411DBE3B9004A1712 /* Reachability.m */; }; + 43A5371C11DBE3B9004A1712 /* SHKCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536B911DBE3B9004A1712 /* SHKCopy.m */; }; + 43A5371D11DBE3B9004A1712 /* SHKMail.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536BC11DBE3B9004A1712 /* SHKMail.m */; }; + 43A5371E11DBE3B9004A1712 /* SHKSafari.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536BF11DBE3B9004A1712 /* SHKSafari.m */; }; + 43A5371F11DBE3B9004A1712 /* SHKDelicious.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536C311DBE3B9004A1712 /* SHKDelicious.m */; }; + 43A5372011DBE3B9004A1712 /* FBConnect.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 43A536C611DBE3B9004A1712 /* FBConnect.bundle */; }; + 43A5372111DBE3B9004A1712 /* FBConnectGlobal.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536C911DBE3B9004A1712 /* FBConnectGlobal.m */; }; + 43A5372211DBE3B9004A1712 /* FBDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536CB11DBE3B9004A1712 /* FBDialog.m */; }; + 43A5372311DBE3B9004A1712 /* FBFeedDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536CD11DBE3B9004A1712 /* FBFeedDialog.m */; }; + 43A5372411DBE3B9004A1712 /* FBLoginButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536CF11DBE3B9004A1712 /* FBLoginButton.m */; }; + 43A5372511DBE3B9004A1712 /* FBLoginDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536D111DBE3B9004A1712 /* FBLoginDialog.m */; }; + 43A5372611DBE3B9004A1712 /* FBPermissionDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536D311DBE3B9004A1712 /* FBPermissionDialog.m */; }; + 43A5372711DBE3B9004A1712 /* FBRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536D511DBE3B9004A1712 /* FBRequest.m */; }; + 43A5372811DBE3B9004A1712 /* FBSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536D711DBE3B9004A1712 /* FBSession.m */; }; + 43A5372911DBE3B9004A1712 /* FBStreamDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536D911DBE3B9004A1712 /* FBStreamDialog.m */; }; + 43A5372A11DBE3B9004A1712 /* FBXMLHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536DB11DBE3B9004A1712 /* FBXMLHandler.m */; }; + 43A5372B11DBE3B9004A1712 /* SHKFacebook.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536DD11DBE3B9004A1712 /* SHKFacebook.m */; }; + 43A5372C11DBE3B9004A1712 /* SHKGoogleReader.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536E011DBE3B9004A1712 /* SHKGoogleReader.m */; }; + 43A5372D11DBE3B9004A1712 /* SHKPinboard.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536E311DBE3B9004A1712 /* SHKPinboard.m */; }; + 43A5372E11DBE3B9004A1712 /* SHKReadItLater.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536E611DBE3B9004A1712 /* SHKReadItLater.m */; }; + 43A5372F11DBE3B9004A1712 /* SHKTwitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536E911DBE3B9004A1712 /* SHKTwitter.m */; }; + 43A5373011DBE3B9004A1712 /* SHKTwitterForm.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536EB11DBE3B9004A1712 /* SHKTwitterForm.m */; }; + 43A5373111DBE3B9004A1712 /* SHKActionSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536EF11DBE3B9004A1712 /* SHKActionSheet.m */; }; + 43A5373211DBE3B9004A1712 /* SHKActivityIndicator.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536F111DBE3B9004A1712 /* SHKActivityIndicator.m */; }; + 43A5373311DBE3B9004A1712 /* SHKFormController.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536F311DBE3B9004A1712 /* SHKFormController.m */; }; + 43A5373411DBE3B9004A1712 /* SHKFormFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536F511DBE3B9004A1712 /* SHKFormFieldCell.m */; }; + 43A5373511DBE3B9004A1712 /* SHKFormFieldSettings.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536F711DBE3B9004A1712 /* SHKFormFieldSettings.m */; }; + 43A5373711DBE3B9004A1712 /* SHKOAuthView.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536FB11DBE3B9004A1712 /* SHKOAuthView.m */; }; + 43A5373811DBE3B9004A1712 /* SHKShareMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536FD11DBE3B9004A1712 /* SHKShareMenu.m */; }; + 43A5373911DBE3B9004A1712 /* SHKViewControllerWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A536FF11DBE3B9004A1712 /* SHKViewControllerWrapper.m */; }; + 43A5382811DBE480004A1712 /* example.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 43A5382611DBE480004A1712 /* example.pdf */; }; + 43A5382911DBE480004A1712 /* sanFran.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 43A5382711DBE480004A1712 /* sanFran.jpg */; }; + 43A5383611DBE493004A1712 /* ExampleShareFile.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A5382B11DBE493004A1712 /* ExampleShareFile.m */; }; + 43A5383711DBE493004A1712 /* ExampleShareImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A5382D11DBE493004A1712 /* ExampleShareImage.m */; }; + 43A5383811DBE493004A1712 /* ExampleShareLink.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A5382F11DBE493004A1712 /* ExampleShareLink.m */; }; + 43A5383911DBE493004A1712 /* ExampleShareText.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A5383111DBE493004A1712 /* ExampleShareText.m */; }; + 43A5383A11DBE493004A1712 /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A5383311DBE493004A1712 /* RootViewController.m */; }; + 43A5383B11DBE493004A1712 /* ShareKitAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A5383511DBE493004A1712 /* ShareKitAppDelegate.m */; }; + 43A53C0911DC07A9004A1712 /* SHKCustomShareMenuCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A53C0811DC07A9004A1712 /* SHKCustomShareMenuCell.m */; }; + 43A53C1211DC08B1004A1712 /* SHKCustomShareMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 43A53C1111DC08B1004A1712 /* SHKCustomShareMenu.m */; }; + 43B934B511FE682600C9D3F3 /* SHKFBStreamDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = 43B934B411FE682600C9D3F3 /* SHKFBStreamDialog.m */; }; + 43C91D1D11EB963600F31FAE /* MainWindow-iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 43C91D1C11EB963600F31FAE /* MainWindow-iPad.xib */; }; + 43C91DF511EBAE4800F31FAE /* SHKTumblr.m in Sources */ = {isa = PBXBuildFile; fileRef = 43C91DF411EBAE4800F31FAE /* SHKTumblr.m */; }; + 43D1DEF011D5CDD200550D75 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 43D1DEEF11D5CDD200550D75 /* SystemConfiguration.framework */; }; + 43EF406E11D3FFF800B1F700 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 43EF406D11D3FFF800B1F700 /* Security.framework */; }; + 43FF9C7412270E9F00ADE53C /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 43FF9C7212270E9F00ADE53C /* Localizable.strings */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 1D6058910D05DD3D006BFB54 /* ShareKit.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ShareKit.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 28A0AAE50D9B0CCF005BE974 /* ShareKit_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShareKit_Prefix.pch; sourceTree = ""; }; + 28AD735F0D9D9599002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; + 28F335F01007B36200424DE2 /* RootViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = RootViewController.xib; sourceTree = ""; }; + 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 4312CF7B11CB33E200E61D7A /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; + 43150A8B11E78697008C6B68 /* SHKInstapaper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKInstapaper.h; sourceTree = ""; }; + 43150A8C11E78697008C6B68 /* SHKInstapaper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKInstapaper.m; sourceTree = ""; }; + 432B147A11FF4B0700291B37 /* SHKPhotoAlbum.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKPhotoAlbum.h; sourceTree = ""; }; + 432B147B11FF4B0700291B37 /* SHKPhotoAlbum.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKPhotoAlbum.m; sourceTree = ""; }; + 4379F28C1291AC9700D2A41E /* EDAMLimits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EDAMLimits.h; sourceTree = ""; }; + 4379F28D1291AC9700D2A41E /* EDAMLimits.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EDAMLimits.m; sourceTree = ""; }; + 4379F28E1291AC9700D2A41E /* Errors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Errors.h; sourceTree = ""; }; + 4379F28F1291AC9700D2A41E /* Errors.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Errors.m; sourceTree = ""; }; + 4379F2901291AC9700D2A41E /* NoteStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NoteStore.h; sourceTree = ""; }; + 4379F2911291AC9700D2A41E /* NoteStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NoteStore.m; sourceTree = ""; }; + 4379F2921291AC9700D2A41E /* Types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Types.h; sourceTree = ""; }; + 4379F2931291AC9700D2A41E /* Types.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Types.m; sourceTree = ""; }; + 4379F2941291AC9700D2A41E /* UserStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserStore.h; sourceTree = ""; }; + 4379F2951291AC9700D2A41E /* UserStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserStore.m; sourceTree = ""; }; + 4379F2981291AC9700D2A41E /* TBinaryProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TBinaryProtocol.h; sourceTree = ""; }; + 4379F2991291AC9700D2A41E /* TBinaryProtocol.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TBinaryProtocol.m; sourceTree = ""; }; + 4379F29A1291AC9700D2A41E /* TProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TProtocol.h; sourceTree = ""; }; + 4379F29B1291AC9700D2A41E /* TProtocolException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TProtocolException.h; sourceTree = ""; }; + 4379F29C1291AC9700D2A41E /* TProtocolException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TProtocolException.m; sourceTree = ""; }; + 4379F29D1291AC9700D2A41E /* TProtocolFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TProtocolFactory.h; sourceTree = ""; }; + 4379F29E1291AC9700D2A41E /* TProtocolUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TProtocolUtil.h; sourceTree = ""; }; + 4379F29F1291AC9700D2A41E /* TProtocolUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TProtocolUtil.m; sourceTree = ""; }; + 4379F2A01291AC9700D2A41E /* TApplicationException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TApplicationException.h; sourceTree = ""; }; + 4379F2A11291AC9700D2A41E /* TApplicationException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TApplicationException.m; sourceTree = ""; }; + 4379F2A21291AC9700D2A41E /* TException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TException.h; sourceTree = ""; }; + 4379F2A31291AC9700D2A41E /* TException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TException.m; sourceTree = ""; }; + 4379F2A41291AC9700D2A41E /* TProcessor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TProcessor.h; sourceTree = ""; }; + 4379F2A51291AC9700D2A41E /* TProcessorFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TProcessorFactory.h; sourceTree = ""; }; + 4379F2A71291AC9700D2A41E /* THTTPClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = THTTPClient.h; sourceTree = ""; }; + 4379F2A81291AC9700D2A41E /* THTTPClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = THTTPClient.m; sourceTree = ""; }; + 4379F2A91291AC9700D2A41E /* TMemoryBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TMemoryBuffer.h; sourceTree = ""; }; + 4379F2AA1291AC9700D2A41E /* TMemoryBuffer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TMemoryBuffer.m; sourceTree = ""; }; + 4379F2AB1291AC9700D2A41E /* TTransport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TTransport.h; sourceTree = ""; }; + 4379F2AC1291AC9700D2A41E /* TTransportException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TTransportException.h; sourceTree = ""; }; + 4379F2AD1291AC9700D2A41E /* TTransportException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TTransportException.m; sourceTree = ""; }; + 4379F2AE1291AC9700D2A41E /* TSharedProcessorFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TSharedProcessorFactory.h; sourceTree = ""; }; + 4379F2AF1291AC9700D2A41E /* TSharedProcessorFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TSharedProcessorFactory.m; sourceTree = ""; }; + 4379F2B01291AC9700D2A41E /* SHKEvernote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKEvernote.h; sourceTree = ""; }; + 4379F2B11291AC9700D2A41E /* SHKEvernote.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKEvernote.m; sourceTree = ""; }; + 4379F2B21291AC9700D2A41E /* SHKEvernote.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SHKEvernote.md; sourceTree = ""; }; + 4379F2D31291ACD800D2A41E /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = Classes/ShareKit/Localization/ja.lproj/Localizable.strings; sourceTree = SOURCE_ROOT; }; + 4379F2D41291ACE600D2A41E /* eu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = eu; path = Classes/ShareKit/Localization/eu.lproj/Localizable.strings; sourceTree = SOURCE_ROOT; }; + 4379F2D51291ACF700D2A41E /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = Classes/ShareKit/Localization/nl.lproj/Localizable.strings; sourceTree = SOURCE_ROOT; }; + 4379F2D61291AD0300D2A41E /* vi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = vi; path = Classes/ShareKit/Localization/vi.lproj/Localizable.strings; sourceTree = SOURCE_ROOT; }; + 4379F2D71291AD0F00D2A41E /* zh_CN */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = zh_CN; path = Classes/ShareKit/Localization/zh_CN.lproj/Localizable.strings; sourceTree = SOURCE_ROOT; }; + 4379F2E81291AE5700D2A41E /* NSData+md5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+md5.h"; sourceTree = ""; }; + 4379F2E91291AE5700D2A41E /* NSData+md5.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+md5.m"; sourceTree = ""; }; + 4379F3251291B86500D2A41E /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = Classes/ShareKit/Localization/fr.lproj/Localizable.strings; sourceTree = SOURCE_ROOT; }; + 4379F3B01291C45700D2A41E /* SHKTextMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKTextMessage.h; sourceTree = ""; }; + 4379F3B11291C45700D2A41E /* SHKTextMessage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKTextMessage.m; sourceTree = ""; }; + 4379F3EA1291CA1700D2A41E /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = Classes/ShareKit/Localization/ko.lproj/Localizable.strings; sourceTree = SOURCE_ROOT; }; + 43A5367411DBE3B9004A1712 /* SHKOAuthSharer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKOAuthSharer.h; sourceTree = ""; }; + 43A5367511DBE3B9004A1712 /* SHKOAuthSharer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKOAuthSharer.m; sourceTree = ""; }; + 43A5367611DBE3B9004A1712 /* SHKSharer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKSharer.h; sourceTree = ""; }; + 43A5367711DBE3B9004A1712 /* SHKSharer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKSharer.m; sourceTree = ""; }; + 43A5367911DBE3B9004A1712 /* UIWebView+SHK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIWebView+SHK.h"; sourceTree = ""; }; + 43A5367A11DBE3B9004A1712 /* UIWebView+SHK.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIWebView+SHK.m"; sourceTree = ""; }; + 43A5367D11DBE3B9004A1712 /* SFHFKeychainUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SFHFKeychainUtils.h; sourceTree = ""; }; + 43A5367E11DBE3B9004A1712 /* SFHFKeychainUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SFHFKeychainUtils.m; sourceTree = ""; }; + 43A5368111DBE3B9004A1712 /* NSMutableURLRequest+Parameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableURLRequest+Parameters.h"; sourceTree = ""; }; + 43A5368211DBE3B9004A1712 /* NSMutableURLRequest+Parameters.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableURLRequest+Parameters.m"; sourceTree = ""; }; + 43A5368311DBE3B9004A1712 /* NSString+URLEncoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+URLEncoding.h"; sourceTree = ""; }; + 43A5368411DBE3B9004A1712 /* NSString+URLEncoding.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+URLEncoding.m"; sourceTree = ""; }; + 43A5368511DBE3B9004A1712 /* NSURL+Base.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURL+Base.h"; sourceTree = ""; }; + 43A5368611DBE3B9004A1712 /* NSURL+Base.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURL+Base.m"; sourceTree = ""; }; + 43A5368811DBE3B9004A1712 /* Base64Transcoder.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = Base64Transcoder.c; sourceTree = ""; }; + 43A5368911DBE3B9004A1712 /* Base64Transcoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Base64Transcoder.h; sourceTree = ""; }; + 43A5368A11DBE3B9004A1712 /* hmac.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = hmac.c; sourceTree = ""; }; + 43A5368B11DBE3B9004A1712 /* hmac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hmac.h; sourceTree = ""; }; + 43A5368C11DBE3B9004A1712 /* sha1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sha1.c; sourceTree = ""; }; + 43A5368D11DBE3B9004A1712 /* sha1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sha1.h; sourceTree = ""; }; + 43A5368E11DBE3B9004A1712 /* OAAsynchronousDataFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAAsynchronousDataFetcher.h; sourceTree = ""; }; + 43A5368F11DBE3B9004A1712 /* OAAsynchronousDataFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OAAsynchronousDataFetcher.m; sourceTree = ""; }; + 43A5369011DBE3B9004A1712 /* OAConsumer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAConsumer.h; sourceTree = ""; }; + 43A5369111DBE3B9004A1712 /* OAConsumer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OAConsumer.m; sourceTree = ""; }; + 43A5369211DBE3B9004A1712 /* OADataFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OADataFetcher.h; sourceTree = ""; }; + 43A5369311DBE3B9004A1712 /* OADataFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OADataFetcher.m; sourceTree = ""; }; + 43A5369411DBE3B9004A1712 /* OAHMAC_SHA1SignatureProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAHMAC_SHA1SignatureProvider.h; sourceTree = ""; }; + 43A5369511DBE3B9004A1712 /* OAHMAC_SHA1SignatureProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OAHMAC_SHA1SignatureProvider.m; sourceTree = ""; }; + 43A5369611DBE3B9004A1712 /* OAMutableURLRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAMutableURLRequest.h; sourceTree = ""; }; + 43A5369711DBE3B9004A1712 /* OAMutableURLRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OAMutableURLRequest.m; sourceTree = ""; }; + 43A5369811DBE3B9004A1712 /* OAPlaintextSignatureProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAPlaintextSignatureProvider.h; sourceTree = ""; }; + 43A5369911DBE3B9004A1712 /* OAPlaintextSignatureProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OAPlaintextSignatureProvider.m; sourceTree = ""; }; + 43A5369C11DBE3B9004A1712 /* OARequestParameter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OARequestParameter.h; sourceTree = ""; }; + 43A5369D11DBE3B9004A1712 /* OARequestParameter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OARequestParameter.m; sourceTree = ""; }; + 43A5369E11DBE3B9004A1712 /* OAServiceTicket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAServiceTicket.h; sourceTree = ""; }; + 43A5369F11DBE3B9004A1712 /* OAServiceTicket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OAServiceTicket.m; sourceTree = ""; }; + 43A536A011DBE3B9004A1712 /* OASignatureProviding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OASignatureProviding.h; sourceTree = ""; }; + 43A536A111DBE3B9004A1712 /* OAToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAToken.h; sourceTree = ""; }; + 43A536A211DBE3B9004A1712 /* OAToken.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OAToken.m; sourceTree = ""; }; + 43A536A311DBE3B9004A1712 /* OAuthConsumer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OAuthConsumer.h; sourceTree = ""; }; + 43A536A411DBE3B9004A1712 /* SHKRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKRequest.h; sourceTree = ""; }; + 43A536A511DBE3B9004A1712 /* SHKRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKRequest.m; sourceTree = ""; }; + 43A536A611DBE3B9004A1712 /* SHK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHK.h; sourceTree = ""; }; + 43A536A711DBE3B9004A1712 /* SHK.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHK.m; sourceTree = ""; }; + 43A536A811DBE3B9004A1712 /* SHKItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKItem.h; sourceTree = ""; }; + 43A536A911DBE3B9004A1712 /* SHKItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKItem.m; sourceTree = ""; }; + 43A536AA11DBE3B9004A1712 /* SHKOfflineSharer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKOfflineSharer.h; sourceTree = ""; }; + 43A536AB11DBE3B9004A1712 /* SHKOfflineSharer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKOfflineSharer.m; sourceTree = ""; }; + 43A536AC11DBE3B9004A1712 /* SHKSharers.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = SHKSharers.plist; sourceTree = ""; }; + 43A536AE11DBE3B9004A1712 /* SHKCustomFormController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKCustomFormController.h; sourceTree = ""; }; + 43A536AF11DBE3B9004A1712 /* SHKCustomFormController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKCustomFormController.m; sourceTree = ""; }; + 43A536B011DBE3B9004A1712 /* SHKCustomFormFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKCustomFormFieldCell.h; sourceTree = ""; }; + 43A536B111DBE3B9004A1712 /* SHKCustomFormFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKCustomFormFieldCell.m; sourceTree = ""; }; + 43A536B311DBE3B9004A1712 /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = ""; }; + 43A536B411DBE3B9004A1712 /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = ""; }; + 43A536B811DBE3B9004A1712 /* SHKCopy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKCopy.h; sourceTree = ""; }; + 43A536B911DBE3B9004A1712 /* SHKCopy.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKCopy.m; sourceTree = ""; }; + 43A536BB11DBE3B9004A1712 /* SHKMail.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKMail.h; sourceTree = ""; }; + 43A536BC11DBE3B9004A1712 /* SHKMail.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKMail.m; sourceTree = ""; }; + 43A536BE11DBE3B9004A1712 /* SHKSafari.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKSafari.h; sourceTree = ""; }; + 43A536BF11DBE3B9004A1712 /* SHKSafari.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKSafari.m; sourceTree = ""; }; + 43A536C211DBE3B9004A1712 /* SHKDelicious.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKDelicious.h; sourceTree = ""; }; + 43A536C311DBE3B9004A1712 /* SHKDelicious.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKDelicious.m; sourceTree = ""; }; + 43A536C611DBE3B9004A1712 /* FBConnect.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = FBConnect.bundle; sourceTree = ""; }; + 43A536C711DBE3B9004A1712 /* FBConnect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBConnect.h; sourceTree = ""; }; + 43A536C811DBE3B9004A1712 /* FBConnectGlobal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBConnectGlobal.h; sourceTree = ""; }; + 43A536C911DBE3B9004A1712 /* FBConnectGlobal.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBConnectGlobal.m; sourceTree = ""; }; + 43A536CA11DBE3B9004A1712 /* FBDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBDialog.h; sourceTree = ""; }; + 43A536CB11DBE3B9004A1712 /* FBDialog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBDialog.m; sourceTree = ""; }; + 43A536CC11DBE3B9004A1712 /* FBFeedDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBFeedDialog.h; sourceTree = ""; }; + 43A536CD11DBE3B9004A1712 /* FBFeedDialog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBFeedDialog.m; sourceTree = ""; }; + 43A536CE11DBE3B9004A1712 /* FBLoginButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBLoginButton.h; sourceTree = ""; }; + 43A536CF11DBE3B9004A1712 /* FBLoginButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBLoginButton.m; sourceTree = ""; }; + 43A536D011DBE3B9004A1712 /* FBLoginDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBLoginDialog.h; sourceTree = ""; }; + 43A536D111DBE3B9004A1712 /* FBLoginDialog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBLoginDialog.m; sourceTree = ""; }; + 43A536D211DBE3B9004A1712 /* FBPermissionDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBPermissionDialog.h; sourceTree = ""; }; + 43A536D311DBE3B9004A1712 /* FBPermissionDialog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBPermissionDialog.m; sourceTree = ""; }; + 43A536D411DBE3B9004A1712 /* FBRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBRequest.h; sourceTree = ""; }; + 43A536D511DBE3B9004A1712 /* FBRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBRequest.m; sourceTree = ""; }; + 43A536D611DBE3B9004A1712 /* FBSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBSession.h; sourceTree = ""; }; + 43A536D711DBE3B9004A1712 /* FBSession.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBSession.m; sourceTree = ""; }; + 43A536D811DBE3B9004A1712 /* FBStreamDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBStreamDialog.h; sourceTree = ""; }; + 43A536D911DBE3B9004A1712 /* FBStreamDialog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBStreamDialog.m; sourceTree = ""; }; + 43A536DA11DBE3B9004A1712 /* FBXMLHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FBXMLHandler.h; sourceTree = ""; }; + 43A536DB11DBE3B9004A1712 /* FBXMLHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FBXMLHandler.m; sourceTree = ""; }; + 43A536DC11DBE3B9004A1712 /* SHKFacebook.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKFacebook.h; sourceTree = ""; }; + 43A536DD11DBE3B9004A1712 /* SHKFacebook.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKFacebook.m; sourceTree = ""; }; + 43A536DF11DBE3B9004A1712 /* SHKGoogleReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKGoogleReader.h; sourceTree = ""; }; + 43A536E011DBE3B9004A1712 /* SHKGoogleReader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKGoogleReader.m; sourceTree = ""; }; + 43A536E211DBE3B9004A1712 /* SHKPinboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKPinboard.h; sourceTree = ""; }; + 43A536E311DBE3B9004A1712 /* SHKPinboard.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKPinboard.m; sourceTree = ""; }; + 43A536E511DBE3B9004A1712 /* SHKReadItLater.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKReadItLater.h; sourceTree = ""; }; + 43A536E611DBE3B9004A1712 /* SHKReadItLater.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKReadItLater.m; sourceTree = ""; }; + 43A536E811DBE3B9004A1712 /* SHKTwitter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKTwitter.h; sourceTree = ""; }; + 43A536E911DBE3B9004A1712 /* SHKTwitter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKTwitter.m; sourceTree = ""; }; + 43A536EA11DBE3B9004A1712 /* SHKTwitterForm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKTwitterForm.h; sourceTree = ""; }; + 43A536EB11DBE3B9004A1712 /* SHKTwitterForm.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKTwitterForm.m; sourceTree = ""; }; + 43A536EC11DBE3B9004A1712 /* SHKConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKConfig.h; sourceTree = ""; }; + 43A536EE11DBE3B9004A1712 /* SHKActionSheet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKActionSheet.h; sourceTree = ""; }; + 43A536EF11DBE3B9004A1712 /* SHKActionSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKActionSheet.m; sourceTree = ""; }; + 43A536F011DBE3B9004A1712 /* SHKActivityIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKActivityIndicator.h; sourceTree = ""; }; + 43A536F111DBE3B9004A1712 /* SHKActivityIndicator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKActivityIndicator.m; sourceTree = ""; }; + 43A536F211DBE3B9004A1712 /* SHKFormController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKFormController.h; sourceTree = ""; }; + 43A536F311DBE3B9004A1712 /* SHKFormController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKFormController.m; sourceTree = ""; }; + 43A536F411DBE3B9004A1712 /* SHKFormFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKFormFieldCell.h; sourceTree = ""; }; + 43A536F511DBE3B9004A1712 /* SHKFormFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKFormFieldCell.m; sourceTree = ""; }; + 43A536F611DBE3B9004A1712 /* SHKFormFieldSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKFormFieldSettings.h; sourceTree = ""; }; + 43A536F711DBE3B9004A1712 /* SHKFormFieldSettings.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKFormFieldSettings.m; sourceTree = ""; }; + 43A536FA11DBE3B9004A1712 /* SHKOAuthView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKOAuthView.h; sourceTree = ""; }; + 43A536FB11DBE3B9004A1712 /* SHKOAuthView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKOAuthView.m; sourceTree = ""; }; + 43A536FC11DBE3B9004A1712 /* SHKShareMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKShareMenu.h; sourceTree = ""; }; + 43A536FD11DBE3B9004A1712 /* SHKShareMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKShareMenu.m; sourceTree = ""; }; + 43A536FE11DBE3B9004A1712 /* SHKViewControllerWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKViewControllerWrapper.h; sourceTree = ""; }; + 43A536FF11DBE3B9004A1712 /* SHKViewControllerWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKViewControllerWrapper.m; sourceTree = ""; }; + 43A5382611DBE480004A1712 /* example.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = example.pdf; path = Classes/Example/example.pdf; sourceTree = ""; }; + 43A5382711DBE480004A1712 /* sanFran.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = sanFran.jpg; path = Classes/Example/sanFran.jpg; sourceTree = ""; }; + 43A5382A11DBE493004A1712 /* ExampleShareFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExampleShareFile.h; path = Example/ExampleShareFile.h; sourceTree = ""; }; + 43A5382B11DBE493004A1712 /* ExampleShareFile.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ExampleShareFile.m; path = Example/ExampleShareFile.m; sourceTree = ""; }; + 43A5382C11DBE493004A1712 /* ExampleShareImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExampleShareImage.h; path = Example/ExampleShareImage.h; sourceTree = ""; }; + 43A5382D11DBE493004A1712 /* ExampleShareImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ExampleShareImage.m; path = Example/ExampleShareImage.m; sourceTree = ""; }; + 43A5382E11DBE493004A1712 /* ExampleShareLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExampleShareLink.h; path = Example/ExampleShareLink.h; sourceTree = ""; }; + 43A5382F11DBE493004A1712 /* ExampleShareLink.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ExampleShareLink.m; path = Example/ExampleShareLink.m; sourceTree = ""; }; + 43A5383011DBE493004A1712 /* ExampleShareText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExampleShareText.h; path = Example/ExampleShareText.h; sourceTree = ""; }; + 43A5383111DBE493004A1712 /* ExampleShareText.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ExampleShareText.m; path = Example/ExampleShareText.m; sourceTree = ""; }; + 43A5383211DBE493004A1712 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RootViewController.h; path = Example/RootViewController.h; sourceTree = ""; }; + 43A5383311DBE493004A1712 /* RootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RootViewController.m; path = Example/RootViewController.m; sourceTree = ""; }; + 43A5383411DBE493004A1712 /* ShareKitAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ShareKitAppDelegate.h; path = Example/ShareKitAppDelegate.h; sourceTree = ""; }; + 43A5383511DBE493004A1712 /* ShareKitAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ShareKitAppDelegate.m; path = Example/ShareKitAppDelegate.m; sourceTree = ""; }; + 43A53C0711DC07A9004A1712 /* SHKCustomShareMenuCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKCustomShareMenuCell.h; sourceTree = ""; }; + 43A53C0811DC07A9004A1712 /* SHKCustomShareMenuCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKCustomShareMenuCell.m; sourceTree = ""; }; + 43A53C1011DC08B1004A1712 /* SHKCustomShareMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKCustomShareMenu.h; sourceTree = ""; }; + 43A53C1111DC08B1004A1712 /* SHKCustomShareMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKCustomShareMenu.m; sourceTree = ""; }; + 43B934B311FE682600C9D3F3 /* SHKFBStreamDialog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKFBStreamDialog.h; sourceTree = ""; }; + 43B934B411FE682600C9D3F3 /* SHKFBStreamDialog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKFBStreamDialog.m; sourceTree = ""; }; + 43C91D1C11EB963600F31FAE /* MainWindow-iPad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = "MainWindow-iPad.xib"; path = "Resources-iPad/MainWindow-iPad.xib"; sourceTree = ""; }; + 43C91DF311EBAE4800F31FAE /* SHKTumblr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHKTumblr.h; sourceTree = ""; }; + 43C91DF411EBAE4800F31FAE /* SHKTumblr.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHKTumblr.m; sourceTree = ""; }; + 43D1DEEF11D5CDD200550D75 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; + 43EF406D11D3FFF800B1F700 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; + 43FF9C7312270E9F00ADE53C /* en */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = en; path = Classes/ShareKit/Localization/en.lproj/Localizable.strings; sourceTree = SOURCE_ROOT; }; + 43FF9C7512270EB900ADE53C /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = Classes/ShareKit/Localization/de.lproj/Localizable.strings; sourceTree = SOURCE_ROOT; }; + 8D1107310486CEB800E47090 /* ShareKit-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "ShareKit-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, + 2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */, + 4312CF7C11CB33E200E61D7A /* MessageUI.framework in Frameworks */, + 43EF406E11D3FFF800B1F700 /* Security.framework in Frameworks */, + 43D1DEF011D5CDD200550D75 /* SystemConfiguration.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 080E96DDFE201D6D7F000001 /* Classes */ = { + isa = PBXGroup; + children = ( + 43A5367111DBE3B9004A1712 /* ShareKit */, + 4362EB3311B9937300E3DB3A /* Example Project */, + ); + path = Classes; + sourceTree = ""; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 1D6058910D05DD3D006BFB54 /* ShareKit.app */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { + isa = PBXGroup; + children = ( + 080E96DDFE201D6D7F000001 /* Classes */, + 29B97315FDCFA39411CA2CEA /* Other Sources */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 43C91D1B11EB963600F31FAE /* Resources-iPad */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = CustomTemplate; + sourceTree = ""; + }; + 29B97315FDCFA39411CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + 28A0AAE50D9B0CCF005BE974 /* ShareKit_Prefix.pch */, + 29B97316FDCFA39411CA2CEA /* main.m */, + ); + name = "Other Sources"; + sourceTree = ""; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + 43A5382611DBE480004A1712 /* example.pdf */, + 43A5382711DBE480004A1712 /* sanFran.jpg */, + 28F335F01007B36200424DE2 /* RootViewController.xib */, + 28AD735F0D9D9599002E5188 /* MainWindow.xib */, + 8D1107310486CEB800E47090 /* ShareKit-Info.plist */, + ); + name = Resources; + sourceTree = ""; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, + 1D30AB110D05D00D00671497 /* Foundation.framework */, + 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */, + 4312CF7B11CB33E200E61D7A /* MessageUI.framework */, + 43EF406D11D3FFF800B1F700 /* Security.framework */, + 43D1DEEF11D5CDD200550D75 /* SystemConfiguration.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 43150A8A11E78697008C6B68 /* Instapaper */ = { + isa = PBXGroup; + children = ( + 43150A8B11E78697008C6B68 /* SHKInstapaper.h */, + 43150A8C11E78697008C6B68 /* SHKInstapaper.m */, + ); + path = Instapaper; + sourceTree = ""; + }; + 432B147911FF4B0700291B37 /* Save to Album */ = { + isa = PBXGroup; + children = ( + 432B147A11FF4B0700291B37 /* SHKPhotoAlbum.h */, + 432B147B11FF4B0700291B37 /* SHKPhotoAlbum.m */, + ); + path = "Save to Album"; + sourceTree = ""; + }; + 4362EB3311B9937300E3DB3A /* Example Project */ = { + isa = PBXGroup; + children = ( + 43A5382A11DBE493004A1712 /* ExampleShareFile.h */, + 43A5382B11DBE493004A1712 /* ExampleShareFile.m */, + 43A5382C11DBE493004A1712 /* ExampleShareImage.h */, + 43A5382D11DBE493004A1712 /* ExampleShareImage.m */, + 43A5382E11DBE493004A1712 /* ExampleShareLink.h */, + 43A5382F11DBE493004A1712 /* ExampleShareLink.m */, + 43A5383011DBE493004A1712 /* ExampleShareText.h */, + 43A5383111DBE493004A1712 /* ExampleShareText.m */, + 43A5383211DBE493004A1712 /* RootViewController.h */, + 43A5383311DBE493004A1712 /* RootViewController.m */, + 43A5383411DBE493004A1712 /* ShareKitAppDelegate.h */, + 43A5383511DBE493004A1712 /* ShareKitAppDelegate.m */, + ); + name = "Example Project"; + sourceTree = ""; + }; + 4379F2891291AC9700D2A41E /* Evernote */ = { + isa = PBXGroup; + children = ( + 4379F28A1291AC9700D2A41E /* Helpers */, + 4379F2B01291AC9700D2A41E /* SHKEvernote.h */, + 4379F2B11291AC9700D2A41E /* SHKEvernote.m */, + 4379F2B21291AC9700D2A41E /* SHKEvernote.md */, + ); + path = Evernote; + sourceTree = ""; + }; + 4379F28A1291AC9700D2A41E /* Helpers */ = { + isa = PBXGroup; + children = ( + 4379F28B1291AC9700D2A41E /* edam */, + 4379F2961291AC9700D2A41E /* thrift */, + ); + path = Helpers; + sourceTree = ""; + }; + 4379F28B1291AC9700D2A41E /* edam */ = { + isa = PBXGroup; + children = ( + 4379F28C1291AC9700D2A41E /* EDAMLimits.h */, + 4379F28D1291AC9700D2A41E /* EDAMLimits.m */, + 4379F28E1291AC9700D2A41E /* Errors.h */, + 4379F28F1291AC9700D2A41E /* Errors.m */, + 4379F2901291AC9700D2A41E /* NoteStore.h */, + 4379F2911291AC9700D2A41E /* NoteStore.m */, + 4379F2921291AC9700D2A41E /* Types.h */, + 4379F2931291AC9700D2A41E /* Types.m */, + 4379F2941291AC9700D2A41E /* UserStore.h */, + 4379F2951291AC9700D2A41E /* UserStore.m */, + ); + path = edam; + sourceTree = ""; + }; + 4379F2961291AC9700D2A41E /* thrift */ = { + isa = PBXGroup; + children = ( + 4379F2971291AC9700D2A41E /* protocol */, + 4379F2A01291AC9700D2A41E /* TApplicationException.h */, + 4379F2A11291AC9700D2A41E /* TApplicationException.m */, + 4379F2A21291AC9700D2A41E /* TException.h */, + 4379F2A31291AC9700D2A41E /* TException.m */, + 4379F2A41291AC9700D2A41E /* TProcessor.h */, + 4379F2A51291AC9700D2A41E /* TProcessorFactory.h */, + 4379F2A61291AC9700D2A41E /* transport */, + 4379F2AE1291AC9700D2A41E /* TSharedProcessorFactory.h */, + 4379F2AF1291AC9700D2A41E /* TSharedProcessorFactory.m */, + ); + path = thrift; + sourceTree = ""; + }; + 4379F2971291AC9700D2A41E /* protocol */ = { + isa = PBXGroup; + children = ( + 4379F2981291AC9700D2A41E /* TBinaryProtocol.h */, + 4379F2991291AC9700D2A41E /* TBinaryProtocol.m */, + 4379F29A1291AC9700D2A41E /* TProtocol.h */, + 4379F29B1291AC9700D2A41E /* TProtocolException.h */, + 4379F29C1291AC9700D2A41E /* TProtocolException.m */, + 4379F29D1291AC9700D2A41E /* TProtocolFactory.h */, + 4379F29E1291AC9700D2A41E /* TProtocolUtil.h */, + 4379F29F1291AC9700D2A41E /* TProtocolUtil.m */, + ); + path = protocol; + sourceTree = ""; + }; + 4379F2A61291AC9700D2A41E /* transport */ = { + isa = PBXGroup; + children = ( + 4379F2A71291AC9700D2A41E /* THTTPClient.h */, + 4379F2A81291AC9700D2A41E /* THTTPClient.m */, + 4379F2A91291AC9700D2A41E /* TMemoryBuffer.h */, + 4379F2AA1291AC9700D2A41E /* TMemoryBuffer.m */, + 4379F2AB1291AC9700D2A41E /* TTransport.h */, + 4379F2AC1291AC9700D2A41E /* TTransportException.h */, + 4379F2AD1291AC9700D2A41E /* TTransportException.m */, + ); + path = transport; + sourceTree = ""; + }; + 4379F3AF1291C45700D2A41E /* Text Message */ = { + isa = PBXGroup; + children = ( + 4379F3B01291C45700D2A41E /* SHKTextMessage.h */, + 4379F3B11291C45700D2A41E /* SHKTextMessage.m */, + ); + path = "Text Message"; + sourceTree = ""; + }; + 43A5367111DBE3B9004A1712 /* ShareKit */ = { + isa = PBXGroup; + children = ( + 43A536EC11DBE3B9004A1712 /* SHKConfig.h */, + 43A536AD11DBE3B9004A1712 /* Customize UI */, + 43A5367211DBE3B9004A1712 /* Core */, + 43A536B511DBE3B9004A1712 /* Sharers */, + 43A536ED11DBE3B9004A1712 /* UI */, + 43A536B211DBE3B9004A1712 /* Reachability */, + ); + path = ShareKit; + sourceTree = ""; + }; + 43A5367211DBE3B9004A1712 /* Core */ = { + isa = PBXGroup; + children = ( + 43A536AC11DBE3B9004A1712 /* SHKSharers.plist */, + 43A536A611DBE3B9004A1712 /* SHK.h */, + 43A536A711DBE3B9004A1712 /* SHK.m */, + 43A536A811DBE3B9004A1712 /* SHKItem.h */, + 43A536A911DBE3B9004A1712 /* SHKItem.m */, + 43A536AA11DBE3B9004A1712 /* SHKOfflineSharer.h */, + 43A536AB11DBE3B9004A1712 /* SHKOfflineSharer.m */, + 43A5367311DBE3B9004A1712 /* Base Sharer Classes */, + 43A5367811DBE3B9004A1712 /* Categories */, + 43A5367B11DBE3B9004A1712 /* Helpers */, + 43FF9C7112270E7F00ADE53C /* Localization */, + ); + path = Core; + sourceTree = ""; + }; + 43A5367311DBE3B9004A1712 /* Base Sharer Classes */ = { + isa = PBXGroup; + children = ( + 43A5367411DBE3B9004A1712 /* SHKOAuthSharer.h */, + 43A5367511DBE3B9004A1712 /* SHKOAuthSharer.m */, + 43A5367611DBE3B9004A1712 /* SHKSharer.h */, + 43A5367711DBE3B9004A1712 /* SHKSharer.m */, + ); + path = "Base Sharer Classes"; + sourceTree = ""; + }; + 43A5367811DBE3B9004A1712 /* Categories */ = { + isa = PBXGroup; + children = ( + 4379F2E81291AE5700D2A41E /* NSData+md5.h */, + 4379F2E91291AE5700D2A41E /* NSData+md5.m */, + 43A5367911DBE3B9004A1712 /* UIWebView+SHK.h */, + 43A5367A11DBE3B9004A1712 /* UIWebView+SHK.m */, + ); + path = Categories; + sourceTree = ""; + }; + 43A5367B11DBE3B9004A1712 /* Helpers */ = { + isa = PBXGroup; + children = ( + 43A5367C11DBE3B9004A1712 /* Keychain */, + 43A5367F11DBE3B9004A1712 /* OAuth */, + 43A536A411DBE3B9004A1712 /* SHKRequest.h */, + 43A536A511DBE3B9004A1712 /* SHKRequest.m */, + ); + path = Helpers; + sourceTree = ""; + }; + 43A5367C11DBE3B9004A1712 /* Keychain */ = { + isa = PBXGroup; + children = ( + 43A5367D11DBE3B9004A1712 /* SFHFKeychainUtils.h */, + 43A5367E11DBE3B9004A1712 /* SFHFKeychainUtils.m */, + ); + path = Keychain; + sourceTree = ""; + }; + 43A5367F11DBE3B9004A1712 /* OAuth */ = { + isa = PBXGroup; + children = ( + 43A5368011DBE3B9004A1712 /* Categories */, + 43A5368711DBE3B9004A1712 /* Crytpo */, + 43A5368E11DBE3B9004A1712 /* OAAsynchronousDataFetcher.h */, + 43A5368F11DBE3B9004A1712 /* OAAsynchronousDataFetcher.m */, + 43A5369011DBE3B9004A1712 /* OAConsumer.h */, + 43A5369111DBE3B9004A1712 /* OAConsumer.m */, + 43A5369211DBE3B9004A1712 /* OADataFetcher.h */, + 43A5369311DBE3B9004A1712 /* OADataFetcher.m */, + 43A5369411DBE3B9004A1712 /* OAHMAC_SHA1SignatureProvider.h */, + 43A5369511DBE3B9004A1712 /* OAHMAC_SHA1SignatureProvider.m */, + 43A5369611DBE3B9004A1712 /* OAMutableURLRequest.h */, + 43A5369711DBE3B9004A1712 /* OAMutableURLRequest.m */, + 43A5369811DBE3B9004A1712 /* OAPlaintextSignatureProvider.h */, + 43A5369911DBE3B9004A1712 /* OAPlaintextSignatureProvider.m */, + 43A5369C11DBE3B9004A1712 /* OARequestParameter.h */, + 43A5369D11DBE3B9004A1712 /* OARequestParameter.m */, + 43A5369E11DBE3B9004A1712 /* OAServiceTicket.h */, + 43A5369F11DBE3B9004A1712 /* OAServiceTicket.m */, + 43A536A011DBE3B9004A1712 /* OASignatureProviding.h */, + 43A536A111DBE3B9004A1712 /* OAToken.h */, + 43A536A211DBE3B9004A1712 /* OAToken.m */, + 43A536A311DBE3B9004A1712 /* OAuthConsumer.h */, + ); + path = OAuth; + sourceTree = ""; + }; + 43A5368011DBE3B9004A1712 /* Categories */ = { + isa = PBXGroup; + children = ( + 43A5368111DBE3B9004A1712 /* NSMutableURLRequest+Parameters.h */, + 43A5368211DBE3B9004A1712 /* NSMutableURLRequest+Parameters.m */, + 43A5368311DBE3B9004A1712 /* NSString+URLEncoding.h */, + 43A5368411DBE3B9004A1712 /* NSString+URLEncoding.m */, + 43A5368511DBE3B9004A1712 /* NSURL+Base.h */, + 43A5368611DBE3B9004A1712 /* NSURL+Base.m */, + ); + path = Categories; + sourceTree = ""; + }; + 43A5368711DBE3B9004A1712 /* Crytpo */ = { + isa = PBXGroup; + children = ( + 43A5368811DBE3B9004A1712 /* Base64Transcoder.c */, + 43A5368911DBE3B9004A1712 /* Base64Transcoder.h */, + 43A5368A11DBE3B9004A1712 /* hmac.c */, + 43A5368B11DBE3B9004A1712 /* hmac.h */, + 43A5368C11DBE3B9004A1712 /* sha1.c */, + 43A5368D11DBE3B9004A1712 /* sha1.h */, + ); + path = Crytpo; + sourceTree = ""; + }; + 43A536AD11DBE3B9004A1712 /* Customize UI */ = { + isa = PBXGroup; + children = ( + 43A53C0B11DC0835004A1712 /* Form */, + 43A53C0A11DC080C004A1712 /* Share Menu */, + ); + path = "Customize UI"; + sourceTree = ""; + }; + 43A536B211DBE3B9004A1712 /* Reachability */ = { + isa = PBXGroup; + children = ( + 43A536B311DBE3B9004A1712 /* Reachability.h */, + 43A536B411DBE3B9004A1712 /* Reachability.m */, + ); + path = Reachability; + sourceTree = ""; + }; + 43A536B511DBE3B9004A1712 /* Sharers */ = { + isa = PBXGroup; + children = ( + 43A536B611DBE3B9004A1712 /* Actions */, + 43A536C011DBE3B9004A1712 /* Services */, + ); + path = Sharers; + sourceTree = ""; + }; + 43A536B611DBE3B9004A1712 /* Actions */ = { + isa = PBXGroup; + children = ( + 43A536B711DBE3B9004A1712 /* Copy */, + 43A536BA11DBE3B9004A1712 /* Email */, + 43A536BD11DBE3B9004A1712 /* Open in Safari */, + 432B147911FF4B0700291B37 /* Save to Album */, + 4379F3AF1291C45700D2A41E /* Text Message */, + ); + path = Actions; + sourceTree = ""; + }; + 43A536B711DBE3B9004A1712 /* Copy */ = { + isa = PBXGroup; + children = ( + 43A536B811DBE3B9004A1712 /* SHKCopy.h */, + 43A536B911DBE3B9004A1712 /* SHKCopy.m */, + ); + path = Copy; + sourceTree = ""; + }; + 43A536BA11DBE3B9004A1712 /* Email */ = { + isa = PBXGroup; + children = ( + 43A536BB11DBE3B9004A1712 /* SHKMail.h */, + 43A536BC11DBE3B9004A1712 /* SHKMail.m */, + ); + path = Email; + sourceTree = ""; + }; + 43A536BD11DBE3B9004A1712 /* Open in Safari */ = { + isa = PBXGroup; + children = ( + 43A536BE11DBE3B9004A1712 /* SHKSafari.h */, + 43A536BF11DBE3B9004A1712 /* SHKSafari.m */, + ); + path = "Open in Safari"; + sourceTree = ""; + }; + 43A536C011DBE3B9004A1712 /* Services */ = { + isa = PBXGroup; + children = ( + 43A536C111DBE3B9004A1712 /* Delicious */, + 4379F2891291AC9700D2A41E /* Evernote */, + 43A536C411DBE3B9004A1712 /* Facebook */, + 43A536DE11DBE3B9004A1712 /* Google Reader */, + 43150A8A11E78697008C6B68 /* Instapaper */, + 43A536E111DBE3B9004A1712 /* Pinboard */, + 43A536E411DBE3B9004A1712 /* Read It Later */, + 43C91DF211EBAE4800F31FAE /* Tumblr */, + 43A536E711DBE3B9004A1712 /* Twitter */, + ); + path = Services; + sourceTree = ""; + }; + 43A536C111DBE3B9004A1712 /* Delicious */ = { + isa = PBXGroup; + children = ( + 43A536C211DBE3B9004A1712 /* SHKDelicious.h */, + 43A536C311DBE3B9004A1712 /* SHKDelicious.m */, + ); + path = Delicious; + sourceTree = ""; + }; + 43A536C411DBE3B9004A1712 /* Facebook */ = { + isa = PBXGroup; + children = ( + 43A536C511DBE3B9004A1712 /* FBConnect */, + 43A536DC11DBE3B9004A1712 /* SHKFacebook.h */, + 43A536DD11DBE3B9004A1712 /* SHKFacebook.m */, + 43B934B311FE682600C9D3F3 /* SHKFBStreamDialog.h */, + 43B934B411FE682600C9D3F3 /* SHKFBStreamDialog.m */, + ); + path = Facebook; + sourceTree = ""; + }; + 43A536C511DBE3B9004A1712 /* FBConnect */ = { + isa = PBXGroup; + children = ( + 43A536C611DBE3B9004A1712 /* FBConnect.bundle */, + 43A536C711DBE3B9004A1712 /* FBConnect.h */, + 43A536C811DBE3B9004A1712 /* FBConnectGlobal.h */, + 43A536C911DBE3B9004A1712 /* FBConnectGlobal.m */, + 43A536CA11DBE3B9004A1712 /* FBDialog.h */, + 43A536CB11DBE3B9004A1712 /* FBDialog.m */, + 43A536CC11DBE3B9004A1712 /* FBFeedDialog.h */, + 43A536CD11DBE3B9004A1712 /* FBFeedDialog.m */, + 43A536CE11DBE3B9004A1712 /* FBLoginButton.h */, + 43A536CF11DBE3B9004A1712 /* FBLoginButton.m */, + 43A536D011DBE3B9004A1712 /* FBLoginDialog.h */, + 43A536D111DBE3B9004A1712 /* FBLoginDialog.m */, + 43A536D211DBE3B9004A1712 /* FBPermissionDialog.h */, + 43A536D311DBE3B9004A1712 /* FBPermissionDialog.m */, + 43A536D411DBE3B9004A1712 /* FBRequest.h */, + 43A536D511DBE3B9004A1712 /* FBRequest.m */, + 43A536D611DBE3B9004A1712 /* FBSession.h */, + 43A536D711DBE3B9004A1712 /* FBSession.m */, + 43A536D811DBE3B9004A1712 /* FBStreamDialog.h */, + 43A536D911DBE3B9004A1712 /* FBStreamDialog.m */, + 43A536DA11DBE3B9004A1712 /* FBXMLHandler.h */, + 43A536DB11DBE3B9004A1712 /* FBXMLHandler.m */, + ); + path = FBConnect; + sourceTree = ""; + }; + 43A536DE11DBE3B9004A1712 /* Google Reader */ = { + isa = PBXGroup; + children = ( + 43A536DF11DBE3B9004A1712 /* SHKGoogleReader.h */, + 43A536E011DBE3B9004A1712 /* SHKGoogleReader.m */, + ); + path = "Google Reader"; + sourceTree = ""; + }; + 43A536E111DBE3B9004A1712 /* Pinboard */ = { + isa = PBXGroup; + children = ( + 43A536E211DBE3B9004A1712 /* SHKPinboard.h */, + 43A536E311DBE3B9004A1712 /* SHKPinboard.m */, + ); + path = Pinboard; + sourceTree = ""; + }; + 43A536E411DBE3B9004A1712 /* Read It Later */ = { + isa = PBXGroup; + children = ( + 43A536E511DBE3B9004A1712 /* SHKReadItLater.h */, + 43A536E611DBE3B9004A1712 /* SHKReadItLater.m */, + ); + path = "Read It Later"; + sourceTree = ""; + }; + 43A536E711DBE3B9004A1712 /* Twitter */ = { + isa = PBXGroup; + children = ( + 43A536E811DBE3B9004A1712 /* SHKTwitter.h */, + 43A536E911DBE3B9004A1712 /* SHKTwitter.m */, + 43A536EA11DBE3B9004A1712 /* SHKTwitterForm.h */, + 43A536EB11DBE3B9004A1712 /* SHKTwitterForm.m */, + ); + path = Twitter; + sourceTree = ""; + }; + 43A536ED11DBE3B9004A1712 /* UI */ = { + isa = PBXGroup; + children = ( + 43A536EE11DBE3B9004A1712 /* SHKActionSheet.h */, + 43A536EF11DBE3B9004A1712 /* SHKActionSheet.m */, + 43A536F011DBE3B9004A1712 /* SHKActivityIndicator.h */, + 43A536F111DBE3B9004A1712 /* SHKActivityIndicator.m */, + 43A536F211DBE3B9004A1712 /* SHKFormController.h */, + 43A536F311DBE3B9004A1712 /* SHKFormController.m */, + 43A536F411DBE3B9004A1712 /* SHKFormFieldCell.h */, + 43A536F511DBE3B9004A1712 /* SHKFormFieldCell.m */, + 43A536F611DBE3B9004A1712 /* SHKFormFieldSettings.h */, + 43A536F711DBE3B9004A1712 /* SHKFormFieldSettings.m */, + 43A536FC11DBE3B9004A1712 /* SHKShareMenu.h */, + 43A536FD11DBE3B9004A1712 /* SHKShareMenu.m */, + 43A536FA11DBE3B9004A1712 /* SHKOAuthView.h */, + 43A536FB11DBE3B9004A1712 /* SHKOAuthView.m */, + 43A536FE11DBE3B9004A1712 /* SHKViewControllerWrapper.h */, + 43A536FF11DBE3B9004A1712 /* SHKViewControllerWrapper.m */, + ); + path = UI; + sourceTree = ""; + }; + 43A53C0A11DC080C004A1712 /* Share Menu */ = { + isa = PBXGroup; + children = ( + 43A53C1011DC08B1004A1712 /* SHKCustomShareMenu.h */, + 43A53C1111DC08B1004A1712 /* SHKCustomShareMenu.m */, + 43A53C0711DC07A9004A1712 /* SHKCustomShareMenuCell.h */, + 43A53C0811DC07A9004A1712 /* SHKCustomShareMenuCell.m */, + ); + name = "Share Menu"; + sourceTree = ""; + }; + 43A53C0B11DC0835004A1712 /* Form */ = { + isa = PBXGroup; + children = ( + 43A536AE11DBE3B9004A1712 /* SHKCustomFormController.h */, + 43A536AF11DBE3B9004A1712 /* SHKCustomFormController.m */, + 43A536B011DBE3B9004A1712 /* SHKCustomFormFieldCell.h */, + 43A536B111DBE3B9004A1712 /* SHKCustomFormFieldCell.m */, + ); + name = Form; + sourceTree = ""; + }; + 43C91D1B11EB963600F31FAE /* Resources-iPad */ = { + isa = PBXGroup; + children = ( + 43C91D1C11EB963600F31FAE /* MainWindow-iPad.xib */, + ); + name = "Resources-iPad"; + sourceTree = ""; + }; + 43C91DF211EBAE4800F31FAE /* Tumblr */ = { + isa = PBXGroup; + children = ( + 43C91DF311EBAE4800F31FAE /* SHKTumblr.h */, + 43C91DF411EBAE4800F31FAE /* SHKTumblr.m */, + ); + path = Tumblr; + sourceTree = ""; + }; + 43FF9C7112270E7F00ADE53C /* Localization */ = { + isa = PBXGroup; + children = ( + 43FF9C7212270E9F00ADE53C /* Localizable.strings */, + ); + name = Localization; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 1D6058900D05DD3D006BFB54 /* ShareKit */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "ShareKit" */; + buildPhases = ( + 1D60588D0D05DD3D006BFB54 /* Resources */, + 1D60588E0D05DD3D006BFB54 /* Sources */, + 1D60588F0D05DD3D006BFB54 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ShareKit; + productName = ShareKit; + productReference = 1D6058910D05DD3D006BFB54 /* ShareKit.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ShareKit" */; + compatibilityVersion = "Xcode 3.1"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + en, + de, + ja, + nl, + vi, + zh_CN, + eu, + fr, + ko, + ); + mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 1D6058900D05DD3D006BFB54 /* ShareKit */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 1D60588D0D05DD3D006BFB54 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 28AD73600D9D9599002E5188 /* MainWindow.xib in Resources */, + 28F335F11007B36200424DE2 /* RootViewController.xib in Resources */, + 43A5371811DBE3B9004A1712 /* SHKSharers.plist in Resources */, + 43A5372011DBE3B9004A1712 /* FBConnect.bundle in Resources */, + 43A5382811DBE480004A1712 /* example.pdf in Resources */, + 43A5382911DBE480004A1712 /* sanFran.jpg in Resources */, + 43C91D1D11EB963600F31FAE /* MainWindow-iPad.xib in Resources */, + 43FF9C7412270E9F00ADE53C /* Localizable.strings in Resources */, + 4379F2C21291AC9700D2A41E /* SHKEvernote.md in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 1D60588E0D05DD3D006BFB54 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1D60589B0D05DD56006BFB54 /* main.m in Sources */, + 43A5370011DBE3B9004A1712 /* SHKOAuthSharer.m in Sources */, + 43A5370111DBE3B9004A1712 /* SHKSharer.m in Sources */, + 43A5370211DBE3B9004A1712 /* UIWebView+SHK.m in Sources */, + 43A5370311DBE3B9004A1712 /* SFHFKeychainUtils.m in Sources */, + 43A5370411DBE3B9004A1712 /* NSMutableURLRequest+Parameters.m in Sources */, + 43A5370511DBE3B9004A1712 /* NSString+URLEncoding.m in Sources */, + 43A5370611DBE3B9004A1712 /* NSURL+Base.m in Sources */, + 43A5370711DBE3B9004A1712 /* Base64Transcoder.c in Sources */, + 43A5370811DBE3B9004A1712 /* hmac.c in Sources */, + 43A5370911DBE3B9004A1712 /* sha1.c in Sources */, + 43A5370A11DBE3B9004A1712 /* OAAsynchronousDataFetcher.m in Sources */, + 43A5370B11DBE3B9004A1712 /* OAConsumer.m in Sources */, + 43A5370C11DBE3B9004A1712 /* OADataFetcher.m in Sources */, + 43A5370D11DBE3B9004A1712 /* OAHMAC_SHA1SignatureProvider.m in Sources */, + 43A5370E11DBE3B9004A1712 /* OAMutableURLRequest.m in Sources */, + 43A5370F11DBE3B9004A1712 /* OAPlaintextSignatureProvider.m in Sources */, + 43A5371111DBE3B9004A1712 /* OARequestParameter.m in Sources */, + 43A5371211DBE3B9004A1712 /* OAServiceTicket.m in Sources */, + 43A5371311DBE3B9004A1712 /* OAToken.m in Sources */, + 43A5371411DBE3B9004A1712 /* SHKRequest.m in Sources */, + 43A5371511DBE3B9004A1712 /* SHK.m in Sources */, + 43A5371611DBE3B9004A1712 /* SHKItem.m in Sources */, + 43A5371711DBE3B9004A1712 /* SHKOfflineSharer.m in Sources */, + 43A5371911DBE3B9004A1712 /* SHKCustomFormController.m in Sources */, + 43A5371A11DBE3B9004A1712 /* SHKCustomFormFieldCell.m in Sources */, + 43A5371B11DBE3B9004A1712 /* Reachability.m in Sources */, + 43A5371C11DBE3B9004A1712 /* SHKCopy.m in Sources */, + 43A5371D11DBE3B9004A1712 /* SHKMail.m in Sources */, + 43A5371E11DBE3B9004A1712 /* SHKSafari.m in Sources */, + 43A5371F11DBE3B9004A1712 /* SHKDelicious.m in Sources */, + 43A5372111DBE3B9004A1712 /* FBConnectGlobal.m in Sources */, + 43A5372211DBE3B9004A1712 /* FBDialog.m in Sources */, + 43A5372311DBE3B9004A1712 /* FBFeedDialog.m in Sources */, + 43A5372411DBE3B9004A1712 /* FBLoginButton.m in Sources */, + 43A5372511DBE3B9004A1712 /* FBLoginDialog.m in Sources */, + 43A5372611DBE3B9004A1712 /* FBPermissionDialog.m in Sources */, + 43A5372711DBE3B9004A1712 /* FBRequest.m in Sources */, + 43A5372811DBE3B9004A1712 /* FBSession.m in Sources */, + 43A5372911DBE3B9004A1712 /* FBStreamDialog.m in Sources */, + 43A5372A11DBE3B9004A1712 /* FBXMLHandler.m in Sources */, + 43A5372B11DBE3B9004A1712 /* SHKFacebook.m in Sources */, + 43A5372C11DBE3B9004A1712 /* SHKGoogleReader.m in Sources */, + 43A5372D11DBE3B9004A1712 /* SHKPinboard.m in Sources */, + 43A5372E11DBE3B9004A1712 /* SHKReadItLater.m in Sources */, + 43A5372F11DBE3B9004A1712 /* SHKTwitter.m in Sources */, + 43A5373011DBE3B9004A1712 /* SHKTwitterForm.m in Sources */, + 43A5373111DBE3B9004A1712 /* SHKActionSheet.m in Sources */, + 43A5373211DBE3B9004A1712 /* SHKActivityIndicator.m in Sources */, + 43A5373311DBE3B9004A1712 /* SHKFormController.m in Sources */, + 43A5373411DBE3B9004A1712 /* SHKFormFieldCell.m in Sources */, + 43A5373511DBE3B9004A1712 /* SHKFormFieldSettings.m in Sources */, + 43A5373711DBE3B9004A1712 /* SHKOAuthView.m in Sources */, + 43A5373811DBE3B9004A1712 /* SHKShareMenu.m in Sources */, + 43A5373911DBE3B9004A1712 /* SHKViewControllerWrapper.m in Sources */, + 43A5383611DBE493004A1712 /* ExampleShareFile.m in Sources */, + 43A5383711DBE493004A1712 /* ExampleShareImage.m in Sources */, + 43A5383811DBE493004A1712 /* ExampleShareLink.m in Sources */, + 43A5383911DBE493004A1712 /* ExampleShareText.m in Sources */, + 43A5383A11DBE493004A1712 /* RootViewController.m in Sources */, + 43A5383B11DBE493004A1712 /* ShareKitAppDelegate.m in Sources */, + 43A53C0911DC07A9004A1712 /* SHKCustomShareMenuCell.m in Sources */, + 43A53C1211DC08B1004A1712 /* SHKCustomShareMenu.m in Sources */, + 43150A8D11E78697008C6B68 /* SHKInstapaper.m in Sources */, + 43C91DF511EBAE4800F31FAE /* SHKTumblr.m in Sources */, + 43B934B511FE682600C9D3F3 /* SHKFBStreamDialog.m in Sources */, + 432B147C11FF4B0700291B37 /* SHKPhotoAlbum.m in Sources */, + 4379F2B31291AC9700D2A41E /* EDAMLimits.m in Sources */, + 4379F2B41291AC9700D2A41E /* Errors.m in Sources */, + 4379F2B51291AC9700D2A41E /* NoteStore.m in Sources */, + 4379F2B61291AC9700D2A41E /* Types.m in Sources */, + 4379F2B71291AC9700D2A41E /* UserStore.m in Sources */, + 4379F2B81291AC9700D2A41E /* TBinaryProtocol.m in Sources */, + 4379F2B91291AC9700D2A41E /* TProtocolException.m in Sources */, + 4379F2BA1291AC9700D2A41E /* TProtocolUtil.m in Sources */, + 4379F2BB1291AC9700D2A41E /* TApplicationException.m in Sources */, + 4379F2BC1291AC9700D2A41E /* TException.m in Sources */, + 4379F2BD1291AC9700D2A41E /* THTTPClient.m in Sources */, + 4379F2BE1291AC9700D2A41E /* TMemoryBuffer.m in Sources */, + 4379F2BF1291AC9700D2A41E /* TTransportException.m in Sources */, + 4379F2C01291AC9700D2A41E /* TSharedProcessorFactory.m in Sources */, + 4379F2C11291AC9700D2A41E /* SHKEvernote.m in Sources */, + 4379F2EA1291AE5700D2A41E /* NSData+md5.m in Sources */, + 4379F3B21291C45700D2A41E /* SHKTextMessage.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 43FF9C7212270E9F00ADE53C /* Localizable.strings */ = { + isa = PBXVariantGroup; + children = ( + 43FF9C7312270E9F00ADE53C /* en */, + 43FF9C7512270EB900ADE53C /* de */, + 4379F2D31291ACD800D2A41E /* ja */, + 4379F2D41291ACE600D2A41E /* eu */, + 4379F2D51291ACF700D2A41E /* nl */, + 4379F2D61291AD0300D2A41E /* vi */, + 4379F2D71291AD0F00D2A41E /* zh_CN */, + 4379F3251291B86500D2A41E /* fr */, + 4379F3EA1291CA1700D2A41E /* ko */, + ); + name = Localizable.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 1D6058940D05DD3E006BFB54 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ShareKit_Prefix.pch; + INFOPLIST_FILE = "ShareKit-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 3.2; + PRODUCT_NAME = ShareKit; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 1D6058950D05DD3E006BFB54 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + COPY_PHASE_STRIP = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ShareKit_Prefix.pch; + INFOPLIST_FILE = "ShareKit-Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 3.2; + PRODUCT_NAME = ShareKit; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 3.1; + PREBINDING = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 3.1; + OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + PREBINDING = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "ShareKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1D6058940D05DD3E006BFB54 /* Debug */, + 1D6058950D05DD3E006BFB54 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ShareKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/ShareKit_Prefix.pch b/ShareKit_Prefix.pch new file mode 100644 index 00000000..b3c02d5f --- /dev/null +++ b/ShareKit_Prefix.pch @@ -0,0 +1,14 @@ +// +// Prefix header for all source files of the 'ShareKit' target in the 'ShareKit' project +// +#import + +#ifndef __IPHONE_3_0 +#warning "This project uses features only available in iPhone SDK 3.0 and later." +#endif + + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/main.m b/main.m new file mode 100644 index 00000000..4018ee81 --- /dev/null +++ b/main.m @@ -0,0 +1,17 @@ +// +// main.m +// ShareKit +// +// Created by Nathan Weiner on 6/4/10. +// Copyright Idea Shower, LLC 2010. All rights reserved. +// + +#import + +int main(int argc, char *argv[]) { + + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + int retVal = UIApplicationMain(argc, argv, nil, nil); + [pool release]; + return retVal; +}