summaryrefslogtreecommitdiff
path: root/src/lib/efl/interfaces/efl_text_cursor.eo
blob: 2baff113bfb379a56c116c605e0d30111c05b10e (plain) (blame)
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
import eina_types;
import efl_text_types;

enum Efl.Text.Cursor.Cursor_Get_Type {
   [[All available cursor states]]
   legacy: efl_text_cursor_get;
   default = 0,     [[Main cursor state (alias to "main")]]
   main,            [[Main cursor state]]
   selection_begin, [[Selection begin cursor state]]
   selection_end,   [[Selection end cursor state]]
   preedit_start,   [[Pre-edit start cursor state]]
   preedit_end,     [[Pre-edit end cursor starge]]
   user,            [[User cursor state]]
   user_extra       [[User extra cursor state]]
}

enum Efl.Text.Cursor.Cursor_Type
{
   [[Text cursor types]]
   legacy: efl_text_cursor_type;
   before, [[Cursor type before]]
   under [[Cursor type under]]
}

interface Efl.Text.Cursor {
   [[Cursor API

     @since 1.20
   ]]
   methods {
      // Cursor
      @property cursor {
         [[The object's main cursor.

           @since 1.18
         ]]
         get {
            legacy: null;
            return: ptr(Efl.Text.Cursor.Cursor); [[Text cursor object]]
         }
         keys {
            get_type: Efl.Text.Cursor.Cursor_Get_Type; [[Cursor type]]
         }
      }
      @property cursor_position {
      	 [[Cursor position]]
         set { legacy: null; }
         get { legacy: null; }
         values {
            position: int; [[Cursor position]]
         }
         keys {
            cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
         }
      }
      @property cursor_content {
         [[The content of the cursor (the character under the cursor)]]
         get {
            legacy: null;
         }
         values {
            content: Eina.Unicode; [[The unicode codepoint of the character]]
         }
         keys {
            cur: ptr(const(Efl.Text.Cursor.Cursor)); [[Cursor object]]
         }
      }
      @property cursor_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 {
            cur: ptr(const(Efl.Text.Cursor.Cursor)); [[Cursor object]]
            ctype: Efl.Text.Cursor.Cursor_Type; [[The type of the cursor.]]
         }
         values {
            cx: int; [[The x of the cursor (or upper cursor)]]
            cy: int; [[The y of the cursor (or upper cursor)]]
            cw: int; [[The width of the cursor (or upper cursor)]]
            ch: int; [[The height of the cursor (or upper cursor)]]
            cx2: int; [[The x of the lower cursor]]
            cy2: int; [[The y of the lower cursor]]
            cw2: int; [[The width of the lower cursor]]
            ch2: int; [[The height of the lower cursor]]
         }
      }
      cursor_new {
      	 [[Create new cursor]]
         legacy: null;
         return: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
      }
      cursor_free {
      	 [[Free existing cursor]]
         legacy: null;
         params {
            cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
         }
      }
      cursor_equal {
      	 [[Check if two cursors are equal]]
         legacy: null;
         params {
            cur1: ptr(const(Efl.Text.Cursor.Cursor)); [[Cursor 1 object]]
            cur2: ptr(const(Efl.Text.Cursor.Cursor)); [[Cursor 2 object]]
         }
         return: bool; [[$true if cursors are equal, $false otherwise]]
      }
      cursor_compare {
      	 [[Compare two cursors]]
         legacy: null;
         params {
            cur1: ptr(const(Efl.Text.Cursor.Cursor)); [[Cursor 1 object]]
            cur2: ptr(const(Efl.Text.Cursor.Cursor)); [[Cursor 2 object]]
         }
         return: int; [[Difference between cursors]]
      }
      cursor_copy {
      	 [[Copy existing cursor]]
         legacy: null;
         params {
            dst: ptr(Efl.Text.Cursor.Cursor); [[Destination cursor]]
            src: ptr(const(Efl.Text.Cursor.Cursor)); [[Source cursor]]
         }
      }
      cursor_char_next {
      	 [[Advances to the next character]]
         legacy: null;
         params {
            cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
         }
      }
      cursor_char_prev {
      	 [[Advances to the previous character]]
         legacy: null;
         params {
            cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
         }
      }
      cursor_paragraph_char_first {
      	 [[Advances to the first character in this paragraph]]
         legacy: null;
         params {
            cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
         }
      }
      cursor_paragraph_char_last {
      	 [[Advances to the last character in this paragraph]]
         legacy: null;
         params {
            cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
         }
      }
      cursor_word_start {
      	 [[Advance to current word start]]
         legacy: null;
         params {
            cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
         }
      }
      cursor_word_end {
      	 [[Advance to current word end]]
         legacy: null;
         params {
            cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
         }
      }
      cursor_line_char_first {
      	 [[Advance to current line first character]]
         legacy: null;
         params {
            cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
         }
      }
      cursor_line_char_last {
      	  [[Advance to current line last character]]
         legacy: null;
         params {
            cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
         }
      }
      cursor_paragraph_first {
      	 [[Advance to current paragraph first character]]
         legacy: null;
         params {
            cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
         }
      }
      cursor_paragraph_last {
      	 [[Advance to current paragraph last character]]
         legacy: null;
         params {
            cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
         }
      }
      cursor_paragraph_next {
         [[Advances to the start of the next text node]]
         legacy: null;
         params {
            cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
         }
      }
      cursor_paragraph_prev {
         [[Advances to the end of the previous text node]]
         legacy: null;
         params {
            cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
         }
      }
      cursor_line_jump_by {
      	 [[Jump the cursor by the given number of lines]]
         legacy: null;
         params {
            cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
            by: int; [[Number of lines]]
         }
      }
      cursor_coord_set {
      	 [[Set cursor coordinates]]
         legacy: null;
         params {
            cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
            @in x: int; [[X coord to set by.]]
            @in y: int; [[Y coord to set by.]]
         }
      }
      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 {
            cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
            @in text: string; [[Text to append (UTF-8 format).]]
         }
         return: int; [[Length of the appended text.]]
      }
      cursor_char_delete {
         [[Deletes a single character from position pointed by given cursor.]]
         legacy: null;
         params {
            cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
         }
      }
   }
}