summaryrefslogtreecommitdiff
path: root/ios
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-04-12 15:06:03 +0300
committerTor Lillqvist <tml@iki.fi>2013-04-12 15:22:10 +0300
commita6e1f214c9c8c338da7cd216884e45e234e64669 (patch)
tree8c2f59039d7e6d71042eda883b0dcae0a0c576eb /ios
parent80004068611191107c0f44cc5d3b29181b1ad157 (diff)
Start implementing on-demand keyboard display for non-DESKTOP
Change-Id: I9321dcf9d863cb59eee9b2a012d887a17cb1b454
Diffstat (limited to 'ios')
-rw-r--r--ios/experimental/LibreOffice/LibreOffice/AppDelegate.m15
-rw-r--r--ios/experimental/LibreOffice/LibreOffice/View.h2
-rw-r--r--ios/experimental/LibreOffice/LibreOffice/View.m23
3 files changed, 39 insertions, 1 deletions
diff --git a/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m b/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m
index 2f74d483fb63..3a70fa3572b4 100644
--- a/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m
+++ b/ios/experimental/LibreOffice/LibreOffice/AppDelegate.m
@@ -9,6 +9,7 @@
#import <UIKit/UIKit.h>
#include <osl/detail/ios-bootstrap.h>
+#include <touch/touch.h>
#import "AppDelegate.h"
#import "ViewController.h"
@@ -100,4 +101,18 @@ void lo_damaged(CGRect rect)
// NSLog(@"lo_damaged: %dx%d@(%d,%d)", (int)rect.size.width, (int)rect.size.height, (int)rect.origin.x, (int)rect.origin.y);
}
+void lo_show_keyboard()
+{
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [theView becomeFirstResponder];
+ });
+}
+
+void lo_hide_keyboard()
+{
+ dispatch_async(dispatch_get_main_queue(), ^{
+ [theView resignFirstResponder];
+ });
+}
+
// vim:set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/ios/experimental/LibreOffice/LibreOffice/View.h b/ios/experimental/LibreOffice/LibreOffice/View.h
index c128806409f4..a50b8f3e0d9b 100644
--- a/ios/experimental/LibreOffice/LibreOffice/View.h
+++ b/ios/experimental/LibreOffice/LibreOffice/View.h
@@ -9,7 +9,7 @@
#import <UIKit/UIKit.h>
-@interface View : UIView
+@interface View : UIView <UIKeyInput>
- (void)drawRect:(CGRect)rect;
- (void)tapGesture:(UIGestureRecognizer *)gestureRecognizer;
diff --git a/ios/experimental/LibreOffice/LibreOffice/View.m b/ios/experimental/LibreOffice/LibreOffice/View.m
index abc057e8327e..43edc2f62c93 100644
--- a/ios/experimental/LibreOffice/LibreOffice/View.m
+++ b/ios/experimental/LibreOffice/LibreOffice/View.m
@@ -38,6 +38,29 @@
NSLog(@"tapGesture: %@", gestureRecognizer);
}
+- (void)insertText:(NSString *)text
+{
+ (void) text;
+ // Do something with the typed character
+}
+
+- (void)deleteBackward
+{
+ // Handle the delete key
+}
+
+- (BOOL)hasText
+{
+ // Return whether there's any text present
+ return YES;
+}
+
+- (BOOL)canBecomeFirstResponder
+{
+ return YES;
+}
+
+
@end
// vim:set shiftwidth=4 softtabstop=4 expandtab: