Permalink
Browse files

first commit

  • Loading branch information...
Timstarockz committed Jul 29, 2011
0 parents commit f33d7a9e9553f6216ef1050050edde11c701517e
Showing with 6,638 additions and 0 deletions.
  1. BIN .DS_Store
  2. +23 −0 Classes/Google_Translate_APIAppDelegate.h
  3. +124 −0 Classes/Google_Translate_APIAppDelegate.m
  4. +264 −0 Google Translate API.xcodeproj/project.pbxproj
  5. +6 −0 Google Translate API.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  6. +2,844 −0 ...e API.xcodeproj/project.xcworkspace/xcuserdata/timothy5216.xcuserdatad/WorkspaceState.xcuserstate
  7. +1,402 −0 Google Translate API.xcodeproj/timothy5216.mode1v3
  8. +196 −0 Google Translate API.xcodeproj/timothy5216.pbxuser
  9. +24 −0 ...ranslate API.xcodeproj/xcuserdata/timothy5216.xcuserdatad/xcschemes/Google Translate API.xcscheme
  10. +19 −0 Google Translate API.xcodeproj/xcuserdata/timothy5216.xcuserdatad/xcschemes/xcschememanagement.plist
  11. +60 −0 GoogleTranslateAPI/GoogleTranslateAPI.h
  12. +155 −0 GoogleTranslateAPI/GoogleTranslateAPI.m
  13. +30 −0 Google_Translate_API-Info.plist
  14. +8 −0 Google_Translate_API_Prefix.pch
  15. +674 −0 MainWindow.xib
  16. +18 −0 build/Debug-iphonesimulator/Google Translate API.app.dSYM/Contents/Info.plist
  17. BIN ...Debug-iphonesimulator/Google Translate API.app.dSYM/Contents/Resources/DWARF/Google Translate API
  18. BIN build/Debug-iphonesimulator/Google Translate API.app/Google Translate API
  19. BIN build/Debug-iphonesimulator/Google Translate API.app/Info.plist
  20. BIN build/Debug-iphonesimulator/Google Translate API.app/MainWindow.nib
  21. +1 −0 build/Debug-iphonesimulator/Google Translate API.app/PkgInfo
  22. +19 −0 build/Google Translate API.build/Debug-iphoneos/Google Translate API.build/Google Translate API.dep
  23. +243 −0 build/Google Translate API.build/Debug-iphoneos/Google Translate API.build/build-state.dat
  24. BIN ...ild/Debug-iphonesimulator/Google Translate API.build/Google Translate API-all-target-headers.hmap
  25. BIN ....build/Debug-iphonesimulator/Google Translate API.build/Google Translate API-generated-files.hmap
  26. BIN ...ild/Debug-iphonesimulator/Google Translate API.build/Google Translate API-own-target-headers.hmap
  27. BIN ....build/Debug-iphonesimulator/Google Translate API.build/Google Translate API-project-headers.hmap
  28. +11 −0 ...gle Translate API.build/Debug-iphonesimulator/Google Translate API.build/Google Translate API.dep
  29. BIN ...le Translate API.build/Debug-iphonesimulator/Google Translate API.build/Google Translate API.hmap
  30. +10 −0 ...le Translate API.build/Debug-iphonesimulator/Google Translate API.build/Google Translate API~.dep
  31. +3 −0 ...-iphonesimulator/Google Translate API.build/Objects-normal/i386/Google Translate API.LinkFileList
  32. BIN ...I.build/Debug-iphonesimulator/Google Translate API.build/Objects-normal/i386/GoogleTranslateAPI.o
  33. BIN ...-iphonesimulator/Google Translate API.build/Objects-normal/i386/Google_Translate_APIAppDelegate.o
  34. BIN ...e Translate API.build/Debug-iphonesimulator/Google Translate API.build/Objects-normal/i386/main.o
  35. +246 −0 build/Google Translate API.build/Debug-iphonesimulator/Google Translate API.build/build-state.dat
  36. +241 −0 build/Google Translate API.build/Debug-iphonesimulator/Google Translate API.build/build-state~.dat
  37. BIN build/Google Translate API.build/Google Translate API.pbxindex/categories.pbxbtree
  38. BIN build/Google Translate API.build/Google Translate API.pbxindex/cdecls.pbxbtree
  39. BIN build/Google Translate API.build/Google Translate API.pbxindex/decls.pbxbtree
  40. BIN build/Google Translate API.build/Google Translate API.pbxindex/files.pbxbtree
  41. BIN build/Google Translate API.build/Google Translate API.pbxindex/imports.pbxbtree
  42. BIN build/Google Translate API.build/Google Translate API.pbxindex/pbxindex.header
  43. BIN build/Google Translate API.build/Google Translate API.pbxindex/protocols.pbxbtree
  44. BIN build/Google Translate API.build/Google Translate API.pbxindex/refs.pbxbtree
  45. BIN build/Google Translate API.build/Google Translate API.pbxindex/strings.pbxstrings/control
  46. BIN build/Google Translate API.build/Google Translate API.pbxindex/strings.pbxstrings/strings
  47. BIN build/Google Translate API.build/Google Translate API.pbxindex/subclasses.pbxbtree
  48. BIN build/Google Translate API.build/Google Translate API.pbxindex/symbols0.pbxsymbols
  49. +17 −0 main.m
BIN .DS_Store
Binary file not shown.
@@ -0,0 +1,23 @@
+//
+// Google_Translate_APIAppDelegate.h
+// Google Translate API
+//
+// Created by Tim Desir on 9/9/10.
+// Copyright 2010 Timstarockz LLC. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+#import "GoogleTranslateAPI.h"
+
+@interface Google_Translate_APIAppDelegate : NSObject <UIApplicationDelegate, GoogleTranslateDelegate> {
+ UIWindow *window;
+
+ GoogleTranslateAPI *api;
+
+ IBOutlet UITextView *textView;
+}
+- (IBAction)translateText;
+
+@property (nonatomic, retain) IBOutlet UIWindow *window;
+@end
+
@@ -0,0 +1,124 @@
+//
+// Google_Translate_APIAppDelegate.m
+// Google Translate API
+//
+// Created by Tim Desir on 9/9/10.
+// Copyright 2010 Timstarockz LLC. All rights reserved.
+//
+
+#import "Google_Translate_APIAppDelegate.h"
+
+@implementation Google_Translate_APIAppDelegate
+
+@synthesize window;
+
+#pragma mark -
+#pragma mark Application lifecycle
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
+ [textView becomeFirstResponder];
+
+ api = [[GoogleTranslateAPI alloc] init];
+ api.delegate = self;
+
+ [window makeKeyAndVisible];
+
+ return YES;
+}
+
+- (IBAction)translateText;
+{
+ [api translate:textView.text];
+}
+
+#pragma mark -
+#pragma mark GoogleTranslateAPI
+- (void)google:(GoogleTranslateAPI *)google didTranslate:(NSString *)translatedText;
+{
+ UIAlertView *alert = [[UIAlertView alloc]
+ initWithTitle:@"Translation"
+ message:translatedText
+ delegate:self cancelButtonTitle:@"Close"
+ otherButtonTitles:@"Use",nil];
+ alert.tag = 9000;
+ [alert show];
+ [alert release];
+}
+
+- (void)googleDidFail:(GoogleTranslateAPI *)fail;
+{
+ UIAlertView *alert = [[UIAlertView alloc]
+ initWithTitle:@"Error"
+ message:@"lawl fail"
+ delegate:nil cancelButtonTitle:@"Awww"
+ otherButtonTitles:@"kay :(",nil];
+ [alert show];
+ [alert release];
+}
+#pragma mark -
+
+#pragma mark -
+#pragma mark UIAlertViewDelegate
+- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex;
+{
+ if (alertView.tag = 9000) {
+ if (buttonIndex == 1) {
+ [textView setText:alertView.message];
+ }
+ }
+}
+#pragma mark -
+
+- (void)applicationWillResignActive:(UIApplication *)application {
+ /*
+ Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+ Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
+ */
+}
+
+
+- (void)applicationDidEnterBackground:(UIApplication *)application {
+ /*
+ Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
+ If your application supports background execution, called instead of applicationWillTerminate: when the user quits.
+ */
+}
+
+
+- (void)applicationWillEnterForeground:(UIApplication *)application {
+ /*
+ Called as part of transition from the background to the inactive state: here you can undo many of the changes made on entering the background.
+ */
+}
+
+
+- (void)applicationDidBecomeActive:(UIApplication *)application {
+ /*
+ Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+ */
+}
+
+
+- (void)applicationWillTerminate:(UIApplication *)application {
+ /*
+ Called when the application is about to terminate.
+ See also applicationDidEnterBackground:.
+ */
+}
+
+
+#pragma mark -
+#pragma mark Memory management
+
+- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
+ /*
+ Free up as much memory as possible by purging cached data objects that can be recreated (or reloaded from disk) later.
+ */
+}
+
+- (void)dealloc {
+ [window release];
+ [super dealloc];
+}
+
+@end
Oops, something went wrong.

0 comments on commit f33d7a9

Please sign in to comment.