tdlight-java-natives/src/main/jni-java-src/it/tdlight/tdnative/NativeClient.java

36 lines
1.2 KiB
Java
Raw Permalink Normal View History

2021-04-07 20:41:23 +02:00
package it.tdlight.tdnative;
2021-04-07 21:50:31 +02:00
import it.tdlight.jni.TdApi;
2020-10-10 03:26:24 +02:00
2021-10-22 19:52:47 +02:00
@SuppressWarnings("rawtypes")
2020-10-10 03:26:24 +02:00
public class NativeClient {
2020-10-12 18:02:48 +02:00
2021-10-22 19:10:45 +02:00
protected static native int createNativeClient();
2020-10-12 18:02:48 +02:00
2021-10-22 19:52:47 +02:00
protected static native void nativeClientSend(int nativeClientId, long eventId, TdApi.Function function);
2020-10-12 18:02:48 +02:00
2021-10-22 19:10:45 +02:00
protected static native int nativeClientReceive(int[] clientIds,
long[] eventIds,
TdApi.Object[] events,
double timeout);
2020-10-12 18:02:48 +02:00
2021-10-22 19:52:47 +02:00
protected static native TdApi.Object nativeClientExecute(TdApi.Function function);
2022-09-22 00:35:28 +02:00
2022-10-17 12:42:48 +02:00
protected static native void nativeClientSetLogMessageHandler(int maxVerbosityLevel, LogMessageHandler logMessageHandler);
2022-09-22 00:35:28 +02:00
/**
* Interface for handler of messages that are added to the internal TDLib log.
*/
public interface LogMessageHandler {
/**
* Callback called on messages that are added to the internal TDLib log.
*
* @param verbosityLevel Log verbosity level with which the message was added from -1 up to 1024.
* If 0, then TDLib will crash as soon as the callback returns.
* None of the TDLib methods can be called from the callback.
* @param message The message added to the internal TDLib log.
*/
void onLogMessage(int verbosityLevel, String message);
}
2020-10-10 03:26:24 +02:00
}