summaryrefslogtreecommitdiff
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
parent80004068611191107c0f44cc5d3b29181b1ad157 (diff)
Start implementing on-demand keyboard display for non-DESKTOP
Change-Id: I9321dcf9d863cb59eee9b2a012d887a17cb1b454
-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
-rw-r--r--sw/source/core/crsr/crsrsh.cxx10
-rw-r--r--vcl/android/androidinst.cxx20
5 files changed, 66 insertions, 4 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:
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index d5999cd591b0..fe0e61fdca37 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <config_features.h>
+
#include <com/sun/star/util/SearchOptions.hpp>
#include <com/sun/star/text/XTextRange.hpp>
#include <hintids.hxx>
@@ -62,6 +64,8 @@
#include <comcore.hrc>
+#include <touch/touch.h>
+
using namespace com::sun::star;
using namespace util;
@@ -2000,6 +2004,9 @@ void SwCrsrShell::ShowCrsr()
{
m_bSVCrsrVis = sal_True;
UpdateCrsr();
+#if !HAVE_FEATURE_DESKTOP
+ lo_show_keyboard();
+#endif
}
}
@@ -2012,6 +2019,9 @@ void SwCrsrShell::HideCrsr()
// possibly reverse selected areas!!
SET_CURR_SHELL( this );
m_pVisCrsr->Hide();
+#if !HAVE_FEATURE_DESKTOP
+ lo_hide_keyboard();
+#endif
}
}
diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx
index cd0390b146c1..563769cb5b10 100644
--- a/vcl/android/androidinst.cxx
+++ b/vcl/android/androidinst.cxx
@@ -26,16 +26,20 @@
* in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
* instead of those above.
*/
-#include <android/androidinst.hxx>
-#include <headless/svpdummies.hxx>
-#include <generic/gendata.hxx>
+
#include <jni.h>
+
#include <android/log.h>
#include <android/looper.h>
#include <android/bitmap.h>
+
+#include <android/androidinst.hxx>
+#include <headless/svpdummies.hxx>
+#include <generic/gendata.hxx>
#include <osl/detail/android-bootstrap.h>
#include <rtl/strbuf.hxx>
#include <basebmp/scanlineformats.hxx>
+#include <touch/touch.h>
#define LOGTAG "LibreOffice/androidinst"
#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, LOGTAG, __VA_ARGS__))
@@ -554,4 +558,14 @@ Java_org_libreoffice_experimental_desktop_Desktop_scroll(JNIEnv * /* env */,
LOGW("No focused frame to emit event on");
}
+extern "C" void
+lo_show_keyboard()
+{
+}
+
+extern "C" void
+lo_hide_keyboard()
+{
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */