'  
'   Rebex Sample Code License
' 
'   Copyright 2026, REBEX CR s.r.o.
'   All rights reserved.
'   https://www.rebex.net/
' 
'   Permission to use, copy, modify, and/or distribute this software for any
'   purpose with or without fee is hereby granted.
' 
'   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
'   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
'   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
'   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
'   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
'   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
'   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
'   OTHER DEALINGS IN THE SOFTWARE.
' 

Imports System

''' <summary>
''' Miscellaneous constants.
''' </summary>
Public NotInheritable Class Constants
    Private Sub New()
    End Sub
    ''' <summary>
    ''' Virtual directory where the sample ZIP archives are stored.
    ''' </summary>
    Public Const SampleFilesVirtualDirectory As String = "~/Data"

    ''' <summary>
    ''' Virtual directory where the images are stored.
    ''' </summary>
    Public Const ImagesVirtualDirectory As String = "~/Images"

    ''' <summary>
    ''' Directory delimiter used within URLs.
    ''' </summary>
    Public Const UrlPathDelimiter As Char = "/"c

End Class

''' <summary>
''' Page URL parameters.
''' </summary>
Public NotInheritable Class UrlParameter
    Private Sub New()
    End Sub
    ''' <summary>
    ''' URL parameter for browsed ZIP filename (relative to <see cref="Constants.SampleFilesVirtualDirectory"/>).
    ''' </summary>
    ''' <remarks>
    ''' Mandatory. If missing, the page throws an <see cref="ArgumentException"/>.
    ''' </remarks>
    Public Const ArchiveFileName As String = "archive"

    ''' <summary>
    ''' URL parameter for a path within the archive.
    ''' </summary>
    ''' <remarks>
    ''' Optional (if empty, root directory is used). 
    ''' </remarks>
    Public Const Path As String = "path"

    ''' <summary>
    ''' URL parameter for command type.
    ''' </summary>
    ''' <remarks>
    ''' Optional (if empty, default command is used).
    ''' </remarks>
    Public Const Command As String = "command"
End Class

''' <summary>
''' Values for <see cref="UrlParameter.Command"/> web page argument.
''' </summary>
Public NotInheritable Class UrlParameterCommand
    Private Sub New()
    End Sub
    ''' <summary>
    ''' Lists files and subdirectories of the current directory.<br/>
    ''' Default command.
    ''' </summary>
    ''' <remarks>
    ''' The directory should be defined in <see cref="UrlParameter.Path"/>.
    ''' </remarks>
    Public Const List As String = "list"

    ''' <summary>
    ''' Downloads a file.
    ''' </summary>
    ''' <remarks>
    ''' Path to the file should be defined in <see cref="UrlParameter.Path"/>.
    ''' </remarks>
    Public Const Download As String = "download"
End Class

''' <summary>
''' Determines the image to show.
''' </summary>
Public Enum IconType
    File
    Folder
    DirectoryUp
    Close
End Enum
