summaryrefslogtreecommitdiff
path: root/src/lib/efl/interfaces/efl_text_annotate.eo
blob: 002505356c31b703083867d1f4fc64bbe6829672 (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
import eina_types;
import efl_text_types;

interface Efl.Text.Annotate {
   [[Cursor API

     @since 1.20
   ]]
   eo_prefix: efl_text;
   methods {
      // Annotation
      @property annotation {
         [[A new format for $annotation.

           This will replace the format applied by $annotation with $format.
           Assumes that $annotation is a handle for an existing annotation,
           i.e. one that was added using @.annotation_insert to this object.
           Otherwise, this will fail and return $false.

           @since 1.18
         ]]
         set {
            legacy: null;
            return: bool; [[$true on success, $false otherwise.]]
         }
         get {
            legacy: null;
         }
         keys {
            annotation: ptr(Efl.Text.Annotate.Annotation); [[Given annotation]]
         }
         values {
            format: string; [[The new format for the given annotation]]
         }
      }
      range_annotations_get {
         [[Returns an iterator of all the handles in a range.

           @since 1.18
         ]]
         legacy: null;
         params {
              @in start: ptr(const(Efl.Text.Cursor.Cursor)); [[Start of range]]
              @in end:   ptr(const(Efl.Text.Cursor.Cursor)); [[End of range]]
         }
         return: iterator<ptr(Efl.Text.Annotate.Annotation)> @owned; [[Handle of the Annotation]]
      }
      annotation_insert {
         [[Inserts an annotation format in a specified range [$start, $end - 1].

           The $format will be applied to the given range, and the $annotation
           handle will be returned for further handling.

           @since 1.18
         ]]
         legacy: null;
         params {
              @in start: ptr(Efl.Text.Cursor.Cursor); [[Start of range]]
              @in end:   ptr(Efl.Text.Cursor.Cursor); [[End of range]]
              @in format: string; [[Annotation format]]
         }
         return: ptr(Efl.Text.Annotate.Annotation); [[Handle of inserted annotation]]
      }
      annotation_del {
         [[Deletes given annotation.

           All formats applied by $annotation will be removed and it will be
           deleted.

           @since 1.18
         ]]
         legacy: null;
         params {
            @in annotation: ptr(Efl.Text.Annotate.Annotation); [[Annotation to be
                removed]]
         }
         return: bool; [[$true on success, $false otherwise.]]
      }
      object_item_geometry_get {
         [[Queries a given object item for its geometry.

           Note that the provided annotation should be an object item type.

           @since 1.18
         ]]
         legacy: null;
         params {
            @in an: ptr(const(Efl.Text.Annotate.Annotation)); [[Given annotation to query]]
            @out x: int; [[X coordinate of the annotation]]
            @out y: int; [[Y coordinate of the annotation]]
            @out w: int; [[Width of the annotation]]
            @out h: int; [[Height of the annotation]]
         }
         return: bool; [[$true if given annotation is an object item, $false otherwise]]
      }
      annotation_positions_get {
         [[Sets given cursors to the start and end positions of the annotation.

           The cursors $start and $end will be set to the start and end
           positions of the given annotation $annotation.

           @since 1.18
         ]]
         legacy: null;
         params {
             @in annotation: ptr(const(Efl.Text.Annotate.Annotation)); [[Annotation
                 handle to query]]
             @in start: ptr(Efl.Text.Cursor.Cursor); [[Cursor to be set to the start
             position of the annotation in the text]]
             @in end: ptr(Efl.Text.Cursor.Cursor); [[Cursor to be set to the end
             position of the annotation in the text]]
         }
      }
      // Cursor
      @property cursor_object_item_annotation {
         [[The object-item annotation at the cursor's position.]]
         get {
            legacy: null;
         }
         values {
            annotation: ptr(Efl.Text.Annotate.Annotation); [[Annotation]]
         }
         keys {
            cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
         }
      }
      cursor_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 {
            cur: ptr(Efl.Text.Cursor.Cursor); [[Cursor object]]
            @in format: string; [[Format of the inserted item.
            See Format styles.]]
         }
         return: ptr(Efl.Text.Annotate.Annotation); [[The annotation handle of the
         inserted item.]]
      }
   }
}