summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/efl_canvas_text_cursor.eo
blob: a13061666e315c576d41bcc36e859e12f0ff6d4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
enum Efl.Canvas.Text.Cursor.Type
{
   before,
   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.
         ]]
         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: 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: 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 {
      .text_object;
   }
}