Option Strict On
Option Explicit On

Imports System
Imports System.Windows.Forms
Imports Nexamas.UI.Theming
Imports SkiaSharp

Namespace Nexamas.UI.FloatRuntime

    ' ============================================================
    ' MASFloatRuntime Contract
    ' Class: IMASFloatRoutedInputContent
    '
    ' Purpose:
    '   Defines optional routed input support for Float content.
    '
    ' Responsibility:
    '   Allows MASFloatInputRouter to forward pointer, keyboard, wheel, and
    '   text input to content after runtime-level routing has selected the
    '   target Float.
    '
    ' Owns:
    '   No global input routing state.
    '
    ' Does Not Own:
    '   Hit testing between Floats.
    '   Outside-dismiss policy.
    '   Escape close authorization.
    '   Focus ownership.
    '   Lifecycle execution.
    '
    ' Allowed Dependencies:
    '   ThemeContext.
    '   SKPoint.
    '   MouseButtons.
    '   Keys.
    '
    ' Forbidden Dependencies:
    '   Legacy Overlay classes.
    '   OverlayHost.
    '   OverlayManager.
    '   OverlayContent.
    '   OverlayLayer.
    '   OverlayService.
    '
    ' Lifecycle Role:
    '   Called only while the Float is active and selected as input target.
    '
    ' Threading:
    '   Called on the Nexamas UI input path.
    '
    ' Mutation Rules:
    '   May mutate local content/control state.
    '   Must not mutate MASFloatRuntime lifecycle state directly.
    '
    ' Invariants:
    '   ptPx is surface pixel-space.
    '   Closing must be requested through IMASFloatSession, not directly.
    '
    ' Failure Rules:
    '   Returning False means input was not handled.
    ' ============================================================
    Friend Interface IMASFloatRoutedInputContent

        Function HitTestFloat(
            ctx As MASThemeContext,
            boundsPx As SKRect,
            ptPx As SKPoint
        ) As Boolean

        Sub PointerMoveFloat(
            ctx As MASThemeContext,
            ptPx As SKPoint
        )

        Function PointerDownFloat(
            ctx As MASThemeContext,
            ptPx As SKPoint,
            button As MouseButtons
        ) As Boolean

        Function PointerUpFloat(
            ctx As MASThemeContext,
            ptPx As SKPoint,
            button As MouseButtons
        ) As Boolean

        Function PointerWheelFloat(
            ctx As MASThemeContext,
            ptPx As SKPoint,
            delta As Integer
        ) As Boolean

        Function KeyDownFloat(
            ctx As MASThemeContext,
            keyCode As Keys
        ) As Boolean

        Function KeyUpFloat(
            ctx As MASThemeContext,
            keyCode As Keys
        ) As Boolean

        Function TextInputFloat(
            ctx As MASThemeContext,
            text As String
        ) As Boolean

        Function Win32ImeMessageFloat(
            ctx As MASThemeContext,
            hwnd As IntPtr,
            message As Integer,
            wParam As IntPtr,
            lParam As IntPtr
        ) As Boolean

    End Interface

End Namespace
