FreeRDP
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules Pages
com.freerdp.freerdpcore.presentation.SessionActivity Class Reference
Inheritance diagram for com.freerdp.freerdpcore.presentation.SessionActivity:
Collaboration diagram for com.freerdp.freerdpcore.presentation.SessionActivity:

Data Structures

class  ConnectThread
 

Public Member Functions

void onCreate (Bundle savedInstanceState)
 
void onWindowFocusChanged (boolean hasFocus)
 
void onConfigurationChanged (Configuration newConfig)
 
boolean onCreateOptionsMenu (Menu menu)
 
boolean onOptionsItemSelected (MenuItem item)
 
void onBackPressed ()
 
boolean onKeyLongPress (int keyCode, KeyEvent event)
 
boolean onKeyDown (int keycode, KeyEvent event)
 
boolean onKeyUp (int keycode, KeyEvent event)
 
boolean onKeyMultiple (int keyCode, int repeatCount, KeyEvent event)
 
void onKey (int primaryCode, int[] keyCodes)
 
void onText (CharSequence text)
 
void swipeRight ()
 
void swipeLeft ()
 
void swipeDown ()
 
void swipeUp ()
 
void onPress (int primaryCode)
 
void onRelease (int primaryCode)
 
void processVirtualKey (int virtualKeyCode, boolean down)
 
void processUnicodeKey (int unicodeKey)
 
void switchKeyboard (int keyboardType)
 
void modifiersChanged ()
 
void OnSettingsChanged (int width, int height, int bpp)
 
void OnGraphicsUpdate (int x, int y, int width, int height)
 
void OnGraphicsResize (int width, int height, int bpp)
 
boolean OnAuthenticate (StringBuilder username, StringBuilder domain, StringBuilder password)
 
boolean OnGatewayAuthenticate (StringBuilder username, StringBuilder domain, StringBuilder password)
 
int OnVerifiyCertificateEx (String host, long port, String commonName, String subject, String issuer, String fingerprint, long flags)
 
int OnVerifyChangedCertificateEx (String host, long port, String commonName, String subject, String issuer, String fingerprint, String oldSubject, String oldIssuer, String oldFingerprint, long flags)
 
void OnRemoteClipboardChanged (String data)
 
void onScrollChanged (ScrollView2D scrollView, int x, int y, int oldx, int oldy)
 
void onSessionViewBeginTouch ()
 
void onSessionViewEndTouch ()
 
void onSessionViewLeftTouch (int x, int y, boolean down)
 
void onSessionViewRightTouch (int x, int y, boolean down)
 
void onSessionViewMove (int x, int y)
 
void onSessionViewScroll (boolean down)
 
void onTouchPointerClose ()
 
void onTouchPointerLeftClick (int x, int y, boolean down)
 
void onTouchPointerRightClick (int x, int y, boolean down)
 
void onTouchPointerMove (int x, int y)
 
void onTouchPointerScroll (boolean down)
 
void onTouchPointerToggleKeyboard ()
 
void onTouchPointerToggleExtKeyboard ()
 
void onTouchPointerResetScrollZoom ()
 
boolean onGenericMotionEvent (MotionEvent e)
 
void onClipboardChanged (String data)
 

Static Public Attributes

static final String PARAM_CONNECTION_REFERENCE = "conRef"
 
static final String PARAM_INSTANCE = "instance"
 

Protected Member Functions

void onStart ()
 
void onRestart ()
 
void onResume ()
 
void onPause ()
 
void onStop ()
 
void onDestroy ()
 

Detailed Description

Definition at line 72 of file SessionActivity.java.

Member Function Documentation

◆ modifiersChanged()

void com.freerdp.freerdpcore.presentation.SessionActivity.modifiersChanged ( )
inline

Definition at line 837 of file SessionActivity.java.

838 {
839 updateModifierKeyStates();
840 }

◆ OnAuthenticate()

boolean com.freerdp.freerdpcore.presentation.SessionActivity.OnAuthenticate ( StringBuilder  username,
StringBuilder  domain,
StringBuilder  password 
)
inline

Definition at line 904 of file SessionActivity.java.

906 {
907 // this is where the return code of our dialog will be stored
908 callbackDialogResult = false;
909
910 // set text fields
911 ((EditText)userCredView.findViewById(R.id.editTextUsername)).setText(username);
912 ((EditText)userCredView.findViewById(R.id.editTextDomain)).setText(domain);
913 ((EditText)userCredView.findViewById(R.id.editTextPassword)).setText(password);
914
915 // start dialog in UI thread
916 uiHandler.sendMessage(Message.obtain(null, UIHandler.SHOW_DIALOG, dlgUserCredentials));
917
918 // wait for result
919 try
920 {
921 synchronized (dlgUserCredentials)
922 {
923 dlgUserCredentials.wait();
924 }
925 }
926 catch (InterruptedException e)
927 {
928 }
929
930 // clear buffers
931 username.setLength(0);
932 domain.setLength(0);
933 password.setLength(0);
934
935 // read back user credentials
936 username.append(
937 ((EditText)userCredView.findViewById(R.id.editTextUsername)).getText().toString());
938 domain.append(
939 ((EditText)userCredView.findViewById(R.id.editTextDomain)).getText().toString());
940 password.append(
941 ((EditText)userCredView.findViewById(R.id.editTextPassword)).getText().toString());
942
943 return callbackDialogResult;
944 }

