API Reference

In this section we describe Kile's scripting programming interface.

Important

Please note that the scripting API has not been finalized yet. The API described below might change in future versions of Kile.

First of all, Kile's script execution environment provides a global object called "kile", which owns the following methods:

(kile).currentTextDocument()

Returns a KileTextDocument object which reflects the currently active text document. Returns null if no text document is active.

(kile).getInputValue(caption, label)

Opens a dialog with the given caption and label. Returns the value that user has entered.

Objects of the type KileTextDocument represent text documents in Kile. They have the following properties:

(KileTextDocument).backspace()

Deletes the character that is located immediately before the current cursor position and moves the cursor one position backward in the text.

(KileTextDocument).cursorLeft()

Moves the cursor one position backward in the text.

(KileTextDocument).cursorRight()

Moves the cursor one position forward in the text.

(KileTextDocument).insertText(text)

Inserts the text contained in the variable text into the document at the current cursor location.

(KileTextDocument).insertBullet()

Inserts a bullet into the document at the current cursor position.

(KileTextDocument).nextBullet()

Selects the first bullet located in the document immediately after the current cursor location.

(KileTextDocument).previousBullet()

Selects the first bullet located in the document immediately before the current cursor location.

(KileTextDocument).up()

Moves the cursor one line up in the document.

(KileTextDocument).down()

Moves the cursor one line down in the document.

(KileTextDocument).cursorLine()

Returns the line which the cursor is currently located at.

(KileTextDocument).cursorColumn()

Returns the column which the cursor is currently located at.

(KileTextDocument).setCursorLine(line)

Moves the cursor to the line denoted by line.

(KileTextDocument).setCursorColumn(column)

Moves the cursor to the column denoted by line.