IWindowImpl.cs 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. // Copyright (c) The Avalonia Project. All rights reserved.
  2. // Licensed under the MIT license. See licence.md file in the project root for full license information.
  3. using System;
  4. using Avalonia.Controls;
  5. using Avalonia.Input;
  6. namespace Avalonia.Platform
  7. {
  8. /// <summary>
  9. /// Defines a platform-specific window implementation.
  10. /// </summary>
  11. public interface IWindowImpl : IWindowBaseImpl
  12. {
  13. /// <summary>
  14. /// Gets or sets the minimized/maximized state of the window.
  15. /// </summary>
  16. WindowState WindowState { get; set; }
  17. /// <summary>
  18. /// Gets or sets a method called when the minimized/maximized state of the window changes.
  19. /// </summary>
  20. Action<WindowState> WindowStateChanged { get; set; }
  21. /// <summary>
  22. /// Sets the title of the window.
  23. /// </summary>
  24. /// <param name="title">The title.</param>
  25. void SetTitle(string title);
  26. /// <summary>
  27. /// Shows the window as a dialog.
  28. /// </summary>
  29. void ShowDialog(IWindowImpl parent);
  30. /// <summary>
  31. /// Enables or disables system window decorations (title bar, buttons, etc)
  32. /// </summary>
  33. void SetSystemDecorations(bool enabled);
  34. /// <summary>
  35. /// Sets the icon of this window.
  36. /// </summary>
  37. void SetIcon(IWindowIconImpl icon);
  38. /// <summary>
  39. /// Enables or disables the taskbar icon
  40. /// </summary>
  41. void ShowTaskbarIcon(bool value);
  42. /// <summary>
  43. /// Enables or disables resizing of the window
  44. /// </summary>
  45. void CanResize(bool value);
  46. /// <summary>
  47. /// Gets or sets a method called before the underlying implementation is destroyed.
  48. /// Return true to prevent the underlying implementation from closing.
  49. /// </summary>
  50. Func<bool> Closing { get; set; }
  51. /// <summary>
  52. /// Starts moving a window with left button being held. Should be called from left mouse button press event handler.
  53. /// </summary>
  54. void BeginMoveDrag(PointerPressedEventArgs e);
  55. /// <summary>
  56. /// Starts resizing a window. This function is used if an application has window resizing controls.
  57. /// Should be called from left mouse button press event handler
  58. /// </summary>
  59. void BeginResizeDrag(WindowEdge edge, PointerPressedEventArgs e);
  60. /// <summary>
  61. /// Sets the client size of the top level.
  62. /// </summary>
  63. void Resize(Size clientSize);
  64. /// <summary>
  65. /// Sets the client size of the top level.
  66. /// </summary>
  67. void Move(PixelPoint point);
  68. /// <summary>
  69. /// Minimum width of the window.
  70. /// </summary>
  71. ///
  72. void SetMinMaxSize(Size minSize, Size maxSize);
  73. }
  74. }