◆ onBackPressed()

void com.freerdp.freerdpcore.presentation.SessionActivity.onBackPressed ( )
inline

Definition at line 724 of file SessionActivity.java.

725 {
726 // hide keyboards (if any visible) or send alt+f4 to the session
727 if (sysKeyboardVisible || extKeyboardVisible)
728 showKeyboard(false, false);
729 else if (ApplicationSettingsActivity.getUseBackAsAltf4(this))
730 {
731 keyboardMapper.sendAltF4();
732 }
733 }

◆ onClipboardChanged()

void com.freerdp.freerdpcore.presentation.SessionActivity.onClipboardChanged ( String  data)
inline

Definition at line 1246 of file SessionActivity.java.

1247 {
1248 Log.v(TAG, "onClipboardChanged: " + data);
1249 LibFreeRDP.sendClipboardData(session.getInstance(), data);
1250 }

◆ onConfigurationChanged()

void com.freerdp.freerdpcore.presentation.SessionActivity.onConfigurationChanged ( Configuration  newConfig)
inline

Definition at line 394 of file SessionActivity.java.

395 {
396 super.onConfigurationChanged(newConfig);
397
398 // reload keyboard resources (changed from landscape)
399 modifiersKeyboard = new Keyboard(getApplicationContext(), R.xml.modifiers_keyboard);
400 specialkeysKeyboard = new Keyboard(getApplicationContext(), R.xml.specialkeys_keyboard);
401 numpadKeyboard = new Keyboard(getApplicationContext(), R.xml.numpad_keyboard);
402 cursorKeyboard = new Keyboard(getApplicationContext(), R.xml.cursor_keyboard);
403
404 // apply loaded keyboards
405 keyboardView.setKeyboard(specialkeysKeyboard);
406 modifiersKeyboardView.setKeyboard(modifiersKeyboard);
407
408 mDecor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
409 View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
410 }

◆ onCreate()

void com.freerdp.freerdpcore.presentation.SessionActivity.onCreate ( Bundle  savedInstanceState)
inline

Definition at line 213 of file SessionActivity.java.

214 {
215 super.onCreate(savedInstanceState);
216
217 // show status bar or make fullscreen?
218 if (ApplicationSettingsActivity.getHideStatusBar(this))
219 {
220 getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
221 WindowManager.LayoutParams.FLAG_FULLSCREEN);
222 }
223
224 this.setContentView(R.layout.session);
225 if (hasHardwareMenuButton() || ApplicationSettingsActivity.getHideActionBar(this))
226 {
227 this.getSupportActionBar().hide();
228 }
229 else
230 this.getSupportActionBar().show();
231
232 Log.v(TAG, "Session.onCreate");
233
234 // ATTENTION: We use the onGlobalLayout notification to start our
235 // session.
236 // This is because only then we can know the exact size of our session
237 // when using fit screen
238 // accounting for any status bars etc. that Android might throws on us.
239 // A bit weird looking
240 // but this is the only way ...
241 final View activityRootView = findViewById(R.id.session_root_view);
242 activityRootView.getViewTreeObserver().addOnGlobalLayoutListener(
243 new OnGlobalLayoutListener() {
244 @Override public void onGlobalLayout()
245 {
246 screen_width = activityRootView.getWidth();
247 screen_height = activityRootView.getHeight();
248
249 // start session
250 if (!sessionRunning && getIntent() != null)
251 {
252 processIntent(getIntent());
253 sessionRunning = true;
254 }
255 }
256 });
257
258 sessionView = findViewById(R.id.sessionView);
259 sessionView.setScaleGestureDetector(
260 new ScaleGestureDetector(this, new PinchZoomListener()));
261 sessionView.setSessionViewListener(this);
262 sessionView.requestFocus();
263
264 touchPointerView = findViewById(R.id.touchPointerView);
265 touchPointerView.setTouchPointerListener(this);
266
267 keyboardMapper = new KeyboardMapper();
268 keyboardMapper.init(this);
269 keyboardMapper.reset(this);
270
271 modifiersKeyboard = new Keyboard(getApplicationContext(), R.xml.modifiers_keyboard);
272 specialkeysKeyboard = new Keyboard(getApplicationContext(), R.xml.specialkeys_keyboard);
273 numpadKeyboard = new Keyboard(getApplicationContext(), R.xml.numpad_keyboard);
274 cursorKeyboard = new Keyboard(getApplicationContext(), R.xml.cursor_keyboard);
275
276 // hide keyboard below the sessionView
277 keyboardView = findViewById(R.id.extended_keyboard);
278 keyboardView.setKeyboard(specialkeysKeyboard);
279 keyboardView.setOnKeyboardActionListener(this);
280
281 modifiersKeyboardView = findViewById(R.id.extended_keyboard_header);
282 modifiersKeyboardView.setKeyboard(modifiersKeyboard);
283 modifiersKeyboardView.setOnKeyboardActionListener(this);
284
285 scrollView = findViewById(R.id.sessionScrollView);
286 scrollView.setScrollViewListener(this);
287 uiHandler = new UIHandler();
288 libFreeRDPBroadcastReceiver = new LibFreeRDPBroadcastReceiver();
289
290 zoomControls = findViewById(R.id.zoomControls);
291 zoomControls.hide();
292 zoomControls.setOnZoomInClickListener(new View.OnClickListener() {
293 @Override public void onClick(View v)
294 {
295 resetZoomControlsAutoHideTimeout();
296 zoomControls.setIsZoomInEnabled(sessionView.zoomIn(ZOOMING_STEP));
297 zoomControls.setIsZoomOutEnabled(true);
298 }
299 });
300 zoomControls.setOnZoomOutClickListener(new View.OnClickListener() {
301 @Override public void onClick(View v)
302 {
303 resetZoomControlsAutoHideTimeout();
304 zoomControls.setIsZoomOutEnabled(sessionView.zoomOut(ZOOMING_STEP));
305 zoomControls.setIsZoomInEnabled(true);
306 }
307 });
308
309 toggleMouseButtons = false;
310
311 createDialogs();
312
313 // register freerdp events broadcast receiver
314 IntentFilter filter = new IntentFilter();
315 filter.addAction(GlobalApp.ACTION_EVENT_FREERDP);
316 registerReceiver(libFreeRDPBroadcastReceiver, filter, RECEIVER_EXPORTED);
317
318 mClipboardManager = ClipboardManagerProxy.getClipboardManager(this);
319 mClipboardManager.addClipboardChangedListener(this);
320
321 mDecor = getWindow().getDecorView();
322 mDecor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
323 View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
324 }

