{
  "name": "TextEdit",
  "component": "gui",
  "header": "nativeui/text_edit.h",
  "type": "Class",
  "namespace": "nu",
  "inherit": {
    "name": "View",
    "id": "view"
  },
  "description": "Plain text input view.",
  "detail": "The selection range in `TextEdit` use 0-based index, the `start` and `end`\nboth start from 0, and `end` is the index of the character after the range.\n\nUsing -1 as `end` means the end of the text.\n\nThe range uses character index instead of byte index, be careful when using\nprogramming languages without Unicode support.\n",
  "class_methods": [
    {
      "signature": {
        "returnType": {
          "name": "TextEdit",
          "id": "textedit"
        },
        "name": "create",
        "parameters": [],
        "shortStr": "create()",
        "str": "create()"
      },
      "description": "Create a new `TextEdit`.",
      "id": "create"
    }
  ],
  "methods": [
    {
      "signature": {
        "name": "settext",
        "parameters": [
          {
            "type": {
              "name": "string"
            },
            "name": "text"
          }
        ],
        "shortStr": "settext(text)",
        "str": "settext(text)"
      },
      "description": "Change the text in the view.",
      "id": "settext-text"
    },
    {
      "signature": {
        "returnType": {
          "name": "string"
        },
        "name": "gettext",
        "parameters": [],
        "shortStr": "gettext()",
        "str": "gettext()"
      },
      "description": "Return currently displayed text.",
      "id": "gettext"
    },
    {
      "signature": {
        "name": "undo",
        "parameters": [],
        "shortStr": "undo()",
        "str": "undo()"
      },
      "description": "Undo the last edit operation in the undo queue.",
      "id": "undo"
    },
    {
      "signature": {
        "name": "canundo",
        "parameters": [],
        "shortStr": "canundo()",
        "str": "canundo()"
      },
      "description": "Return whether there are any actions in undo queue.",
      "id": "canundo"
    },
    {
      "signature": {
        "name": "redo",
        "parameters": [],
        "shortStr": "redo()",
        "str": "redo()"
      },
      "description": "Redo the next action in the redo queue",
      "id": "redo"
    },
    {
      "signature": {
        "name": "canredo",
        "parameters": [],
        "shortStr": "canredo()",
        "str": "canredo()"
      },
      "description": "Return whether there are any actions in redo queue.",
      "id": "canredo"
    },
    {
      "signature": {
        "name": "cut",
        "parameters": [],
        "shortStr": "cut()",
        "str": "cut()"
      },
      "description": "Delete (cut) the current selection, if any, copy the deleted text to the\nclipboard.\n",
      "id": "cut"
    },
    {
      "signature": {
        "name": "copy",
        "parameters": [],
        "shortStr": "copy()",
        "str": "copy()"
      },
      "description": "Copy current selection to clipboard.",
      "id": "copy"
    },
    {
      "signature": {
        "name": "paste",
        "parameters": [],
        "shortStr": "paste()",
        "str": "paste()"
      },
      "description": "Copy the current content of the clipboard to current caret position.\n",
      "id": "paste"
    },
    {
      "signature": {
        "name": "selectall",
        "parameters": [],
        "shortStr": "selectall()",
        "str": "selectall()"
      },
      "description": "Select all text.",
      "id": "selectall"
    },
    {
      "signature": {
        "returnType": {
          "name": "std::tuple",
          "args": [
            {
              "name": "integer"
            },
            {
              "name": "integer"
            }
          ],
          "id": "std_tuple"
        },
        "name": "getselectionrange",
        "parameters": [],
        "shortStr": "getselectionrange()",
        "str": "getselectionrange()"
      },
      "description": "Return the start position and end position of current selection.\n\nIf nothing is selected, the cursor position will be returned as both values, ie. (0, 0).\n",
      "id": "getselectionrange"
    },
    {
      "signature": {
        "name": "selectrange",
        "parameters": [
          {
            "type": {
              "name": "integer"
            },
            "name": "start"
          },
          {
            "type": {
              "name": "integer"
            },
            "name": "end"
          }
        ],
        "shortStr": "selectrange(start, end)",
        "str": "selectrange(start, end)"
      },
      "description": "Select text between `start` and `end` positions.",
      "id": "selectrange-start-end"
    },
    {
      "signature": {
        "returnType": {
          "name": "string"
        },
        "name": "gettextinrange",
        "parameters": [
          {
            "type": {
              "name": "integer"
            },
            "name": "start"
          },
          {
            "type": {
              "name": "integer"
            },
            "name": "end"
          }
        ],
        "shortStr": "gettextinrange(start, end)",
        "str": "gettextinrange(start, end)"
      },
      "description": "Return the text between `start` and `end` positions.",
      "id": "gettextinrange-start-end"
    },
    {
      "signature": {
        "name": "inserttext",
        "parameters": [
          {
            "type": {
              "name": "string"
            },
            "name": "text"
          }
        ],
        "shortStr": "inserttext(text)",
        "str": "inserttext(text)"
      },
      "description": "Insert `text` at current caret position.",
      "id": "inserttext-text"
    },
    {
      "signature": {
        "name": "inserttextat",
        "parameters": [
          {
            "type": {
              "name": "string"
            },
            "name": "text"
          },
          {
            "type": {
              "name": "integer"
            },
            "name": "position"
          }
        ],
        "shortStr": "inserttextat(text, position)",
        "str": "inserttextat(text, position)"
      },
      "description": "Insert `text` at the `position`.",
      "id": "inserttextat-text-position"
    },
    {
      "signature": {
        "name": "delete",
        "parameters": [],
        "shortStr": "delete()",
        "str": "delete()"
      },
      "description": "Delete text of current selection.",
      "id": "delete"
    },
    {
      "signature": {
        "name": "deleterange",
        "parameters": [
          {
            "type": {
              "name": "integer"
            },
            "name": "start"
          },
          {
            "type": {
              "name": "integer"
            },
            "name": "end"
          }
        ],
        "shortStr": "deleterange(start, end)",
        "str": "deleterange(start, end)"
      },
      "description": "Delete text between `start` and `end` positions.",
      "id": "deleterange-start-end"
    },
    {
      "signature": {
        "name": "setoverlayscrollbar",
        "parameters": [
          {
            "type": {
              "name": "boolean"
            },
            "name": "overlay"
          }
        ],
        "shortStr": "setoverlayscrollbar(overlay)",
        "str": "setoverlayscrollbar(overlay)"
      },
      "platform": [
        "macOS",
        "linux"
      ],
      "description": "Set whether to use overlay scrolling.",
      "id": "setoverlayscrollbar-overlay"
    },
    {
      "signature": {
        "name": "setscrollbarpolicy",
        "parameters": [
          {
            "type": {
              "name": "Scroll::Policy",
              "id": "scroll_policy"
            },
            "name": "hpolicy",
            "description": "Policy for horizontal scrollbar."
          },
          {
            "type": {
              "name": "Scroll::Policy",
              "id": "scroll_policy"
            },
            "name": "vpolicy",
            "description": "Policy for vertical scrollbar."
          }
        ],
        "shortStr": "setscrollbarpolicy(hpolicy, vpolicy)",
        "str": "setscrollbarpolicy(hpolicy, vpolicy)"
      },
      "description": "Set the policy for displaying horizontal and vertical scrollbars.\n",
      "id": "setscrollbarpolicy-hpolicy-vpolicy"
    },
    {
      "signature": {
        "name": "setscrollelasticity",
        "parameters": [
          {
            "type": {
              "name": "Scroll::Elasticity",
              "id": "scroll_elasticity"
            },
            "name": "helasticity",
            "description": "Horizontal scroll elasticity."
          },
          {
            "type": {
              "name": "Scroll::Elasticity",
              "id": "scroll_elasticity"
            },
            "name": "velasticity",
            "description": "Vertical scroll elasticity."
          }
        ],
        "shortStr": "setscrollelasticity(helasticity, velasticity)",
        "str": "setscrollelasticity(helasticity, velasticity)"
      },
      "platform": [
        "macOS"
      ],
      "description": "Set horizontal and vertical scroll elasticity (bounce).\n",
      "id": "setscrollelasticity-helasticity-velasticity"
    },
    {
      "signature": {
        "returnType": {
          "name": "std::tuple",
          "args": [
            {
              "name": "Scroll::Elasticity",
              "id": "scroll_elasticity"
            },
            {
              "name": "Scroll::Elasticity",
              "id": "scroll_elasticity"
            }
          ],
          "id": "std_tuple"
        },
        "name": "getscrollelasticity",
        "parameters": [],
        "shortStr": "getscrollelasticity()",
        "str": "getscrollelasticity()"
      },
      "platform": [
        "macOS"
      ],
      "description": "Return the horizontal and vertical scroll elasticity.\n",
      "id": "getscrollelasticity"
    },
    {
      "signature": {
        "returnType": {
          "name": "RectF",
          "id": "rectf"
        },
        "name": "gettextbounds",
        "parameters": [],
        "shortStr": "gettextbounds()",
        "str": "gettextbounds()"
      },
      "description": "Return the text extend.",
      "id": "gettextbounds"
    }
  ],
  "events": [
    {
      "signature": {
        "name": "ontextchange",
        "parameters": [
          {
            "type": {
              "name": "TextEdit",
              "id": "textedit"
            },
            "name": "self"
          }
        ],
        "shortStr": "ontextchange(self)",
        "str": "ontextchange(self)"
      },
      "description": "Emitted when user has changed text.",
      "id": "ontextchange-self"
    }
  ],
  "delegates": [
    {
      "signature": {
        "returnType": {
          "name": "boolean"
        },
        "name": "shouldinsertnewline",
        "parameters": [
          {
            "type": {
              "name": "TextEdit",
              "id": "textedit"
            },
            "name": "self"
          }
        ],
        "shortStr": "shouldinsertnewline(self)",
        "str": "shouldinsertnewline(self)"
      },
      "description": "Called when user presses `Return` to insert new line, should return\nwhether it is allowed.\n",
      "id": "shouldinsertnewline-self"
    }
  ],
  "module": "yue.gui",
  "id": "textedit"
}