1 /* 2 * Copyright (C) 2018 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef LIBTEXTCLASSIFIER_ACTIONS_ACTIONS_JNI_H_ 18 #define LIBTEXTCLASSIFIER_ACTIONS_ACTIONS_JNI_H_ 19 20 #include <jni.h> 21 #include <string> 22 #include "utils/java/jni-base.h" 23 24 #ifndef TC3_ACTIONS_CLASS_NAME 25 #define TC3_ACTIONS_CLASS_NAME ActionsSuggestionsModel 26 #endif 27 28 #define TC3_ACTIONS_CLASS_NAME_STR TC3_ADD_QUOTES(TC3_ACTIONS_CLASS_NAME) 29 30 #ifdef __cplusplus 31 extern "C" { 32 #endif 33 34 TC3_JNI_METHOD(jlong, TC3_ACTIONS_CLASS_NAME, nativeNewActionsModel) 35 (JNIEnv* env, jobject thiz, jint fd, jbyteArray serialized_preconditions); 36 37 TC3_JNI_METHOD(jlong, TC3_ACTIONS_CLASS_NAME, nativeNewActionsModelFromPath) 38 (JNIEnv* env, jobject thiz, jstring path, jbyteArray serialized_preconditions); 39 40 TC3_JNI_METHOD(jobjectArray, TC3_ACTIONS_CLASS_NAME, nativeSuggestActions) 41 (JNIEnv* env, jobject thiz, jlong ptr, jobject jconversation, jobject joptions, 42 jlong annotatorPtr, jobject app_context, jstring device_locales, 43 jboolean generate_intents); 44 45 TC3_JNI_METHOD(void, TC3_ACTIONS_CLASS_NAME, nativeCloseActionsModel) 46 (JNIEnv* env, jobject thiz, jlong ptr); 47 48 TC3_JNI_METHOD(jstring, TC3_ACTIONS_CLASS_NAME, nativeGetLocales) 49 (JNIEnv* env, jobject clazz, jint fd); 50 51 TC3_JNI_METHOD(jstring, TC3_ACTIONS_CLASS_NAME, nativeGetName) 52 (JNIEnv* env, jobject clazz, jint fd); 53 54 TC3_JNI_METHOD(jint, TC3_ACTIONS_CLASS_NAME, nativeGetVersion) 55 (JNIEnv* env, jobject clazz, jint fd); 56 57 #ifdef __cplusplus 58 } 59 #endif 60 61 #endif // LIBTEXTCLASSIFIER_ACTIONS_ACTIONS_JNI_H_ 62