Option Strict On
Option Explicit On

Namespace Nexamas.UI.FloatRuntime

    ' ============================================================
    ' MASFloatRuntime Contract
    ' Class: MASFloatDescriptor
    '
    ' Purpose:
    '   Describes a registered Float type at descriptor/type level.
    '
    ' Responsibility:
    '   Stores default metadata used by Registry, PolicyEngine, and
    '   Coordinator when resolving a MASFloatRequest.
    '
    ' Owns:
    '   Type-level metadata only.
    '
    ' Does Not Own:
    '   Open Float instances.
    '   Runtime lifecycle state.
    '   Content instances.
    '   Session instances.
    '   Result callbacks.
    '   Selected files or user data.
    '
    ' Allowed Dependencies:
    '   MASFloatCategory.
    '   MASFloatSlot.
    '   MASFloatScope.
    '   MASFloatLayerLevel.
    '   MASFloatCapabilities.
    '   MASFloatPresentation.
    '
    ' Forbidden Dependencies:
    '   Legacy Overlay classes.
    '   MASFloatCoordinator.
    '   MASFloatRuntimeState.
    '   MASFloatHost.
    '   Feature-owned lifecycle services.
    '
    ' Lifecycle Role:
    '   Registered before any matching Float can be shown.
    '   Read during request resolution.
    '
    ' Threading:
    '   Descriptor creation and registration must be performed through the
    '   runtime/registry flow.
    '   Runtime may snapshot descriptor values during resolution.
    '
    ' Mutation Rules:
    '   Public mutable properties are allowed as descriptor data before
    '   registration.
    '   After registration, callers must treat descriptors as immutable.
    '
    ' Invariants:
    '   Descriptor describes a Float type.
    '   Descriptor must not contain instance callbacks or runtime state.
    '   Descriptor and Request must never be merged.
    '
    ' Failure Rules:
    '   Empty Key is invalid.
    '   Missing DefaultPresentation may be normalized by Registry or
    '   Coordinator.
    ' ============================================================
    Friend NotInheritable Class MASFloatDescriptor

        Friend Property Key As String = String.Empty

        Friend Property DisplayName As String = String.Empty

        Friend Property Category As MASFloatCategory = MASFloatCategory.Popup

        Friend Property DefaultSlot As MASFloatSlot = MASFloatSlot.Popup

        Friend Property DefaultScope As MASFloatScope = MASFloatScope.Owner

        Friend Property DefaultLayer As MASFloatLayerLevel = MASFloatLayerLevel.Interactive

        Friend Property Capabilities As MASFloatCapabilities = MASFloatCapabilities.None

        Friend Property DefaultPresentation As MASFloatPresentation = New MASFloatPresentation()

        Friend Property CanQueue As Boolean = False

        Friend Property CanReplaceSameOwner As Boolean = False

        Friend Property RequiresOwnerKey As Boolean = True

        Friend Function Clone() As MASFloatDescriptor
            Return New MASFloatDescriptor() With {
                .Key = Me.Key,
                .DisplayName = Me.DisplayName,
                .Category = Me.Category,
                .DefaultSlot = Me.DefaultSlot,
                .DefaultScope = Me.DefaultScope,
                .DefaultLayer = Me.DefaultLayer,
                .Capabilities = Me.Capabilities,
                .DefaultPresentation = If(Me.DefaultPresentation Is Nothing, Nothing, Me.DefaultPresentation.Clone()),
                .CanQueue = Me.CanQueue,
                .CanReplaceSameOwner = Me.CanReplaceSameOwner,
                .RequiresOwnerKey = Me.RequiresOwnerKey
            }
        End Function

    End Class

End Namespace