IConsoleOutput.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. namespace Terminal.Gui.Drivers;
  2. /// <summary>
  3. /// Interface for writing console output
  4. /// </summary>
  5. public interface IConsoleOutput : IDisposable
  6. {
  7. /// <summary>
  8. /// Writes the given text directly to the console. Use to send
  9. /// ansi escape codes etc. Regular screen output should use the
  10. /// <see cref="IOutputBuffer"/> overload.
  11. /// </summary>
  12. /// <param name="text"></param>
  13. void Write (ReadOnlySpan<char> text);
  14. /// <summary>
  15. /// Write the contents of the <paramref name="buffer"/> to the console
  16. /// </summary>
  17. /// <param name="buffer"></param>
  18. void Write (IOutputBuffer buffer);
  19. /// <summary>
  20. /// Returns the current size of the console in rows/columns (i.e.
  21. /// of characters not pixels).
  22. /// </summary>
  23. /// <returns></returns>
  24. public Size GetSize ();
  25. /// <summary>
  26. /// Updates the console cursor (the blinking underscore) to be hidden,
  27. /// visible etc.
  28. /// </summary>
  29. /// <param name="visibility"></param>
  30. void SetCursorVisibility (CursorVisibility visibility);
  31. /// <summary>
  32. /// Moves the console cursor to the given location.
  33. /// </summary>
  34. /// <param name="col"></param>
  35. /// <param name="row"></param>
  36. void SetCursorPosition (int col, int row);
  37. /// <summary>
  38. /// Sets the size of the console..
  39. /// </summary>
  40. /// <param name="width"></param>
  41. /// <param name="height"></param>
  42. void SetSize (int width, int height);
  43. }