◆ onCreateOptionsMenu()

boolean com.freerdp.freerdpcore.presentation.SessionActivity.onCreateOptionsMenu ( Menu  menu)
inline

Definition at line 680 of file SessionActivity.java.

681 {
682 getMenuInflater().inflate(R.menu.session_menu, menu);
683 return true;
684 }

◆ onDestroy()

void com.freerdp.freerdpcore.presentation.SessionActivity.onDestroy ( )
inlineprotected

Definition at line 365 of file SessionActivity.java.

366 {
367 if (connectThread != null)
368 {
369 connectThread.interrupt();
370 }
371 super.onDestroy();
372 Log.v(TAG, "Session.onDestroy");
373
374 // Cancel running disconnect timers.
375 GlobalApp.cancelDisconnectTimer();
376
377 // Disconnect all remaining sessions.
378 Collection<SessionState> sessions = GlobalApp.getSessions();
379 for (SessionState session : sessions)
380 LibFreeRDP.disconnect(session.getInstance());
381
382 // unregister freerdp events broadcast receiver
383 unregisterReceiver(libFreeRDPBroadcastReceiver);
384
385 // remove clipboard listener
386 mClipboardManager.removeClipboardboardChangedListener(this);
387
388 // free session
389 GlobalApp.freeSession(session.getInstance());
390
391 session = null;
392 }

◆ OnGatewayAuthenticate()

boolean com.freerdp.freerdpcore.presentation.SessionActivity.OnGatewayAuthenticate ( StringBuilder  username,
StringBuilder  domain,
StringBuilder  password 
)
inline

Definition at line 947 of file SessionActivity.java.

949 {
950 // this is where the return code of our dialog will be stored
951 callbackDialogResult = false;
952
953 // set text fields
954 ((EditText)userCredView.findViewById(R.id.editTextUsername)).setText(username);
955 ((EditText)userCredView.findViewById(R.id.editTextDomain)).setText(domain);
956 ((EditText)userCredView.findViewById(R.id.editTextPassword)).setText(password);
957
958 // start dialog in UI thread
959 uiHandler.sendMessage(Message.obtain(null, UIHandler.SHOW_DIALOG, dlgUserCredentials));
960
961 // wait for result
962 try
963 {
964 synchronized (dlgUserCredentials)
965 {
966 dlgUserCredentials.wait();
967 }
968 }
969 catch (InterruptedException e)
970 {
971 }
972
973 // clear buffers
974 username.setLength(0);
975 domain.setLength(0);
976 password.setLength(0);
977
978 // read back user credentials
979 username.append(
980 ((EditText)userCredView.findViewById(R.id.editTextUsername)).getText().toString());
981 domain.append(
982 ((EditText)userCredView.findViewById(R.id.editTextDomain)).getText().toString());
983 password.append(
984 ((EditText)userCredView.findViewById(R.id.editTextPassword)).getText().toString());
985
986 return callbackDialogResult;
987 }

