Option Strict On
Option Explicit On

Imports Nexamas.UI.Architecture

Namespace Nexamas.UI.Components

    Friend Structure MASButtonState

        Friend IsEnabled As Boolean
        Friend IsHovered As Boolean
        Friend IsPressed As Boolean
        Friend IsFocused As Boolean

        Friend Shared Function CreateDefault(Optional isEnabled As Boolean = True) As MASButtonState
            Return New MASButtonState With {
                .IsEnabled = isEnabled,
                .IsHovered = False,
                .IsPressed = False,
                .IsFocused = False
            }
        End Function

        Friend Function ToMASInteractionState(Optional isSelected As Boolean = False) As MASInteractionState
            Dim s As MASInteractionState = MASInteractionState.None

            If Not IsEnabled Then s = s Or MASInteractionState.Disabled
            If IsHovered Then s = s Or MASInteractionState.Hovered
            If IsPressed Then s = s Or MASInteractionState.Pressed
            If IsFocused Then s = s Or MASInteractionState.Focused
            If isSelected Then s = s Or MASInteractionState.Selected

            Return s
        End Function

        Friend Function ToMASInteractionStateSet(Optional isSelected As Boolean = False) As MASInteractionStateSet
            Return New MASInteractionStateSet(ToMASInteractionState(isSelected))
        End Function

    End Structure

End Namespace