#nullable enable
namespace UVC.UIToolkit
{
///
/// 문자열 속성 데이터 클래스입니다.
/// UI는 UTKStringPropertyItemView에서 담당합니다.
///
public class UTKStringPropertyItem : UTKPropertyItemBase
{
#region Fields
private bool _isMultiline = false;
private int _maxLength = -1;
#endregion
#region Properties
/// 속성 타입
public override UTKPropertyType PropertyType => UTKPropertyType.String;
/// 멀티라인 모드 여부
public bool IsMultiline
{
get => _isMultiline;
set => _isMultiline = value;
}
/// 최대 문자 길이 (-1 = 무제한)
public int MaxLength
{
get => _maxLength;
set => _maxLength = value;
}
/// 액션 버튼 설정 (null이면 버튼 미표시)
public UTKButtonItem? ActionButton { get; set; }
#endregion
#region Constructor
///
/// 문자열 속성을 생성합니다.
///
/// 고유 ID
/// 표시 이름
/// 초기 값
/// 멀티라인 모드
/// 최대 문자 길이
/// 읽기 전용 여부
/// 레이블 표시 여부
/// 액션 버튼
public UTKStringPropertyItem(string id, string name, string initialValue = "", bool isMultiline = false, int maxLength = -1, bool isReadOnly = false, bool showLabel = true, UTKButtonItem? actionButton = null)
: base(id, name, initialValue ?? string.Empty)
{
_isMultiline = isMultiline;
_maxLength = maxLength;
_isReadOnly = isReadOnly;
_showLabel = showLabel;
ActionButton = actionButton;
}
#endregion
}
}