◆ onGenericMotionEvent()

boolean com.freerdp.freerdpcore.presentation.SessionActivity.onGenericMotionEvent ( MotionEvent  e)
inline

Definition at line 1222 of file SessionActivity.java.

1223 {
1224 super.onGenericMotionEvent(e);
1225 switch (e.getAction())
1226 {
1227 case MotionEvent.ACTION_SCROLL:
1228 final float vScroll = e.getAxisValue(MotionEvent.AXIS_VSCROLL);
1229 if (vScroll < 0)
1230 {
1231 LibFreeRDP.sendCursorEvent(session.getInstance(), 0, 0,
1232 Mouse.getScrollEvent(this, false));
1233 }
1234 if (vScroll > 0)
1235 {
1236 LibFreeRDP.sendCursorEvent(session.getInstance(), 0, 0,
1237 Mouse.getScrollEvent(this, true));
1238 }
1239 break;
1240 }
1241 return true;
1242 }

◆ OnGraphicsResize()

void com.freerdp.freerdpcore.presentation.SessionActivity.OnGraphicsResize ( int  width,
int  height,
int  bpp 
)
inline

Definition at line 887 of file SessionActivity.java.

888 {
889 // replace bitmap
890 if (bpp > 16)
891 bitmap = Bitmap.createBitmap(width, height, Config.ARGB_8888);
892 else
893 bitmap = Bitmap.createBitmap(width, height, Config.RGB_565);
894 session.setSurface(new BitmapDrawable(getResources(), bitmap));
895
896 /*
897 * since sessionView can only be modified from the UI thread any
898 * modifications to it need to be scheduled
899 */
900 uiHandler.sendEmptyMessage(UIHandler.GRAPHICS_CHANGED);
901 }

◆ OnGraphicsUpdate()

void com.freerdp.freerdpcore.presentation.SessionActivity.OnGraphicsUpdate ( int  x,
int  y,
int  width,
int  height 
)
inline

Definition at line 873 of file SessionActivity.java.

874 {
875 LibFreeRDP.updateGraphics(session.getInstance(), bitmap, x, y, width, height);
876
877 sessionView.addInvalidRegion(new Rect(x, y, x + width, y + height));
878
879 /*
880 * since sessionView can only be modified from the UI thread any
881 * modifications to it need to be scheduled
882 */
883
884 uiHandler.sendEmptyMessage(UIHandler.REFRESH_SESSIONVIEW);
885 }

◆ onKey()

void com.freerdp.freerdpcore.presentation.SessionActivity.onKey ( int  primaryCode,
int[]  keyCodes 
)
inline

Definition at line 770 of file SessionActivity.java.

771 {
772 keyboardMapper.processCustomKeyEvent(primaryCode);
773 }

◆ onKeyDown()

boolean com.freerdp.freerdpcore.presentation.SessionActivity.onKeyDown ( int  keycode,
KeyEvent  event 
)
inline

Definition at line 751 of file SessionActivity.java.

752 {
753 return keyboardMapper.processAndroidKeyEvent(event);
754 }

◆ onKeyLongPress()

boolean com.freerdp.freerdpcore.presentation.SessionActivity.onKeyLongPress ( int  keyCode,
KeyEvent  event 
)
inline

Definition at line 735 of file SessionActivity.java.

736 {
737 if (keyCode == KeyEvent.KEYCODE_BACK)
738 {
739 LibFreeRDP.disconnect(session.getInstance());
740 return true;
741 }
742 return super.onKeyLongPress(keyCode, event);
743 }

◆ onKeyMultiple()

boolean com.freerdp.freerdpcore.presentation.SessionActivity.onKeyMultiple ( int  keyCode,
int  repeatCount,
KeyEvent  event 
)
inline

Definition at line 763 of file SessionActivity.java.

764 {
765 return keyboardMapper.processAndroidKeyEvent(event);
766 }

◆ onKeyUp()

boolean com.freerdp.freerdpcore.presentation.SessionActivity.onKeyUp ( int  keycode,
KeyEvent  event 
)
inline

Definition at line 756 of file SessionActivity.java.

757 {
758 return keyboardMapper.processAndroidKeyEvent(event);
759 }

◆ onOptionsItemSelected()

boolean com.freerdp.freerdpcore.presentation.SessionActivity.onOptionsItemSelected ( MenuItem  item)
inline

Definition at line 686 of file SessionActivity.java.

