diff options
-rw-r--r-- | android/Bootstrap/src/org/libreoffice/kit/Document.java | 21 | ||||
-rw-r--r-- | desktop/source/lib/lokandroid.cxx | 14 |
2 files changed, 34 insertions, 1 deletions
diff --git a/android/Bootstrap/src/org/libreoffice/kit/Document.java b/android/Bootstrap/src/org/libreoffice/kit/Document.java index 9ebfdfc7a7c4..0e0dd594cf58 100644 --- a/android/Bootstrap/src/org/libreoffice/kit/Document.java +++ b/android/Bootstrap/src/org/libreoffice/kit/Document.java @@ -50,6 +50,12 @@ public class Document { public static final int SET_TEXT_SELECTION_END = 1; public static final int SET_TEXT_SELECTION_RESET = 2; + /** + * Set graphic selection types + */ + public static final int SET_GRAPHIC_SELECTION_START = 0; + public static final int SET_GRAPHIC_SELECTION_END = 1; + private final ByteBuffer handle; private MessageCallback messageCallback = null; @@ -127,7 +133,7 @@ public class Document { public native void postMouseEvent(int type, int x, int y, int count); /** - * Change text selection + * Change text selection. * @param type - text selection type * @param x - x coordinate * @param y - y coordinate @@ -135,6 +141,19 @@ public class Document { public native void setTextSelection(int type, int x, int y); /** + * Change graphic selection. + * @param type - graphic selection type + * @param x - x coordinate + * @param y - y coordinate + */ + public native void setGraphicSelection(int type, int x, int y); + + /** + * Reset current (any kind of) selection. + */ + public native void resetSelection(); + + /** * Callback to retrieve messages from LOK */ public interface MessageCallback { diff --git a/desktop/source/lib/lokandroid.cxx b/desktop/source/lib/lokandroid.cxx index 528ffe141586..b4d0e98e0a20 100644 --- a/desktop/source/lib/lokandroid.cxx +++ b/desktop/source/lib/lokandroid.cxx @@ -291,6 +291,20 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Document_setText pDocument->pClass->setTextSelection(pDocument, type, x, y); } +extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Document_setGraphicSelection + (JNIEnv* pEnv, jobject aObject, jint type, jint x, jint y) +{ + LibreOfficeKitDocument* pDocument = getHandle<LibreOfficeKitDocument>(pEnv, aObject); + pDocument->pClass->setGraphicSelection(pDocument, type, x, y); +} + +extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Document_resetSelection + (JNIEnv* pEnv, jobject aObject) +{ + LibreOfficeKitDocument* pDocument = getHandle<LibreOfficeKitDocument>(pEnv, aObject); + pDocument->pClass->resetSelection(pDocument); +} + /* DirectBufferAllocator */ extern "C" SAL_JNI_EXPORT jobject JNICALL Java_org_libreoffice_kit_DirectBufferAllocator_allocateDirectBufferNative |