Option Strict On
Option Explicit On

Imports System

Namespace Nexamas.UI.Application

    ''' <summary>
    ''' Public options used when Nexamas UI builds its owned application settings page.
    ''' The options describe content and behavior only. Page spacing, padding, chrome offset,
    ''' and max-width are owned by MASApplicationSettingsLayoutPolicy so public consumers do
    ''' not configure owned Settings geometry with raw numbers.
    ''' </summary>
    Friend NotInheritable Class MASApplicationSettingsPageOptions

        Friend Sub New()
            Title = "Application settings"
            Subtitle = "Adjust Nexamas UI runtime behavior from one official Application surface."
            SizingSectionTitle = "Size profile"
            SizingSectionSubtitle = "Change Compact, Default, Comfortable, Large, or Touch Friendly without manual bounds."
            PreviewTitle = "Preview"
            PreviewText = "This preview is measured by MASSize and arranged by MASLayout."
            ApplyButtonText = "Apply"
            CancelButtonText = "Cancel"
            ResetButtonText = "Reset to Default"
            ClearExistingControls = True
            IncludeSizingSection = True
            IncludePreviewControls = True
            IncludeActionButtons = True
            CloseAfterApply = False
            CloseAfterCancel = False
        End Sub

        Friend Property Title As String
        Friend Property Subtitle As String
        Friend Property SizingSectionTitle As String
        Friend Property SizingSectionSubtitle As String
        Friend Property PreviewTitle As String
        Friend Property PreviewText As String
        Friend Property ApplyButtonText As String
        Friend Property CancelButtonText As String
        Friend Property ResetButtonText As String
        Friend Property ClearExistingControls As Boolean
        Friend Property IncludeSizingSection As Boolean
        Friend Property IncludePreviewControls As Boolean
        Friend Property IncludeActionButtons As Boolean
        Friend Property CloseAfterApply As Boolean
        Friend Property CloseAfterCancel As Boolean
        Friend Property CloseRequested As Action(Of MASApplicationSettingsCloseReason)

        ''' <summary>
        ''' Internal chrome reservation used only by MAS-owned borderless settings sessions.
        ''' This is not public SDK geometry customization.
        ''' </summary>
        Friend Property ChromeTopInsetLogical As Single

        Friend Shared Function CreateDefault() As MASApplicationSettingsPageOptions
            Return New MASApplicationSettingsPageOptions()
        End Function

        Friend Function Clone() As MASApplicationSettingsPageOptions
            Return New MASApplicationSettingsPageOptions() With {
                .Title = Me.Title,
                .Subtitle = Me.Subtitle,
                .SizingSectionTitle = Me.SizingSectionTitle,
                .SizingSectionSubtitle = Me.SizingSectionSubtitle,
                .PreviewTitle = Me.PreviewTitle,
                .PreviewText = Me.PreviewText,
                .ApplyButtonText = Me.ApplyButtonText,
                .CancelButtonText = Me.CancelButtonText,
                .ResetButtonText = Me.ResetButtonText,
                .ClearExistingControls = Me.ClearExistingControls,
                .IncludeSizingSection = Me.IncludeSizingSection,
                .IncludePreviewControls = Me.IncludePreviewControls,
                .IncludeActionButtons = Me.IncludeActionButtons,
                .CloseAfterApply = Me.CloseAfterApply,
                .CloseAfterCancel = Me.CloseAfterCancel,
                .CloseRequested = Me.CloseRequested,
                .ChromeTopInsetLogical = Me.ChromeTopInsetLogical
            }
        End Function

        Friend Shared Function Normalize(options As MASApplicationSettingsPageOptions) As MASApplicationSettingsPageOptions
            If options Is Nothing Then Return New MASApplicationSettingsPageOptions()
            Return options.Clone()
        End Function

    End Class

End Namespace
