Kaydet (Commit) 1eb2de90 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Miklos Vajna

android: add support for text selection to JNI

Change-Id: Ifa307eb6a8cb031bdd88b9fadae42c8a0811772b
üst 63ae4c06
...@@ -38,6 +38,16 @@ public class Document { ...@@ -38,6 +38,16 @@ public class Document {
*/ */
public static final int CALLBACK_INVALIDATE_TILES = 0; public static final int CALLBACK_INVALIDATE_TILES = 0;
public static final int CALLBACK_INVALIDATE_VISIBLE_CURSOR = 1; public static final int CALLBACK_INVALIDATE_VISIBLE_CURSOR = 1;
public static final int CALLBACK_INVALIDATE_TEXT_SELECTION = 2;
public static final int CALLBACK_INVALIDATE_TEXT_SELECTION_START = 3;
public static final int CALLBACK_INVALIDATE_TEXT_SELECTION_END = 4;
/**
* Text selection types
*/
public static final int TEXT_SELECTION_START = 0;
public static final int TEXT_SELECTION_END = 1;
public static final int TEXT_SELECTION_RESET = 2;
private final ByteBuffer handle; private final ByteBuffer handle;
private MessageCallback messageCallback = null; private MessageCallback messageCallback = null;
...@@ -107,6 +117,14 @@ public class Document { ...@@ -107,6 +117,14 @@ public class Document {
*/ */
public native void postMouseEvent(int type, int x, int y, int count); public native void postMouseEvent(int type, int x, int y, int count);
/**
* Change text selection
* @param type - text selection type
* @param x - x coordinate
* @param y - y coordinate
*/
public native void setTextSelection(int type, int x, int y);
/** /**
* Callback to retrieve messages from LOK * Callback to retrieve messages from LOK
*/ */
......
...@@ -284,6 +284,13 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Document_postMou ...@@ -284,6 +284,13 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Document_postMou
pDocument->pClass->postMouseEvent(pDocument, type, x, y, count); pDocument->pClass->postMouseEvent(pDocument, type, x, y, count);
} }
extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Document_setTextSelection
(JNIEnv* pEnv, jobject aObject, jint type, jint x, jint y)
{
LibreOfficeKitDocument* pDocument = getHandle<LibreOfficeKitDocument>(pEnv, aObject);
pDocument->pClass->setTextSelection(pDocument, type, x, y);
}
/* DirectBufferAllocator */ /* DirectBufferAllocator */
extern "C" SAL_JNI_EXPORT jobject JNICALL Java_org_libreoffice_kit_DirectBufferAllocator_allocateDirectBufferNative extern "C" SAL_JNI_EXPORT jobject JNICALL Java_org_libreoffice_kit_DirectBufferAllocator_allocateDirectBufferNative
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment