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

interface @beta Efl.Text_Annotate {
   [[Cursor API
   ]]
   c_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.
         ]]
         set {
            return: bool; [[$true on success, $false otherwise.]]
         }
         get {
         }
         keys {
            annotation: ptr(Efl.Text_Annotate_Annotation); [[Given annotation]]
         }
         values {
            format: string; [[The new format for the given annotation]]
         }
      }
      range_annotations_get @const {
         [[Returns an iterator of all the handles in a range.
         ]]
         params {
              @in start: ptr(const(Efl.Text_Cursor_Handle)); [[Start of range]]
              @in end:   ptr(const(Efl.Text_Cursor_Handle)); [[End of range]]
         }
         return: iterator<ptr(Efl.Text_Annotate_Annotation)> @move; [[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.
         ]]
         params {
              @in start: ptr(Efl.Text_Cursor_Handle); [[Start of range]]
              @in end:   ptr(Efl.Text_Cursor_Handle); [[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.
         ]]
         params {
            @in annotation: ptr(Efl.Text_Annotate_Annotation); [[Annotation to be
                removed]]
         }
         return: bool; [[$true on success, $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.
         ]]
         params {
             @in annotation: ptr(const(Efl.Text_Annotate_Annotation)); [[Annotation
                 handle to query]]
             @in start: ptr(Efl.Text_Cursor_Handle); [[Cursor to be set to the start
             position of the annotation in the text]]
             @in end: ptr(Efl.Text_Cursor_Handle); [[Cursor to be set to the end
             position of the annotation in the text]]
         }
      }
      annotation_is_item {
         [[Whether this is an "item" type of annotation. Should be used before
           querying the annotation's geometry, as only "item" annotations have
           a geometry.

           see @.cursor_item_insert
           see @.item_geometry_get
         ]]
         params {
            annotation: ptr(Efl.Text_Annotate_Annotation); [[Given annotation]]
         }
         return: bool; [[$true if given annotation is an object item, $false otherwise]]
      }
      item_geometry_get {
         [[Queries a given object item for its geometry.

           Note that the provided annotation should be an object item type.
         ]]
         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]]
      }
      // Cursor
      @property cursor_item_annotation {
         [[The object-item annotation at the cursor's position.]]
         get {
         }
         values {
            annotation: ptr(Efl.Text_Annotate_Annotation); [[Annotation]]
         }
         keys {
            cur: ptr(Efl.Text_Cursor_Handle); [[Cursor object]]
         }
      }
      cursor_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.
         ]]
         params {
            cur: ptr(Efl.Text_Cursor_Handle); [[Cursor object]]
            @in item: string;   [[Item key to be used in higher-up
                                  code to query and decided what image, emoticon
                                  etc. to embed.]]
            @in format: string; [[Size format of the inserted item.
                                  This hints how to size the item in the text.]]
         }
         return: ptr(Efl.Text_Annotate_Annotation); [[The annotation handle of the
         inserted item.]]
      }
   }
}