Option Strict On
Option Explicit On

Imports Nexamas.UI.Application
Imports Nexamas.UI.Layout

Namespace Nexamas.UI.Presentation

    ''' <summary>
    ''' Internal size policy for Nexamas UI presentation pages. It centralizes the
    ''' header, section-intro, and footer-action slots so product/demo pages do not
    ''' repeat title heights, description breathing room, or bottom action sizing.
    ''' </summary>
    Friend NotInheritable Class MASPresentationPageMetrics
        Private Sub New()
        End Sub

        Friend Shared Function HeaderTitleSize() As MASSize
            Return MASSize.FillWidth.OffsetHeight(44.0F)
        End Function

        Friend Shared Function HeaderDescriptionSize() As MASSize
            Return MASSize.FillWidth.OffsetHeight(12.0F)
        End Function

        Friend Shared Function SectionHeadingSize() As MASSize
            Return MASSize.FillWidth.OffsetHeight(8.0F)
        End Function

        Friend Shared Function SectionDescriptionSize() As MASSize
            Return MASSize.FillWidth.OffsetHeight(10.0F)
        End Function

        Friend Shared Function BodyFullWidthSize() As MASSize
            Return MASSize.FillWidth
        End Function

        Friend Shared Function NarrativePaneSize() As MASSize
            Return MASSize.FillWidth.OffsetHeight(8.0F)
        End Function

        Friend Shared Function BodySurfaceSize(kind As MASPresentationSurfaceKind) As MASSize
            Return MASApplicationLayoutPolicy.ResolveControlSurfaceSize(ToApplicationSurfaceKind(kind))
        End Function

        Friend Shared Function SurfaceHeaderSize() As MASSize
            Return MASSize.HugContent.OffsetHeight(4.0F)
        End Function

        Private Shared Function ToApplicationSurfaceKind(kind As MASPresentationSurfaceKind) As MASApplicationControlSurfaceSizeKind
            Select Case kind
                Case MASPresentationSurfaceKind.SelectionList
                    Return MASApplicationControlSurfaceSizeKind.SelectionList
                Case MASPresentationSurfaceKind.CollectionPair
                    Return MASApplicationControlSurfaceSizeKind.CollectionPair
                Case MASPresentationSurfaceKind.Tree
                    Return MASApplicationControlSurfaceSizeKind.TreeSurface
                Case MASPresentationSurfaceKind.TileGallery
                    Return MASApplicationControlSurfaceSizeKind.TileGallery
                Case MASPresentationSurfaceKind.DataGrid
                    Return MASApplicationControlSurfaceSizeKind.DataGrid
                Case MASPresentationSurfaceKind.Document
                    Return MASApplicationControlSurfaceSizeKind.Document
                Case MASPresentationSurfaceKind.Inspector
                    Return MASApplicationControlSurfaceSizeKind.Inspector
                Case Else
                    Return MASApplicationControlSurfaceSizeKind.Standard
            End Select
        End Function

        Friend Shared Function FooterActionSize() As MASSize
            Return MASSize.Large.OffsetHeight(18.0F)
        End Function
    End Class

End Namespace
