#pragma once #include #include #include #include #include #include #include #include namespace XCEngine::UI::Editor { struct UIEditorHostedTreeViewInputOptions { bool allowInteraction = false; bool hasInputFocus = false; bool captureActive = false; }; struct UIEditorTreeViewInteractionState { Widgets::UIEditorTreeViewState treeViewState = {}; UIEditorScrollViewInteractionState scrollViewInteractionState = {}; ::XCEngine::UI::Widgets::UIKeyboardNavigationModel keyboardNavigation = {}; std::string selectionAnchorId = {}; ::XCEngine::UI::UIPoint pointerPosition = {}; float verticalOffset = 0.0f; bool hasPointerPosition = false; }; struct UIEditorTreeViewInteractionResult { bool consumed = false; bool selectionChanged = false; bool expansionChanged = false; bool keyboardNavigated = false; bool secondaryClicked = false; bool renameRequested = false; Widgets::UIEditorTreeViewHitTarget hitTarget = {}; std::string selectedItemId = {}; std::string renameItemId = {}; std::string toggledItemId = {}; std::size_t selectedVisibleIndex = Widgets::UIEditorTreeViewInvalidIndex; }; struct UIEditorTreeViewInteractionFrame { Widgets::UIEditorTreeViewLayout layout = {}; UIEditorTreeViewInteractionResult result = {}; }; std::vector<::XCEngine::UI::UIInputEvent> BuildUIEditorHostedTreeViewInputEvents( const ::XCEngine::UI::UIRect& bounds, const std::vector<::XCEngine::UI::UIInputEvent>& inputEvents, const UIEditorHostedTreeViewInputOptions& options, bool synthesizeFocusGained = false, bool synthesizeFocusLost = false); UIEditorTreeViewInteractionFrame UpdateUIEditorTreeViewInteraction( UIEditorTreeViewInteractionState& state, ::XCEngine::UI::Widgets::UISelectionModel& selectionModel, ::XCEngine::UI::Widgets::UIExpansionModel& expansionModel, const ::XCEngine::UI::UIRect& bounds, const std::vector& items, const std::vector<::XCEngine::UI::UIInputEvent>& inputEvents, const Widgets::UIEditorTreeViewMetrics& metrics = {}); } // namespace XCEngine::UI::Editor