48 lines
1.5 KiB
C++
48 lines
1.5 KiB
C++
#pragma once
|
|
|
|
#include <XCEditor/Fields/UIEditorTextField.h>
|
|
|
|
#include <XCEngine/UI/Text/UITextInputController.h>
|
|
#include <XCEngine/UI/Types.h>
|
|
#include <XCEngine/UI/Widgets/UIPropertyEditModel.h>
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace XCEngine::UI::Editor {
|
|
|
|
struct UIEditorTextFieldInteractionState {
|
|
Widgets::UIEditorTextFieldState textFieldState = {};
|
|
::XCEngine::UI::Text::UITextInputState textInputState = {};
|
|
::XCEngine::UI::Widgets::UIPropertyEditModel editModel = {};
|
|
::XCEngine::UI::UIPoint pointerPosition = {};
|
|
bool hasPointerPosition = false;
|
|
};
|
|
|
|
struct UIEditorTextFieldInteractionResult {
|
|
bool consumed = false;
|
|
bool focusChanged = false;
|
|
bool valueChanged = false;
|
|
bool editStarted = false;
|
|
bool editCommitted = false;
|
|
bool editCanceled = false;
|
|
Widgets::UIEditorTextFieldHitTarget hitTarget = {};
|
|
std::string valueBefore = {};
|
|
std::string valueAfter = {};
|
|
std::string committedText = {};
|
|
};
|
|
|
|
struct UIEditorTextFieldInteractionFrame {
|
|
Widgets::UIEditorTextFieldLayout layout = {};
|
|
UIEditorTextFieldInteractionResult result = {};
|
|
};
|
|
|
|
UIEditorTextFieldInteractionFrame UpdateUIEditorTextFieldInteraction(
|
|
UIEditorTextFieldInteractionState& state,
|
|
Widgets::UIEditorTextFieldSpec& spec,
|
|
const ::XCEngine::UI::UIRect& bounds,
|
|
const std::vector<::XCEngine::UI::UIInputEvent>& inputEvents,
|
|
const Widgets::UIEditorTextFieldMetrics& metrics = {});
|
|
|
|
} // namespace XCEngine::UI::Editor
|