Option Strict On
Option Explicit On

Namespace Nexamas.UI.FloatRuntime

    ' ============================================================
    ' MASFloatRuntime Contract
    ' Class: MASFloatShieldOptions
    '
    ' Purpose:
    '   Describes Shield protection requested for a Float instance.
    '
    ' Responsibility:
    '   Defines which close, dismiss, replace, or higher-layer behaviors
    '   may be allowed while Shield is active.
    '
    ' Owns:
    '   Shield option values only.
    '
    ' Does Not Own:
    '   Shield authorization.
    '   Policy decisions.
    '   Close execution.
    '   Replacement execution.
    '   Higher-layer show execution.
    '
    ' Allowed Dependencies:
    '   MASFloatShieldMode.
    '   MASFloatShieldReason.
    '
    ' Forbidden Dependencies:
    '   Legacy Overlay classes.
    '   MASFloatPolicyEngine concrete type.
    '   MASFloatCoordinator.
    '   MASFloatHost.
    '
    ' Lifecycle Role:
    '   Request/resolved-request option consumed by PolicyEngine.
    '
    ' Threading:
    '   Options should be created and mutated on the UI thread before show,
    '   or changed through IMASFloatSession.SetShield during an active session.
    '
    ' Mutation Rules:
    '   Public mutable properties are allowed as request/options data.
    '   Runtime must snapshot or resolve options before relying on them as
    '   internal state.
    '
    ' Invariants:
    '   None means no Shield protection.
    '   Shield prevents unauthorized close or replacement.
    '   Shield does not always prevent higher-level Floats from appearing.
    '
    ' Failure Rules:
    '   Unsupported or contradictory options must be normalized or rejected
    '   by PolicyEngine.
    ' ============================================================
    Friend NotInheritable Class MASFloatShieldOptions

        Friend Shared ReadOnly Property None As MASFloatShieldOptions =
            New MASFloatShieldOptions(MASFloatShieldMode.None)

        Friend Property Mode As MASFloatShieldMode

        Friend Property Reason As MASFloatShieldReason = MASFloatShieldReason.None

        Friend Property AllowCancel As Boolean = True

        Friend Property AllowEscape As Boolean = False

        Friend Property AllowOutsideDismiss As Boolean = False

        Friend Property AllowReplace As Boolean = False

        Friend Property AllowCloseAll As Boolean = False

        Friend Property BlockHigherLayer As Boolean = False

        Friend Sub New(mode As MASFloatShieldMode)
            Me.Mode = mode
        End Sub

        Friend Function Clone() As MASFloatShieldOptions
            Return New MASFloatShieldOptions(Me.Mode) With {
                .Reason = Me.Reason,
                .AllowCancel = Me.AllowCancel,
                .AllowEscape = Me.AllowEscape,
                .AllowOutsideDismiss = Me.AllowOutsideDismiss,
                .AllowReplace = Me.AllowReplace,
                .AllowCloseAll = Me.AllowCloseAll,
                .BlockHigherLayer = Me.BlockHigherLayer
            }
        End Function

    End Class

End Namespace