Kaydet (Commit) 81f1c259 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

LOKit android: add support for setPartMode and getPartName

Change-Id: Idd8bd4d4b148e88c7badd06fefb7cfcfc24ec9ea
üst 656ab07b
......@@ -12,21 +12,35 @@ package org.libreoffice.kit;
import java.nio.ByteBuffer;
public class Document {
public static final int PART_MODE_DEFAULT = 0;
public static final int PART_MODE_SLIDE = 1;
public static final int PART_MODE_NOTES = 2;
public static final int PART_MODE_SLIDENOTES = 3;
public static final int PART_MODE_EMBEDDEDOBJ = 4;
private final long handle;
public native void setPart(int part);
public Document(long handle) {
this.handle = handle;
}
public native int getPart();
public native void setPart(int partIndex);
public native int getParts();
public native String getPartName(int partIndex);
public native void setPartMode(int partMode);
public native long getDocumentHeight();
public native long getDocumentWidth();
private native int getDocumentTypeNative();
private native void paintTileNative(ByteBuffer buffer, int canvasWidth, int canvasHeight, int tilePositionX, int tilePositionY, int tileWidth, int tileHeight);
public Document(long handle) {
this.handle = handle;
}
private native void paintTileNative(ByteBuffer buffer, int canvasWidth, int canvasHeight, int tilePositionX, int tilePositionY, int tileWidth, int tileHeight);
public int getDocumentType() {
return getDocumentTypeNative();
......
......@@ -89,6 +89,22 @@ extern "C" SAL_JNI_EXPORT jint JNICALL Java_org_libreoffice_kit_Document_getPart
return (jint) pDocument->pClass->getParts(pDocument);
}
extern "C" SAL_JNI_EXPORT jstring JNICALL Java_org_libreoffice_kit_Document_getPartName
(JNIEnv* pEnv, jobject aObject, jint nPartIndex)
{
LibreOfficeKitDocument* pDocument = getHandle<LibreOfficeKitDocument>(pEnv, aObject);
char* pPartName = pDocument->pClass->getPartName(pDocument, nPartIndex);
return pEnv->NewStringUTF(pPartName);
}
extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Document_setPartMode
(JNIEnv* pEnv, jobject aObject, jint nPartMode)
{
LibreOfficeKitDocument* pDocument = getHandle<LibreOfficeKitDocument>(pEnv, aObject);
pDocument->pClass->setPartMode(pDocument, (LibreOfficeKitPartMode) nPartMode);
}
extern "C" SAL_JNI_EXPORT jint JNICALL Java_org_libreoffice_kit_Document_getDocumentTypeNative
(JNIEnv* pEnv, jobject aObject)
{
......
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