Option Strict On
Option Explicit On

Imports System.Collections.Generic
Imports Nexamas.UI.Architecture
Imports Nexamas.UI.Components.ListRendering
Imports Nexamas.UI.Controls
Imports Nexamas.UI.Rendering

Namespace Nexamas.UI.Components

    ''' <summary>
    ''' Architecture relation declarations for the Phase-1 product-size controls.
    ''' </summary>
    ''' <remarks>
    ''' These declarations intentionally describe system-level readiness relations only.
    ''' They are not a visual-child inventory and they do not claim that source-projection,
    ''' persistence, or virtualization engines are registered architectural components.
    ''' Friend-only readiness gates consume this provider to distinguish "registered/addable"
    ''' from "registered/addable/relation-covered" product controls.
    ''' </remarks>
    Friend NotInheritable Class MASProductControlRelationProvider
        Implements IMASComponentRelationProvider

        Public Function GetRelations() As IEnumerable(Of MASComponentRelationDeclaration) _
            Implements IMASComponentRelationProvider.GetRelations

            Dim relations As New List(Of MASComponentRelationDeclaration)()

            AddTreeGridRelations(relations)
            AddPivotTableRelations(relations)
            AddKanbanRelations(relations)
            AddAgendaRelations(relations)
            AddDashboardRelations(relations)
            AddMasterDetailRelations(relations)
            AddSplitViewRelations(relations)
            AddAppLayoutRelations(relations)

            Return relations

        End Function

        Private Shared Sub AddTreeGridRelations(relations As List(Of MASComponentRelationDeclaration))
            relations.Add(MASComponentRelationDeclaration.Create(GetType(MASTreeGrid), GetType(MASDataGrid), MASComponentRelationKind.DependsOn, "TreeGrid belongs to the data-grid product family and must preserve tabular data-selection, sorting, and editing semantics."))
            relations.Add(MASComponentRelationDeclaration.Create(GetType(MASTreeGrid), GetType(MASTreeView), MASComponentRelationKind.DependsOn, "TreeGrid also owns hierarchical expand/collapse semantics inherited from the tree-view product family."))
            relations.Add(MASComponentRelationDeclaration.Create(GetType(MASTreeGrid), GetType(MASTreeRowContract), MASComponentRelationKind.Uses, "TreeGrid rows are governed by the registered tree-row rendering contract for indentation and selectable row surfaces."))
        End Sub

        Private Shared Sub AddPivotTableRelations(relations As List(Of MASComponentRelationDeclaration))
            relations.Add(MASComponentRelationDeclaration.Create(GetType(MASPivotTable), GetType(MASDataGrid), MASComponentRelationKind.DependsOn, "PivotTable is a tabular/matrix product control and uses the data-grid family as its commercial behavior baseline."))
            relations.Add(MASComponentRelationDeclaration.Create(GetType(MASPivotTable), GetType(MASListRowContract), MASComponentRelationKind.Uses, "PivotTable summary rows are governed through the shared list-row rendering contract rather than an ad-hoc row endpoint."))
        End Sub

        Private Shared Sub AddKanbanRelations(relations As List(Of MASComponentRelationDeclaration))
            relations.Add(MASComponentRelationDeclaration.Create(GetType(MASKanbanBoard), GetType(MASCard), MASComponentRelationKind.Uses, "KanbanBoard cards and columns use the registered card surface family for board/card presentation."))
            relations.Add(MASComponentRelationDeclaration.Create(GetType(MASKanbanBoard), GetType(MASListRowContract), MASComponentRelationKind.Uses, "KanbanBoard card lists are governed by the shared selectable list-row contract for row-like interaction states."))
        End Sub

        Private Shared Sub AddAgendaRelations(relations As List(Of MASComponentRelationDeclaration))
            relations.Add(MASComponentRelationDeclaration.Create(GetType(MASAgendaView), GetType(MASCalendarView), MASComponentRelationKind.DependsOn, "AgendaView is the scheduled range-view companion to CalendarView and must keep day/week/month navigation semantics aligned."))
            relations.Add(MASComponentRelationDeclaration.Create(GetType(MASAgendaView), GetType(MASListRowContract), MASComponentRelationKind.Uses, "AgendaView event chips are governed by the shared selectable list-row rendering contract for item interaction states."))
        End Sub

        Private Shared Sub AddDashboardRelations(relations As List(Of MASComponentRelationDeclaration))
            relations.Add(MASComponentRelationDeclaration.Create(GetType(MASDashboardGrid), GetType(MASMetricCard), MASComponentRelationKind.Contains, "DashboardGrid owns metric-card-like widget surfaces as its primary product content."))
            relations.Add(MASComponentRelationDeclaration.Create(GetType(MASDashboardGrid), GetType(MASCard), MASComponentRelationKind.Uses, "DashboardGrid widgets use the registered card surface family for panel/card presentation."))
        End Sub

        Private Shared Sub AddMasterDetailRelations(relations As List(Of MASComponentRelationDeclaration))
            relations.Add(MASComponentRelationDeclaration.Create(GetType(MASMasterDetailView), GetType(MASListView), MASComponentRelationKind.DependsOn, "MasterDetailView master-pane navigation is governed by the list-view product family baseline."))
            relations.Add(MASComponentRelationDeclaration.Create(GetType(MASMasterDetailView), GetType(MASCard), MASComponentRelationKind.Uses, "MasterDetailView detail surfaces use the registered card surface family instead of an untracked ad-hoc panel surface."))
        End Sub

        Private Shared Sub AddSplitViewRelations(relations As List(Of MASComponentRelationDeclaration))
            relations.Add(MASComponentRelationDeclaration.Create(GetType(MASSplitView), GetType(MASCard), MASComponentRelationKind.Uses, "SplitView panes use the registered card surface family for pane chrome and interaction states."))
        End Sub

        Private Shared Sub AddAppLayoutRelations(relations As List(Of MASComponentRelationDeclaration))
            relations.Add(MASComponentRelationDeclaration.Create(GetType(MASAppLayout), GetType(MASSplitView), MASComponentRelationKind.DependsOn, "AppLayout slot ownership is the application-shell companion to SplitView-style multi-pane composition."))
            relations.Add(MASComponentRelationDeclaration.Create(GetType(MASAppLayout), GetType(MASCard), MASComponentRelationKind.Uses, "AppLayout visual slots use the registered card surface family for shell section presentation."))
        End Sub

    End Class

End Namespace
