Option Strict On
Option Explicit On

Imports System
Imports Nexamas.UI.Components
Imports Nexamas.UI.FloatRuntime
Imports SkiaSharp

Namespace Nexamas.UI.Application

    ''' <summary>
    ''' Public SDK options for showing the application file explorer surface.
    ''' </summary>
    Public NotInheritable Class MASApplicationFileExplorerOptions

        Friend Property BoundsPx As SKRect = SKRect.Empty

        ''' <summary>
        ''' Shows the PanelShell header close button. The FileExplorer toolbar does not own a close button.
        ''' </summary>
        Public Property ShowCloseButton As Boolean = True

        Public Property UseDefaultComputerRoot As Boolean = True

        Public Property Root As MASFileExplorerItem

        Public Property InitialFolder As MASFileExplorerItem

        Public Property InitialViewMode As MASListViewMode = MASListViewMode.Details

        Public Property SearchPlaceholder As String = "Search in current folder..."

        Public Property AcceptOnItemActivated As Boolean = False

        Public Property ConfigureExplorer As Action(Of MASFileExplorerView)

        Public Function Clone() As MASApplicationFileExplorerOptions
            Return New MASApplicationFileExplorerOptions() With {
                .BoundsPx = Me.BoundsPx,
                .ShowCloseButton = Me.ShowCloseButton,
                .UseDefaultComputerRoot = Me.UseDefaultComputerRoot,
                .Root = Me.Root,
                .InitialFolder = Me.InitialFolder,
                .InitialViewMode = Me.InitialViewMode,
                .SearchPlaceholder = Me.SearchPlaceholder,
                .AcceptOnItemActivated = Me.AcceptOnItemActivated,
                .ConfigureExplorer = Me.ConfigureExplorer
            }
        End Function

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

        Friend Function ToFloatOptions() As MASFileExplorerFloatOptions
            Return New MASFileExplorerFloatOptions() With {
                .BoundsPx = Me.BoundsPx,
                .ShowCloseButton = Me.ShowCloseButton,
                .UseDefaultComputerRoot = Me.UseDefaultComputerRoot,
                .Root = Me.Root,
                .InitialFolder = Me.InitialFolder,
                .InitialViewMode = Me.InitialViewMode,
                .SearchPlaceholder = Me.SearchPlaceholder,
                .AcceptOnItemActivated = Me.AcceptOnItemActivated,
                .ConfigureExplorer = Me.ConfigureExplorer
            }
        End Function

    End Class

End Namespace
