efl/src/lib/evas/canvas/efl_canvas_text_cursor.eo

216 lines
6.7 KiB
Plaintext

enum Efl.Canvas.Text.Cursor.Type
{
[[Text cursor types]]
before, [[Cursor type before]]
under [[Cursor type under]]
}
class Efl.Canvas.Text.Cursor (Efl.Object)
{
legacy_prefix: evas_textblock_cursor;
methods {
@property text_object {
[[The text object the cursor is associated with.]]
set {
legacy: null;
}
get {
legacy: null;
}
values {
tb: const(Efl.Canvas.Object); [[The text object]] /* XXX: It should be textblock only. */
}
}
@property position {
[[Sets position of cursor to given pos. ]]
set {
legacy: evas_textblock_cursor_pos_set;
}
get {
legacy: evas_textblock_cursor_pos_get;
}
values {
position: int; [[Position in the text to move the cursor.]]
}
}
@property geometry {
[[Returns the geometry of two cursors ("split cursor"), if logical cursor is
between LTR/RTL text, also considering paragraph direction.
Upper cursor is shown for the text of the same direction as paragraph,
lower cursor - for opposite.
Split cursor geometry is valid only in '|' cursor mode.
In this case $true is returned and $cx2, $cy2, $cw2, $ch2 are set.
]]
get {
legacy: null;
return: bool; [[ $true if split cursor, $false otherwise.]]
}
keys {
ctype: Efl.Canvas.Text.Cursor.Type; [[ the type of the cursor.]]
}
values {
cx: Evas.Coord; [[the x of the cursor (or upper cursor)]]
cy: Evas.Coord; [[the y of the cursor (or upper cursor)]]
cw: Evas.Coord; [[the width of the cursor (or upper cursor)]]
ch: Evas.Coord; [[the height of the cursor (or upper cursor)]]
cx2: Evas.Coord; [[ the x of the lower cursor]]
cy2: Evas.Coord; [[ the y of the lower cursor]]
cw2: Evas.Coord; [[ the width of the lower cursor]]
ch2: Evas.Coord; [[ the height of the lower cursor]]
}
}
copy {
[[Copies source cursor.]]
legacy: null;
params {
@in src: const(Efl.Canvas.Text.Cursor); [[Source cursor.]]
}
}
text_insert {
[[Adds text to the current cursor position and set the cursor to *after*
the start of the text just added.
]]
legacy: null;
params {
@in text: string; [[Text to append (UTF-8 format).]]
}
return: int; [[Length of the appended text.]]
}
char_prev {
[[Advances the cursor one char backwards.]]
legacy: null;
}
char_next {
[[Advances the cursor one char forward.]]
legacy: null;
}
char_delete {
[[Deletes a single character from position pointed by given cursor.]]
}
paragraph_first {
[[Sets the cursor to the start of the first text node]]
}
paragraph_last {
[[Sets the cursor to the end of the last text node]]
}
paragraph_next {
[[Advances to the start of the next text node]]
legacy: null;
}
paragraph_prev {
[[Advances to the end of the previous text node]]
legacy: null;
}
paragraph_char_first {
[[Go to the first char in the node the cursor is pointing on.]]
}
paragraph_char_last {
[[Go to the last char in a text node.]]
}
word_start {
[[Moves the cursor to the start of the word under the cursor]]
legacy: null;
}
word_end {
[[Moves the cursor to the end of the word under the cursor]]
legacy: null;
}
line_char_first {
[[Go to the start of the current line]]
}
line_char_last {
[[Go to the end of the current line]]
}
line_jump_by {
[[Move the cursor $by lines up if negative, down if positive.
If jumping by $by means jumping outside of the textblock, move the
cursor before the first char of the textblock if jumping up, and
after the last if jumping down.
]]
legacy: null;
params {
by: int; [[How many lines to jump by. Negative values are also supported.]]
}
}
@property content {
[[The content of the cursor (the character under the cursor)]]
get {
legacy: null;
}
values {
content: Eina.Unicode; [[The unicode codepoint of the character]]
}
}
compare @const {
[[Compares two cursors.
Note that 0 will be returned if they are cursors of different
textblock objects.
See @.equal for a faster equality check.
]]
return: int; [[-1 if cur1 < cur2, 0 if cur1 == cur2, 1 otherwise.]]
params {
@in cur: const(Efl.Canvas.Text.Cursor); [[The second cursor.]]
}
}
equal @const {
[[Checks if two cursors are equal
This is faster than @.compare so it should be used if all we care
about is equality.
@since 1.18
]]
return: bool; [[$true if equal]]
params {
@in cur: const(Efl.Canvas.Text.Cursor); [[The second cursor.]]
}
}
coord_set {
[[Sets the position of the cursor according to the X and Y coordinates.]]
legacy: null;
params {
@in x: Evas.Coord; [[x coord to set by.]]
@in y: Evas.Coord; [[y coord to set by.]]
}
}
@property object_item_annotation {
[[The object-item annotation at the cursor's position.]]
get {
legacy: null;
}
values {
annotation: ptr(Efl.Canvas.Text.Annotation);
}
}
object_item_insert {
[[Inserts a object item at specified position.
This adds a placeholder to be queried by higher-level code,
which in turn place graphics on top of it. It essentially places an
OBJECT REPLACEMENT CHARACTER and set a special annotation to it.
]]
legacy: null;
params {
@in format: string; [[Format of the inserted item.
See Format styles.]]
}
return: ptr(Efl.Canvas.Text.Annotation); [[The annotation handle of the
inserted item.]]
}
}
implements {
Efl.Object.destructor;
Efl.Object.finalize;
}
events {
changed; [[The cursor position has changed]]
}
constructors {
Efl.Canvas.Text.Cursor.text_object;
}
}