using System;
using Robust.Client.Input;
using Robust.Client.Interfaces.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Input;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Timing;
namespace Robust.Client.Interfaces.UserInterface
{
public interface IUserInterfaceManager
{
UITheme ThemeDefaults { get; }
///
/// Default style sheet that applies to all controls
/// that do not have a more specific style sheet via .
///
Stylesheet? Stylesheet { get; set; }
Control? KeyboardFocused { get; }
LayoutContainer StateRoot { get; }
LayoutContainer WindowRoot { get; }
LayoutContainer PopupRoot { get; }
PopupContainer ModalRoot { get; }
Control? CurrentlyHovered { get; }
float UIScale { get; }
///
/// The "root" control to which all other controls are parented,
/// potentially indirectly.
///
Control RootControl { get; }
IDebugMonitors DebugMonitors { get; }
void Popup(string contents, string title = "Alert!");
Control? MouseGetControl(Vector2 coordinates);
///
/// Gets the mouse position in UI space, accounting for .
///
Vector2 MousePositionScaled { get; }
Vector2 ScreenToUIPosition(Vector2 position);
Vector2 ScreenToUIPosition(ScreenCoordinates coordinates);
///
/// Give a control keyboard focus, releasing focus on the currently focused control (if any).
///
/// The control to give keyboard focus to.
/// Thrown if is null.
///
/// Thrown if has false.
///
void GrabKeyboardFocus(Control control);
///
/// Release keyboard focus from the currently focused control, if any.
///
void ReleaseKeyboardFocus();
///
/// Conditionally release keyboard focus if has keyboard focus.
///
///
/// Thrown if is null.
///
///
void ReleaseKeyboardFocus(Control ifControl);
///
/// Cursor automatically used when the mouse is not over any UI control.
///
ICursor? WorldCursor { get; set; }
void PushModal(Control modal);
}
internal interface IUserInterfaceManagerInternal : IUserInterfaceManager
{
///
/// Clears and disposes of all UI components.
/// Highly destructive!
///
void DisposeAllComponents();
void Initialize();
void InitializeTesting();
void Update(FrameEventArgs args);
void FrameUpdate(FrameEventArgs args);
/// True if a UI control was hit and the key event should not pass through past UI.
bool HandleCanFocusDown(Vector2 pointerPosition);
void HandleCanFocusUp();
void KeyBindDown(BoundKeyEventArgs args);
void KeyBindUp(BoundKeyEventArgs args);
void MouseMove(MouseMoveEventArgs mouseMoveEventArgs);
void MouseWheel(MouseWheelEventArgs args);
void TextEntered(TextEventArgs textEvent);
void ControlHidden(Control control);
void ControlRemovedFromTree(Control control);
void RemoveModal(Control modal);
void Render(IRenderHandle renderHandle);
void QueueStyleUpdate(Control control);
void QueueLayoutUpdate(Control control);
void CursorChanged(Control control);
}
}