2023-11-16 20:16:28 +03:00
|
|
|
package org.amnezia.vpn.qt
|
|
|
|
|
|
2024-03-04 18:08:55 +03:00
|
|
|
import org.amnezia.vpn.protocol.ProtocolState
|
|
|
|
|
import org.amnezia.vpn.protocol.Status
|
|
|
|
|
|
2023-11-17 15:10:11 +03:00
|
|
|
/**
|
|
|
|
|
* JNI functions of the AndroidController class from android_controller.cpp,
|
|
|
|
|
* called by events in the Android part of the client
|
|
|
|
|
*/
|
2023-11-16 20:16:28 +03:00
|
|
|
object QtAndroidController {
|
2024-03-04 18:08:55 +03:00
|
|
|
|
|
|
|
|
fun onStatus(status: Status) = onStatus(status.state)
|
|
|
|
|
fun onStatus(protocolState: ProtocolState) = onStatus(protocolState.ordinal)
|
|
|
|
|
|
2023-12-05 16:10:29 +03:00
|
|
|
external fun onStatus(stateCode: Int)
|
2023-11-17 15:10:11 +03:00
|
|
|
external fun onServiceDisconnected()
|
|
|
|
|
external fun onServiceError()
|
|
|
|
|
|
|
|
|
|
external fun onVpnPermissionRejected()
|
2024-05-12 18:04:14 +03:00
|
|
|
external fun onNotificationStateChanged()
|
2024-03-04 18:08:55 +03:00
|
|
|
external fun onVpnStateChanged(stateCode: Int)
|
2023-11-17 15:10:11 +03:00
|
|
|
external fun onStatisticsUpdate(rxBytes: Long, txBytes: Long)
|
|
|
|
|
|
2023-12-26 16:23:05 +03:00
|
|
|
external fun onFileOpened(uri: String)
|
|
|
|
|
|
2023-12-11 22:56:01 +03:00
|
|
|
external fun onConfigImported(data: String)
|
2023-11-21 22:48:52 +03:00
|
|
|
|
2024-09-09 14:36:33 +03:00
|
|
|
external fun onAuthResult(result: Boolean)
|
|
|
|
|
|
2023-11-21 22:48:52 +03:00
|
|
|
external fun decodeQrCode(data: String): Boolean
|
2025-11-11 17:03:27 +03:00
|
|
|
|
|
|
|
|
external fun onImeInsetsChanged(heightDp: Int)
|
|
|
|
|
external fun onSystemBarsInsetsChanged(navBarHeightDp: Int, statusBarHeightDp: Int)
|
2023-11-16 20:16:28 +03:00
|
|
|
}
|