2015-10-25 14:27:32 +00:00
|
|
|
package com.termux.view;
|
|
|
|
|
2016-06-27 22:56:30 +00:00
|
|
|
import android.view.KeyEvent;
|
2015-10-25 14:27:32 +00:00
|
|
|
import android.view.MotionEvent;
|
|
|
|
import android.view.ScaleGestureDetector;
|
2021-03-15 22:46:34 +00:00
|
|
|
import android.view.View;
|
2015-10-25 14:27:32 +00:00
|
|
|
|
2016-06-27 22:56:30 +00:00
|
|
|
import com.termux.terminal.TerminalSession;
|
|
|
|
|
2015-10-25 14:27:32 +00:00
|
|
|
/**
|
2021-03-15 22:46:34 +00:00
|
|
|
* The interface for communication between {@link TerminalView} and its client. It allows for getting
|
|
|
|
* various configuration options from the client and for sending back data to the client like logs,
|
|
|
|
* key events, both hardware and IME (which makes it different from that available with
|
|
|
|
* {@link View#setOnKeyListener(View.OnKeyListener)}, etc. It must be set for the
|
|
|
|
* {@link TerminalView} through {@link TerminalView#setTerminalViewClient(TerminalViewClient)}.
|
2015-10-25 14:27:32 +00:00
|
|
|
*/
|
2017-04-02 12:25:34 +00:00
|
|
|
public interface TerminalViewClient {
|
2015-10-25 14:27:32 +00:00
|
|
|
|
2017-04-01 17:06:02 +00:00
|
|
|
/**
|
|
|
|
* Callback function on scale events according to {@link ScaleGestureDetector#getScaleFactor()}.
|
|
|
|
*/
|
2016-06-27 23:03:03 +00:00
|
|
|
float onScale(float scale);
|
2015-10-25 14:27:32 +00:00
|
|
|
|
2021-03-13 11:49:29 +00:00
|
|
|
|
|
|
|
|
2017-04-01 17:06:02 +00:00
|
|
|
/**
|
|
|
|
* On a single tap on the terminal if terminal mouse reporting not enabled.
|
|
|
|
*/
|
2016-06-27 23:03:03 +00:00
|
|
|
void onSingleTapUp(MotionEvent e);
|
2015-10-25 14:27:32 +00:00
|
|
|
|
2016-06-27 23:03:03 +00:00
|
|
|
boolean shouldBackButtonBeMappedToEscape();
|
2015-12-23 00:43:41 +00:00
|
|
|
|
2021-04-07 06:31:30 +00:00
|
|
|
boolean shouldEnforceCharBasedInput();
|
2021-03-11 16:06:42 +00:00
|
|
|
|
|
|
|
boolean shouldUseCtrlSpaceWorkaround();
|
|
|
|
|
2021-03-13 11:49:29 +00:00
|
|
|
|
|
|
|
|
2016-06-27 23:03:03 +00:00
|
|
|
void copyModeChanged(boolean copyMode);
|
2016-01-13 02:00:21 +00:00
|
|
|
|
2021-03-13 11:49:29 +00:00
|
|
|
|
|
|
|
|
2016-06-27 22:56:30 +00:00
|
|
|
boolean onKeyDown(int keyCode, KeyEvent e, TerminalSession session);
|
|
|
|
|
|
|
|
boolean onKeyUp(int keyCode, KeyEvent e);
|
|
|
|
|
2021-03-13 11:49:29 +00:00
|
|
|
boolean onLongPress(MotionEvent event);
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-27 22:56:30 +00:00
|
|
|
boolean readControlKey();
|
|
|
|
|
|
|
|
boolean readAltKey();
|
|
|
|
|
2021-03-13 11:49:29 +00:00
|
|
|
|
2016-06-27 22:56:30 +00:00
|
|
|
boolean onCodePoint(int codePoint, boolean ctrlDown, TerminalSession session);
|
|
|
|
|
2021-03-13 11:49:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
void logError(String tag, String message);
|
|
|
|
|
|
|
|
void logWarn(String tag, String message);
|
|
|
|
|
|
|
|
void logInfo(String tag, String message);
|
|
|
|
|
|
|
|
void logDebug(String tag, String message);
|
|
|
|
|
|
|
|
void logVerbose(String tag, String message);
|
|
|
|
|
|
|
|
void logStackTraceWithMessage(String tag, String message, Exception e);
|
|
|
|
|
|
|
|
void logStackTrace(String tag, Exception e);
|
2017-04-01 17:06:02 +00:00
|
|
|
|
2015-10-25 14:27:32 +00:00
|
|
|
}
|