687 {
688 // refer to http://tools.android.com/tips/non-constant-fields why we
689 // can't use switch/case here ..
690 int itemId = item.getItemId();
691
692 if (itemId == R.id.session_touch_pointer)
693 {
694 // toggle touch pointer
695 if (touchPointerView.getVisibility() == View.VISIBLE)
696 {
697 touchPointerView.setVisibility(View.INVISIBLE);
698 sessionView.setTouchPointerPadding(0, 0);
699 }
700 else
701 {
702 touchPointerView.setVisibility(View.VISIBLE);
703 sessionView.setTouchPointerPadding(touchPointerView.getPointerWidth(),
704 touchPointerView.getPointerHeight());
705 }
706 }
707 else if (itemId == R.id.session_sys_keyboard)
708 {
709 showKeyboard(!sysKeyboardVisible, false);
710 }
711 else if (itemId == R.id.session_ext_keyboard)
712 {
713 showKeyboard(false, !extKeyboardVisible);
714 }
715 else if (itemId == R.id.session_disconnect)
716 {
717 showKeyboard(false, false);
718 LibFreeRDP.disconnect(session.getInstance());
719 }
720
721 return true;
722 }

◆ onPause()

void com.freerdp.freerdpcore.presentation.SessionActivity.onPause ( )
inlineprotected

Definition at line 350 of file SessionActivity.java.

351 {
352 super.onPause();
353 Log.v(TAG, "Session.onPause");
354
355 // hide any visible keyboards
356 showKeyboard(false, false);
357 }

◆ onPress()

void com.freerdp.freerdpcore.presentation.SessionActivity.onPress ( int  primaryCode)
inline

Definition at line 795 of file SessionActivity.java.

796 {
797 }

◆ onRelease()

void com.freerdp.freerdpcore.presentation.SessionActivity.onRelease ( int  primaryCode)
inline

Definition at line 799 of file SessionActivity.java.

800 {
801 }

◆ OnRemoteClipboardChanged()

void com.freerdp.freerdpcore.presentation.SessionActivity.OnRemoteClipboardChanged ( String  data)
inline

Definition at line 1081 of file SessionActivity.java.

1082 {
1083 Log.v(TAG, "OnRemoteClipboardChanged: " + data);
1084 mClipboardManager.setClipboardData(data);
1085 }

◆ onRestart()

void com.freerdp.freerdpcore.presentation.SessionActivity.onRestart ( )
inlineprotected

Definition at line 338 of file SessionActivity.java.

339 {
340 super.onRestart();
341 Log.v(TAG, "Session.onRestart");
342 }

◆ onResume()

void com.freerdp.freerdpcore.presentation.SessionActivity.onResume ( )
inlineprotected

Definition at line 344 of file SessionActivity.java.

345 {
346 super.onResume();
347 Log.v(TAG, "Session.onResume");
348 }

◆ onScrollChanged()

void com.freerdp.freerdpcore.presentation.SessionActivity.onScrollChanged ( ScrollView2D  scrollView,
int  x,
int  y,
int  oldx,
int  oldy 
)
inline

Implements com.freerdp.freerdpcore.presentation.ScrollView2D.ScrollView2DListener.

Definition at line 1096 of file SessionActivity.java.

1097 {
1098 zoomControls.setIsZoomInEnabled(!sessionView.isAtMaxZoom());
1099 zoomControls.setIsZoomOutEnabled(!sessionView.isAtMinZoom());
1100
1101 if (sysKeyboardVisible || extKeyboardVisible)
1102 return;
1103
1104 if (!ApplicationSettingsActivity.getHideZoomControls(this))
1105 {
1106 uiHandler.sendEmptyMessage(UIHandler.SHOW_ZOOMCONTROLS);
1107 resetZoomControlsAutoHideTimeout();
1108 }
1109 }

◆ onSessionViewBeginTouch()

void com.freerdp.freerdpcore.presentation.SessionActivity.onSessionViewBeginTouch ( )
inline

Implements com.freerdp.freerdpcore.presentation.SessionView.SessionViewListener.

Definition at line 1113 of file SessionActivity.java.

1114 {
1115 scrollView.setScrollEnabled(false);
1116 }

◆ onSessionViewEndTouch()

void com.freerdp.freerdpcore.presentation.SessionActivity.onSessionViewEndTouch ( )
inline

Implements com.freerdp.freerdpcore.presentation.SessionView.SessionViewListener.

Definition at line 1118 of file SessionActivity.java.

1119 {
1120 scrollView.setScrollEnabled(true);
1121 }

◆ onSessionViewLeftTouch()

void com.freerdp.freerdpcore.presentation.SessionActivity.onSessionViewLeftTouch ( int  x,
int  y,
boolean  down 
)
inline

Implements com.freerdp.freerdpcore.presentation.SessionView.SessionViewListener.

Definition at line 1123 of file SessionActivity.java.

1124 {
1125 if (!down)
1126 cancelDelayedMoveEvent();
1127
1128 LibFreeRDP.sendCursorEvent(session.getInstance(), x, y,
1129 toggleMouseButtons ? Mouse.getRightButtonEvent(this, down)
1130 : Mouse.getLeftButtonEvent(this, down));
1131
1132 if (!down)
1133 toggleMouseButtons = false;
1134 }

◆ onSessionViewMove()

void com.freerdp.freerdpcore.presentation.SessionActivity.onSessionViewMove ( int  x,
int  y 
)
inline

