<?xml version="1.0" encoding="UTF-8" ?>
<class name="TLLineEdit" inherits="Control" category="Core" version="3.2">
	<brief_description>
		Control that provides single-line string editing. For formatted or/and multiline text, use [TLRichTextEdit].
		Copy of Godot [LineEdit] with the shaping support. TLLineEdit uses the same theme items as the [LineEdit].
	</brief_description>
	<description>
		TLLineEdit provides a single-line string editor, used for text fields. It features many built-in shortcuts which will always be available:
		- Ctrl + C: Copy
		- Ctrl + X: Cut
		- Ctrl + V or Ctrl + Y: Paste/"yank"
		- Ctrl + Z: Undo
		- Ctrl + Shift + Z: Redo
		- Ctrl + U: Delete text from the cursor position to the beginning of the line
		- Ctrl + K: Delete text from the cursor position to the end of the line
		- Ctrl + A: Select all text
		- Ctrl + D: Swap current input direction (primary cursor)
		- Up/Down arrow: Move the cursor to the beginning/end of the line
	</description>
	<tutorials>
	</tutorials>
	<methods>
		<method name="append_at_cursor">
			<return type="void">
			</return>
			<argument index="0" name="text" type="String">
			</argument>
			<description>
				Adds [code]text[/code] after the cursor. If the resulting value is longer than [member max_length], nothing happens.
			</description>
		</method>
		<method name="clear">
			<return type="void">
			</return>
			<description>
				Erases the [TLLineEdit] text.
			</description>
		</method>
		<method name="deselect">
			<return type="void">
			</return>
			<description>
				Clears the current selection.
			</description>
		</method>
		<method name="get_menu" qualifiers="const">
			<return type="PopupMenu">
			</return>
			<description>
				Returns the [PopupMenu] of this [TLLineEdit]. By default, this menu is displayed when right-clicking on the [TLLineEdit].
			</description>
		</method>
		<method name="menu_option">
			<return type="void">
			</return>
			<argument index="0" name="option" type="int">
			</argument>
			<description>
				Executes a given action as defined in the[code]MENU_*[/code] enum.
			</description>
		</method>
		<method name="select">
			<return type="void">
			</return>
			<argument index="0" name="from" type="int" default="0">
			</argument>
			<argument index="1" name="to" type="int" default="-1">
			</argument>
			<description>
				Selects characters inside [TLLineEdit] between [code]from[/code] and [code]to[/code]. By default, [code]from[/code] is at the beginning and [code]to[/code] at the end.
				[codeblock]
				text = "Welcome"
				select()     # Will select "Welcome"
				select(4)    # Will select "ome"
				select(2, 5) # Will select "lco"
				[/codeblock]
			</description>
		</method>
		<method name="select_all">
			<return type="void">
			</return>
			<description>
				Selects the whole [String].
			</description>
		</method>
	</methods>
	<members>
		<member name="align" type="int" setter="set_align" getter="get_align" default="0">
			Text alignment as defined in the [code]ALIGN_*[/code] enum.
		</member>
		<member name="base_font" type="TLFontFamily" setter="set_base_font" getter="get_base_font">
			Base font.
		</member>
		<member name="base_font_size" type="int" setter="set_base_font_size" getter="get_base_font_size" default="12">
			Base font size.
		</member>
		<member name="base_font_style" type="String" setter="set_base_font_style" getter="get_base_font_style" default="&quot;Regular&quot;">
			Base font style.
		</member>
		<member name="caret_blink" type="bool" setter="cursor_set_blink_enabled" getter="cursor_get_blink_enabled" default="false">
			If [code]true[/code], the caret (visual cursor) blinks.
		</member>
		<member name="caret_blink_speed" type="float" setter="cursor_set_blink_speed" getter="cursor_get_blink_speed" default="0.65">
			Duration (in seconds) of a caret's blinking cycle.
		</member>
		<member name="caret_position" type="int" setter="set_cursor_position" getter="get_cursor_position" default="0">
			The cursor's position inside the [TLLineEdit]. When set, the text may scroll to accommodate it.
		</member>
		<member name="clear_button_enabled" type="bool" setter="set_clear_button_enabled" getter="is_clear_button_enabled" default="false">
			If [code]true[/code], the [TLLineEdit] will show a clear button if [code]text[/code] is not empty.
		</member>
		<member name="context_menu_enabled" type="bool" setter="set_context_menu_enabled" getter="is_context_menu_enabled" default="true">
			If [code]true[/code], the context menu will appear when right-clicked.
		</member>
		<member name="editable" type="bool" setter="set_editable" getter="is_editable" default="true">
			If [code]false[/code], existing text cannot be modified and new text cannot be added.
		</member>
		<member name="expand_to_text_length" type="bool" setter="set_expand_to_text_length" getter="get_expand_to_text_length" default="false">
			If [code]true[/code], the [TLLineEdit] width will increase to stay longer than the [member text]. It will [b]not[/b] compress if the [member text] is shortened.
		</member>
		<member name="focus_mode" type="int" setter="set_focus_mode" getter="get_focus_mode" override="true" default="2" />
		<member name="language" type="String" setter="set_language" getter="get_language" default="&quot;&quot;">
			Language code for line-breaking and text shaping algorithms.
		</member>
		<member name="max_length" type="int" setter="set_max_length" getter="get_max_length" default="0">
			Maximum amount of characters that can be entered inside the [LineEdit]. If [code]0[/code], there is no limit.
		</member>
		<member name="mouse_default_cursor_shape" type="int" setter="set_default_cursor_shape" getter="get_default_cursor_shape" override="true" enum="Control.CursorShape" default="1" />
		<member name="ot_features" type="String" setter="set_ot_features" getter="get_ot_features" default="&quot;&quot;">
			Comma separated list of OpenType feature tags.
		</member>
		<member name="placeholder_alpha" type="float" setter="set_placeholder_alpha" getter="get_placeholder_alpha" default="0.6">
			Opacity of the [member placeholder_text]. From [code]0[/code] to [code]1[/code].
		</member>
		<member name="placeholder_text" type="String" setter="set_placeholder" getter="get_placeholder" default="&quot;&quot;">
			Text shown when the [TLLineEdit] is empty. It is [b]not[/b] the [TLLineEdit]'s default value (see [member text]).
		</member>
		<member name="secret" type="bool" setter="set_secret" getter="is_secret" default="false">
			If [code]true[/code], every character is replaced with the secret character (see [member secret_character]).
		</member>
		<member name="secret_character" type="String" setter="set_secret_character" getter="get_secret_character" default="&quot;*&quot;">
			The character to use to mask secret input (defaults to "*"). Only a single character can be used as the secret character.
		</member>
		<member name="text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;">
			String value of the [TLLineEdit].
		</member>
		<member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" default="3">
			Base direction of the text.
		</member>
	</members>
	<signals>
		<signal name="text_changed">
			<argument index="0" name="new_text" type="String">
			</argument>
			<description>
				Emitted when the text changes.
			</description>
		</signal>
		<signal name="text_entered">
			<argument index="0" name="new_text" type="String">
			</argument>
			<description>
				Emitted when the user presses [code]KEY_ENTER[/code] on the [TLLineEdit].
			</description>
		</signal>
	</signals>
	<constants>
		<constant name="ALIGN_LEFT" value="0" enum="Align">
			Aligns the text on the left-hand side of the [TLLineEdit].
		</constant>
		<constant name="ALIGN_CENTER" value="1" enum="Align">
			Centers the text in the middle of the [TLLineEdit].
		</constant>
		<constant name="ALIGN_RIGHT" value="2" enum="Align">
			Aligns the text on the right-hand side of the [TLLineEdit].
		</constant>
		<constant name="ALIGN_FILL" value="3" enum="Align">
			Stretches white spaces to fit the [TLLineEdit]'s width.
		</constant>
		<constant name="MENU_CUT" value="0" enum="MenuItems">
			Cuts (copies and clears) the selected text.
		</constant>
		<constant name="MENU_COPY" value="1" enum="MenuItems">
			Copies the selected text.
		</constant>
		<constant name="MENU_PASTE" value="2" enum="MenuItems">
			Pastes the clipboard text over the selected text (or at the cursor's position).
			Non-printable escape characters are automatically stripped from the OS clipboard via [code]String.strip_escapes[/code].
		</constant>
		<constant name="MENU_CLEAR" value="3" enum="MenuItems">
			Erases the whole [TLLineEdit] text.
		</constant>
		<constant name="MENU_SELECT_ALL" value="4" enum="MenuItems">
			Selects the whole [TLLineEdit] text.
		</constant>
		<constant name="MENU_UNDO" value="5" enum="MenuItems">
			Undoes the previous action.
		</constant>
		<constant name="MENU_REDO" value="6" enum="MenuItems">
			Reverse the last undo action.
		</constant>
		<constant name="MENU_MAX" value="7" enum="MenuItems">
			Represents the size of the [enum MenuItems] enum.
		</constant>
	</constants>
</class>
