summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/efl_canvas_textblock_eo.legacy.h
blob: 536937b32b7b57684592a7bd526e01195ee049f5 (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
213
214
215
216
217
218
219
220
221
222
#ifndef _EFL_CANVAS_TEXTBLOCK_EO_LEGACY_H_
#define _EFL_CANVAS_TEXTBLOCK_EO_LEGACY_H_

#ifndef _EFL_CANVAS_TEXTBLOCK_EO_CLASS_TYPE
#define _EFL_CANVAS_TEXTBLOCK_EO_CLASS_TYPE

typedef Eo Efl_Canvas_Textblock;

#endif

#ifndef _EFL_CANVAS_TEXTBLOCK_EO_TYPES
#define _EFL_CANVAS_TEXTBLOCK_EO_TYPES


#endif


/**
 * @brief Returns the currently visible range.
 *
 * The given @c start and @c end cursor act like out-variables here, as they
 * are set to the positions of the start and the end of the visible range in
 * the text, respectively.
 *
 * @param[in] obj The object.
 * @param[in] start Range start position
 * @param[in] end Range end position
 *
 * @return @c true on success, @c false otherwise
 *
 * @since 1.18
 *
 * @ingroup Evas_Object_Textblock_Group
 */
EAPI Eina_Bool evas_object_textblock_visible_range_get(Efl_Canvas_Textblock *obj, Efl_Text_Cursor_Cursor *start, Efl_Text_Cursor_Cursor *end);

/**
 * @brief Gets the left, right, top and bottom insets of the text.
 *
 * The inset is any applied padding on the text.
 *
 * @param[in] obj The object.
 * @param[out] left The left padding
 * @param[out] right The right padding
 * @param[out] top The top padding
 * @param[out] bottom The bottom padding
 *
 * @since 1.18
 *
 * @ingroup Evas_Object_Textblock_Group
 */
EAPI void evas_object_textblock_style_insets_get(const Efl_Canvas_Textblock *obj, int *left, int *right, int *top, int *bottom);

/**
 * @brief BiDi delimiters are used for in-paragraph separation of bidi
 * segments. This is useful, for example, in the recipient fields of e-mail
 * clients where bidi oddities can occur when mixing RTL and LTR.
 *
 * @param[in] obj The object.
 * @param[in] delim A null terminated string of delimiters, e.g ",|" or @c null
 * if empty
 *
 * @since 1.18
 *
 * @ingroup Evas_Object_Textblock_Group
 */
EAPI void evas_object_textblock_bidi_delimiters_set(Efl_Canvas_Textblock *obj, const char *delim);

/**
 * @brief BiDi delimiters are used for in-paragraph separation of bidi
 * segments. This is useful, for example, in the recipient fields of e-mail
 * clients where bidi oddities can occur when mixing RTL and LTR.
 *
 * @param[in] obj The object.
 *
 * @return A null terminated string of delimiters, e.g ",|" or @c null if empty
 *
 * @since 1.18
 *
 * @ingroup Evas_Object_Textblock_Group
 */
EAPI const char *evas_object_textblock_bidi_delimiters_get(const Efl_Canvas_Textblock *obj);

/**
 * @brief When @c true, newline character will behave as a paragraph separator.
 *
 * @param[in] obj The object.
 * @param[in] mode @c true for legacy mode, @c false otherwise
 *
 * @since 1.18
 *
 * @ingroup Evas_Object_Textblock_Group
 */
EAPI void evas_object_textblock_legacy_newline_set(Efl_Canvas_Textblock *obj, Eina_Bool mode);

/**
 * @brief When @c true, newline character will behave as a paragraph separator.
 *
 * @param[in] obj The object.
 *
 * @return @c true for legacy mode, @c false otherwise
 *
 * @since 1.18
 *
 * @ingroup Evas_Object_Textblock_Group
 */
EAPI Eina_Bool evas_object_textblock_legacy_newline_get(const Efl_Canvas_Textblock *obj);



/**
 * @brief The formatted width and height.
 *
 * This calculates the actual size after restricting the textblock to the
 * current size of the object.
 *
 * The main difference between this and
 * @ref evas_object_textblock_size_native_get is that the "native" function
 * does not wrapping into account it just calculates the real width of the
 * object if it was placed on an infinite canvas, while this function gives the
 * size after wrapping according to the size restrictions of the object.
 *
 * For example for a textblock containing the text: "You shall not pass!" with
 * no margins or padding and assuming a monospace font and a size of 7x10 char
 * widths (for simplicity) has a native size of 19x1 and a formatted size of
 * 5x4.
 *
 * @param[in] obj The object.
 * @param[out] width The width of the object.
 * @param[out] height The height of the object.
 *
 * @since 1.18
 *
 * @ingroup Evas_Object_Textblock_Group
 */
EAPI void evas_object_textblock_size_formatted_get(const Efl_Canvas_Textblock *obj, int *width, int *height);

/**
 * @brief The native width and height.
 *
 * This calculates the actual size without taking account the current size of
 * the object.
 *
 * The main difference between this and
 * @ref evas_object_textblock_size_formatted_get is that the "native" function
 * does not take wrapping into account it just calculates the real width of the
 * object if it was placed on an infinite canvas, while the "formatted"
 * function gives the size after  wrapping text according to the size
 * restrictions of the object.
 *
 * For example for a textblock containing the text: "You shall not pass!" with
 * no margins or padding and assuming a monospace font and a size of 7x10 char
 * widths (for simplicity) has a native size of 19x1 and a formatted size of
 * 5x4.
 *
 * @param[in] obj The object.
 * @param[out] width The width returned.
 * @param[out] height The height returned.
 *
 * @since 1.18
 *
 * @ingroup Evas_Object_Textblock_Group
 */
EAPI void evas_object_textblock_size_native_get(const Efl_Canvas_Textblock *obj, int *width, int *height);





/**
 * @brief Add obstacle evas object @c eo_obs to be observed during layout of
 * text.
 *
 * The textblock does the layout of the text according to the position of the
 * obstacle.
 *
 * @param[in] obj The object.
 * @param[in] eo_obs Obstacle object
 *
 * @return @c true on success, @c false otherwise.
 *
 * @since 1.18
 *
 * @ingroup Evas_Object_Textblock_Group
 */
EAPI Eina_Bool evas_object_textblock_obstacle_add(Efl_Canvas_Textblock *obj, Efl_Canvas_Object *eo_obs);

/**
 * @brief Removes @c eo_obs from observation during text layout.
 *
 * @param[in] obj The object.
 * @param[in] eo_obs Obstacle object
 *
 * @return @c true on success, @c false otherwise.
 *
 * @since 1.18
 *
 * @ingroup Evas_Object_Textblock_Group
 */
EAPI Eina_Bool evas_object_textblock_obstacle_del(Efl_Canvas_Textblock *obj, Efl_Canvas_Object *eo_obs);

/**
 * @brief Triggers for relayout due to obstacles' state change.
 *
 * The obstacles alone don't affect the layout, until this is called. Use this
 * after doing changes (moving, positioning etc.) in the obstacles that you
 *  would like to be considered in the layout.
 *
 * For example: if you have just repositioned the obstacles to differrent
 * coordinates relative to the textblock, you need to call this so it will
 * consider this new state and will relayout the text.
 *
 * @param[in] obj The object.
 *
 * @since 1.18
 *
 * @ingroup Evas_Object_Textblock_Group
 */
EAPI void evas_object_textblock_obstacles_update(Efl_Canvas_Textblock *obj);


#endif