Implements com.freerdp.freerdpcore.presentation.SessionView.SessionViewListener.

Definition at line 1142 of file SessionActivity.java.

1143 {
1144 sendDelayedMoveEvent(x, y);
1145 }

◆ onSessionViewRightTouch()

void com.freerdp.freerdpcore.presentation.SessionActivity.onSessionViewRightTouch ( int  x,
int  y,
boolean  down 
)
inline

Implements com.freerdp.freerdpcore.presentation.SessionView.SessionViewListener.

Definition at line 1136 of file SessionActivity.java.

1137 {
1138 if (!down)
1139 toggleMouseButtons = !toggleMouseButtons;
1140 }

◆ onSessionViewScroll()

void com.freerdp.freerdpcore.presentation.SessionActivity.onSessionViewScroll ( boolean  down)
inline

Implements com.freerdp.freerdpcore.presentation.SessionView.SessionViewListener.

Definition at line 1147 of file SessionActivity.java.

1148 {
1149 LibFreeRDP.sendCursorEvent(session.getInstance(), 0, 0, Mouse.getScrollEvent(this, down));
1150 }

◆ OnSettingsChanged()

void com.freerdp.freerdpcore.presentation.SessionActivity.OnSettingsChanged ( int  width,
int  height,
int  bpp 
)
inline

Definition at line 844 of file SessionActivity.java.

845 {
846
847 if (bpp > 16)
848 bitmap = Bitmap.createBitmap(width, height, Config.ARGB_8888);
849 else
850 bitmap = Bitmap.createBitmap(width, height, Config.RGB_565);
851
852 session.setSurface(new BitmapDrawable(getResources(), bitmap));
853
854 if (session.getBookmark() == null)
855 {
856 // Return immediately if we launch from URI
857 return;
858 }
859
860 // check this settings and initial settings - if they are not equal the
861 // server doesn't support our settings
862 // FIXME: the additional check (settings.getWidth() != width + 1) is for
863 // the RDVH bug fix to avoid accidental notifications
864 // (refer to android_freerdp.c for more info on this problem)
865 BookmarkBase.ScreenSettings settings = session.getBookmark().getActiveScreenSettings();
866 if ((settings.getWidth() != width && settings.getWidth() != width + 1) ||
867 settings.getHeight() != height || settings.getColors() != bpp)
868 uiHandler.sendMessage(
869 Message.obtain(null, UIHandler.DISPLAY_TOAST,
870 getResources().getText(R.string.info_capabilities_changed)));
871 }

◆ onStart()

void com.freerdp.freerdpcore.presentation.SessionActivity.onStart ( )
inlineprotected

Definition at line 332 of file SessionActivity.java.

333 {
334 super.onStart();
335 Log.v(TAG, "Session.onStart");
336 }

◆ onStop()

void com.freerdp.freerdpcore.presentation.SessionActivity.onStop ( )
inlineprotected

Definition at line 359 of file SessionActivity.java.

360 {
361 super.onStop();
362 Log.v(TAG, "Session.onStop");
363 }

◆ onText()

void com.freerdp.freerdpcore.presentation.SessionActivity.onText ( CharSequence  text)
inline

Definition at line 775 of file SessionActivity.java.

776 {
777 }

◆ onTouchPointerClose()

void com.freerdp.freerdpcore.presentation.SessionActivity.onTouchPointerClose ( )
inline

Implements com.freerdp.freerdpcore.presentation.TouchPointerView.TouchPointerListener.

Definition at line 1154 of file SessionActivity.java.

1155 {
1156 touchPointerView.setVisibility(View.INVISIBLE);
1157 sessionView.setTouchPointerPadding(0, 0);
1158 }

◆ onTouchPointerLeftClick()

void com.freerdp.freerdpcore.presentation.SessionActivity.onTouchPointerLeftClick ( int  x,
int  y,
boolean  down 
)
inline

Implements com.freerdp.freerdpcore.presentation.TouchPointerView.TouchPointerListener.

Definition at line 1174 of file SessionActivity.java.

1175 {
1176 Point p = mapScreenCoordToSessionCoord(x, y);
1177 LibFreeRDP.sendCursorEvent(session.getInstance(), p.x, p.y,
1178 Mouse.getLeftButtonEvent(this, down));
1179 }

◆ onTouchPointerMove()

void com.freerdp.freerdpcore.presentation.SessionActivity.onTouchPointerMove ( int  x,
int  y 
)
inline

Implements com.freerdp.freerdpcore.presentation.TouchPointerView.TouchPointerListener.

Definition at line 1188 of file SessionActivity.java.

1189 {
1190 Point p = mapScreenCoordToSessionCoord(x, y);
1191 LibFreeRDP.sendCursorEvent(session.getInstance(), p.x, p.y, Mouse.getMoveEvent());
1192
1193 if (ApplicationSettingsActivity.getAutoScrollTouchPointer(this) &&
1194 !uiHandler.hasMessages(UIHandler.SCROLLING_REQUESTED))
1195 {
1196 Log.v(TAG, "Starting auto-scroll");
1197 uiHandler.sendEmptyMessageDelayed(UIHandler.SCROLLING_REQUESTED, SCROLLING_TIMEOUT);
1198 }
1199 }

◆ onTouchPointerResetScrollZoom()

void com.freerdp.freerdpcore.presentation.SessionActivity.onTouchPointerResetScrollZoom ( )
inline

Implements com.freerdp.freerdpcore.presentation.TouchPointerView.TouchPointerListener.

Definition at line 1216 of file SessionActivity.java.

1217 {
1218 sessionView.setZoom(1.0f);
1219 scrollView.scrollTo(0, 0);
1220 }

◆ onTouchPointerRightClick()

void com.freerdp.freerdpcore.presentation.SessionActivity.onTouchPointerRightClick ( int  x,
int  y,
boolean  down 
)
inline

Implements com.freerdp.freerdpcore.presentation.TouchPointerView.TouchPointerListener.

Definition at line 1181 of file SessionActivity.java.

1182 {
1183 Point p = mapScreenCoordToSessionCoord(x, y);
1184 LibFreeRDP.sendCursorEvent(session.getInstance(), p.x, p.y,
1185 Mouse.getRightButtonEvent(this, down));
1186 }

◆ onTouchPointerScroll()

void com.freerdp.freerdpcore.presentation.SessionActivity.onTouchPointerScroll ( boolean  down)
inline

Implements com.freerdp.freerdpcore.presentation.TouchPointerView.TouchPointerListener.

Definition at line 1201 of file SessionActivity.java.

1202 {
1203 LibFreeRDP.sendCursorEvent(session.getInstance(), 0, 0, Mouse.getScrollEvent(this, down));
1204 }

◆ onTouchPointerToggleExtKeyboard()

void com.freerdp.freerdpcore.presentation.SessionActivity.onTouchPointerToggleExtKeyboard ( )
inline

Implements com.freerdp.freerdpcore.presentation.TouchPointerView.TouchPointerListener.

Definition at line 1211 of file SessionActivity.java.

1212 {
1213 showKeyboard(false, !extKeyboardVisible);
1214 }

◆ onTouchPointerToggleKeyboard()

void com.freerdp.freerdpcore.presentation.SessionActivity.onTouchPointerToggleKeyboard ( )
inline

Implements com.freerdp.freerdpcore.presentation.TouchPointerView.TouchPointerListener.

Definition at line 1206 of file SessionActivity.java.

1207 {
1208 showKeyboard(!sysKeyboardVisible, false);
1209 }

◆ OnVerifiyCertificateEx()

int com.freerdp.freerdpcore.presentation.SessionActivity.OnVerifiyCertificateEx ( String  host,
long  port,
String  commonName,
String  subject,
String  issuer,
String  fingerprint,
long  flags 
)
inline

Definition at line 990 of file SessionActivity.java.

992 {
993 // see if global settings says accept all
994 if (ApplicationSettingsActivity.getAcceptAllCertificates(this))
995 return 0;
996
997 // this is where the return code of our dialog will be stored
998 callbackDialogResult = false;
999
1000 // set message
1001 String msg = getResources().getString(R.string.dlg_msg_verify_certificate);
1002 String type = "RDP-Server";
1003 if ((flags & LibFreeRDP.VERIFY_CERT_FLAG_GATEWAY) != 0)
1004 type = "RDP-Gateway";
1005 if ((flags & LibFreeRDP.VERIFY_CERT_FLAG_REDIRECT) != 0)
1006 type = "RDP-Redirect";
1007 msg += "\n\n" + type + ": " + host + ":" + port;
1008
1009 msg += "\n\nSubject: " + subject + "\nIssuer: " + issuer;
1010
1011 if ((flags & LibFreeRDP.VERIFY_CERT_FLAG_FP_IS_PEM) != 0)
1012 msg += "\nCertificate: " + fingerprint;
1013 else
1014 msg += "\nFingerprint: " + fingerprint;
1015 dlgVerifyCertificate.setMessage(msg);
1016
1017 // start dialog in UI thread
1018 uiHandler.sendMessage(Message.obtain(null, UIHandler.SHOW_DIALOG, dlgVerifyCertificate));
1019
1020 // wait for result
1021 try
1022 {
1023 synchronized (dlgVerifyCertificate)
1024 {
1025 dlgVerifyCertificate.wait();
1026 }
1027 }
1028 catch (InterruptedException e)
1029 {
1030 }
1031
1032 return callbackDialogResult ? 1 : 0;
1033 }

◆ OnVerifyChangedCertificateEx()

int com.freerdp.freerdpcore.presentation.SessionActivity.OnVerifyChangedCertificateEx ( String  host,
long  port,
String  commonName,
String  subject,
String  issuer,
String  fingerprint,
String  oldSubject,
String  oldIssuer,
String  oldFingerprint,
long  flags 
)
inline

