diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2015-11-01 22:52:24 +0100 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2015-11-01 22:59:04 +0100 |
commit | 6d9124de6fac2dea39427978993e68155291cc9c (patch) | |
tree | 9813ad0adc206412817447ee73b59f0d11f93053 /desktop/source | |
parent | 3d34594138c42ec4b253a25c403ef9346265a28f (diff) |
android: update JNI facade, rename mouse/keyboard event flags
Change-Id: Ia2b9a812717d05c7d98d47bf0fe5fd293029d045
Diffstat (limited to 'desktop/source')
-rw-r--r-- | desktop/source/lib/lokandroid.cxx | 50 |
1 files changed, 46 insertions, 4 deletions
diff --git a/desktop/source/lib/lokandroid.cxx b/desktop/source/lib/lokandroid.cxx index 6142f5ab9885..9d7ce6ea5b53 100644 --- a/desktop/source/lib/lokandroid.cxx +++ b/desktop/source/lib/lokandroid.cxx @@ -183,6 +183,14 @@ extern "C" SAL_JNI_EXPORT jint JNICALL Java_org_libreoffice_kit_Document_getPart return (jint) pDocument->pClass->getPart(pDocument); } +extern "C" SAL_JNI_EXPORT jstring JNICALL Java_org_libreoffice_kit_Document_getPartPageRectangles + (JNIEnv* pEnv, jobject aObject) +{ + LibreOfficeKitDocument* pDocument = getHandle<LibreOfficeKitDocument>(pEnv, aObject); + char* pRectangles = pDocument->pClass->getPartPageRectangles(pDocument); + return pEnv->NewStringUTF(pRectangles); +} + extern "C" SAL_JNI_EXPORT jint JNICALL Java_org_libreoffice_kit_Document_getParts (JNIEnv* pEnv, jobject aObject) { @@ -277,22 +285,27 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Document_postKey } extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Document_postMouseEvent - (JNIEnv* pEnv, jobject aObject, jint type, jint x, jint y, jint count) + (JNIEnv* pEnv, jobject aObject, jint type, jint x, jint y, jint count, jint button, jint modifier) { LibreOfficeKitDocument* pDocument = getHandle<LibreOfficeKitDocument>(pEnv, aObject); - pDocument->pClass->postMouseEvent(pDocument, type, x, y, count, MOUSE_LEFT, 0); + pDocument->pClass->postMouseEvent(pDocument, type, x, y, count, button, modifier); } extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Document_postUnoCommand - (JNIEnv* pEnv, jobject aObject, jstring command) + (JNIEnv* pEnv, jobject aObject, jstring command, jstring arguments) { LibreOfficeKitDocument* pDocument = getHandle<LibreOfficeKitDocument>(pEnv, aObject); const char* pCommand = pEnv->GetStringUTFChars(command, NULL); + const char* pArguments = nullptr; + if (arguments != NULL) + pArguments = pEnv->GetStringUTFChars(arguments, NULL); - pDocument->pClass->postUnoCommand(pDocument, pCommand, 0); + pDocument->pClass->postUnoCommand(pDocument, pCommand, pArguments); pEnv->ReleaseStringUTFChars(command, pCommand); + if (arguments != NULL) + pEnv->ReleaseStringUTFChars(arguments, pArguments); } extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Document_setTextSelection @@ -302,6 +315,22 @@ 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 jstring JNICALL Java_org_libreoffice_kit_Document_getTextSelection + (JNIEnv* pEnv, jobject aObject, jstring mimeType) +{ + LibreOfficeKitDocument* pDocument = getHandle<LibreOfficeKitDocument>(pEnv, aObject); + + const char* pMimeType = pEnv->GetStringUTFChars(mimeType, NULL); + + char* pUsedMimeType = 0; + char* pSelection = pDocument->pClass->getTextSelection(pDocument, pMimeType, &pUsedMimeType); + free(pUsedMimeType); + + pEnv->ReleaseStringUTFChars(mimeType, pMimeType); + + return pEnv->NewStringUTF(pSelection); +} + extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Document_setGraphicSelection (JNIEnv* pEnv, jobject aObject, jint type, jint x, jint y) { @@ -316,4 +345,17 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Document_resetSe pDocument->pClass->resetSelection(pDocument); } +extern "C" SAL_JNI_EXPORT jstring JNICALL Java_org_libreoffice_kit_Document_getCommandValues + (JNIEnv* pEnv, jobject aObject, jstring command) +{ + LibreOfficeKitDocument* pDocument = getHandle<LibreOfficeKitDocument>(pEnv, aObject); + + const char* pCommand = pEnv->GetStringUTFChars(command, NULL); + + char* pValue = pDocument->pClass->getCommandValues(pDocument, pCommand); + + pEnv->ReleaseStringUTFChars(command, pCommand); + + return pEnv->NewStringUTF(pValue); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |