IHostUiHandler.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using Ryujinx.HLE.HOS.Applets;
  2. using Ryujinx.HLE.HOS.Services.Am.AppletOE.ApplicationProxyService.ApplicationProxy.Types;
  3. namespace Ryujinx.HLE.Ui
  4. {
  5. public interface IHostUiHandler
  6. {
  7. /// <summary>
  8. /// Displays an Input Dialog box to the user and blocks until text is entered.
  9. /// </summary>
  10. /// <param name="userText">Text that the user entered. Set to `null` on internal errors</param>
  11. /// <returns>True when OK is pressed, False otherwise. Also returns True on internal errors</returns>
  12. bool DisplayInputDialog(SoftwareKeyboardUiArgs args, out string userText);
  13. /// <summary>
  14. /// Displays a Message Dialog box to the user and blocks until it is closed.
  15. /// </summary>
  16. /// <returns>True when OK is pressed, False otherwise.</returns>
  17. bool DisplayMessageDialog(string title, string message);
  18. /// <summary>
  19. /// Displays a Message Dialog box specific to Controller Applet and blocks until it is closed.
  20. /// </summary>
  21. /// <returns>True when OK is pressed, False otherwise.</returns>
  22. bool DisplayMessageDialog(ControllerAppletUiArgs args);
  23. /// <summary>
  24. /// Tell the UI that we need to transisition to another program.
  25. /// </summary>
  26. /// <param name="device">The device instance.</param>
  27. /// <param name="kind">The program kind.</param>
  28. /// <param name="value">The value associated to the <paramref name="kind"/>.</param>
  29. void ExecuteProgram(Switch device, ProgramSpecifyKind kind, ulong value);
  30. /// Displays a Message Dialog box specific to Error Applet and blocks until it is closed.
  31. /// </summary>
  32. /// <returns>False when OK is pressed, True when another button (Details) is pressed.</returns>
  33. bool DisplayErrorAppletDialog(string title, string message, string[] buttonsText);
  34. /// <summary>
  35. /// Creates a handler to process keyboard inputs into text strings.
  36. /// </summary>
  37. /// <returns>An instance of the text handler.</returns>
  38. IDynamicTextInputHandler CreateDynamicTextInputHandler();
  39. /// <summary>
  40. /// Gets fonts and colors used by the host.
  41. /// </summary>
  42. IHostUiTheme HostUiTheme { get; }
  43. }
  44. }