Definition at line 1036 of file SessionActivity.java.

1040 {
1041 // see if global settings says accept all
1042 if (ApplicationSettingsActivity.getAcceptAllCertificates(this))
1043 return 0;
1044
1045 // this is where the return code of our dialog will be stored
1046 callbackDialogResult = false;
1047
1048 // set message
1049 String msg = getResources().getString(R.string.dlg_msg_verify_certificate);
1050 String type = "RDP-Server";
1051 if ((flags & LibFreeRDP.VERIFY_CERT_FLAG_GATEWAY) != 0)
1052 type = "RDP-Gateway";
1053 if ((flags & LibFreeRDP.VERIFY_CERT_FLAG_REDIRECT) != 0)
1054 type = "RDP-Redirect";
1055 msg += "\n\n" + type + ": " + host + ":" + port;
1056 msg += "\n\nSubject: " + subject + "\nIssuer: " + issuer;
1057 if ((flags & LibFreeRDP.VERIFY_CERT_FLAG_FP_IS_PEM) != 0)
1058 msg += "\nCertificate: " + fingerprint;
1059 else
1060 msg += "\nFingerprint: " + fingerprint;
1061 dlgVerifyCertificate.setMessage(msg);
1062
1063 // start dialog in UI thread
1064 uiHandler.sendMessage(Message.obtain(null, UIHandler.SHOW_DIALOG, dlgVerifyCertificate));
1065
1066 // wait for result
1067 try
1068 {
1069 synchronized (dlgVerifyCertificate)
1070 {
1071 dlgVerifyCertificate.wait();
1072 }
1073 }
1074 catch (InterruptedException e)
1075 {
1076 }
1077
1078 return callbackDialogResult ? 1 : 0;
1079 }

◆ onWindowFocusChanged()

void com.freerdp.freerdpcore.presentation.SessionActivity.onWindowFocusChanged ( boolean  hasFocus)
inline

Definition at line 326 of file SessionActivity.java.

327 {
328 super.onWindowFocusChanged(hasFocus);
329 mClipboardManager.getPrimaryClipManually();
330 }

◆ processUnicodeKey()

void com.freerdp.freerdpcore.presentation.SessionActivity.processUnicodeKey ( int  unicodeKey)
inline

Definition at line 810 of file SessionActivity.java.

811 {
812 LibFreeRDP.sendUnicodeKeyEvent(session.getInstance(), unicodeKey, true);
813 LibFreeRDP.sendUnicodeKeyEvent(session.getInstance(), unicodeKey, false);
814 }

◆ processVirtualKey()

void com.freerdp.freerdpcore.presentation.SessionActivity.processVirtualKey ( int  virtualKeyCode,
boolean  down 
)
inline

Definition at line 805 of file SessionActivity.java.

806 {
807 LibFreeRDP.sendKeyEvent(session.getInstance(), virtualKeyCode, down);
808 }

◆ swipeDown()

void com.freerdp.freerdpcore.presentation.SessionActivity.swipeDown ( )
inline

Definition at line 787 of file SessionActivity.java.

788 {
789 }

◆ swipeLeft()

void com.freerdp.freerdpcore.presentation.SessionActivity.swipeLeft ( )
inline

Definition at line 783 of file SessionActivity.java.

784 {
785 }

◆ swipeRight()

void com.freerdp.freerdpcore.presentation.SessionActivity.swipeRight ( )
inline

Definition at line 779 of file SessionActivity.java.

780 {
781 }

◆ swipeUp()

void com.freerdp.freerdpcore.presentation.SessionActivity.swipeUp ( )
inline

Definition at line 791 of file SessionActivity.java.

792 {
793 }

◆ switchKeyboard()

void com.freerdp.freerdpcore.presentation.SessionActivity.switchKeyboard ( int  keyboardType)
inline

Definition at line 816 of file SessionActivity.java.

817 {
818 switch (keyboardType)
819 {
820 case KeyboardMapper.KEYBOARD_TYPE_FUNCTIONKEYS:
821 keyboardView.setKeyboard(specialkeysKeyboard);
822 break;
823
824 case KeyboardMapper.KEYBOARD_TYPE_NUMPAD:
825 keyboardView.setKeyboard(numpadKeyboard);
826 break;
827
828 case KeyboardMapper.KEYBOARD_TYPE_CURSOR:
829 keyboardView.setKeyboard(cursorKeyboard);
830 break;
831
832 default:
833 break;
834 }
835 }

Field Documentation

◆ PARAM_CONNECTION_REFERENCE

final String com.freerdp.freerdpcore.presentation.SessionActivity.PARAM_CONNECTION_REFERENCE = "conRef"
static

Definition at line 78 of file SessionActivity.java.

◆ PARAM_INSTANCE

final String com.freerdp.freerdpcore.presentation.SessionActivity.PARAM_INSTANCE = "instance"
static

Definition at line 79 of file SessionActivity.java.


The documentation for this class was generated from the following file: