mikroSDK Reference Manual
lv_span.h
Go to the documentation of this file.
1
6#ifndef LV_SPAN_H
7#define LV_SPAN_H
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13/*********************
14 * INCLUDES
15 *********************/
16#include "../../../lvgl.h"
17
18#if LV_USE_SPAN != 0
19
20/*********************
21 * DEFINES
22 *********************/
23#ifndef LV_SPAN_SNIPPET_STACK_SIZE
24#define LV_SPAN_SNIPPET_STACK_SIZE 64
25#endif
26
27/**********************
28 * TYPEDEFS
29 **********************/
30enum {
31 LV_SPAN_OVERFLOW_CLIP,
32 LV_SPAN_OVERFLOW_ELLIPSIS,
33};
34typedef uint8_t lv_span_overflow_t;
35
36enum {
37 LV_SPAN_MODE_FIXED,
38 LV_SPAN_MODE_EXPAND,
39 LV_SPAN_MODE_BREAK,
40};
41typedef uint8_t lv_span_mode_t;
42
43typedef struct {
44 char * txt; /* a pointer to display text */
45 lv_obj_t * spangroup; /* a pointer to spangroup */
46 lv_style_t style; /* display text style */
47 uint8_t static_flag : 1;/* the text is static flag */
48} lv_span_t;
49
51typedef struct {
52 lv_obj_t obj;
53 int32_t lines;
54 lv_coord_t indent; /* first line indent */
55 lv_coord_t cache_w; /* the cache automatically calculates the width */
56 lv_coord_t cache_h; /* similar cache_w */
57 lv_ll_t child_ll;
58 uint8_t mode : 2; /* details see lv_span_mode_t */
59 uint8_t overflow : 1; /* details see lv_span_overflow_t */
60 uint8_t refresh : 1; /* the spangroup need refresh cache_w and cache_h */
61} lv_spangroup_t;
62
63extern const lv_obj_class_t lv_spangroup_class;
64
65/**********************
66 * GLOBAL PROTOTYPES
67 **********************/
68
74lv_obj_t * lv_spangroup_create(lv_obj_t * par);
75
81lv_span_t * lv_spangroup_new_span(lv_obj_t * obj);
82
88void lv_spangroup_del_span(lv_obj_t * obj, lv_span_t * span);
89
90/*=====================
91 * Setter functions
92 *====================*/
93
99void lv_span_set_text(lv_span_t * span, const char * text);
100
107void lv_span_set_text_static(lv_span_t * span, const char * text);
108
114void lv_spangroup_set_align(lv_obj_t * obj, lv_text_align_t align);
115
121void lv_spangroup_set_overflow(lv_obj_t * obj, lv_span_overflow_t overflow);
122
128void lv_spangroup_set_indent(lv_obj_t * obj, lv_coord_t indent);
129
135void lv_spangroup_set_mode(lv_obj_t * obj, lv_span_mode_t mode);
136
142void lv_spangroup_set_lines(lv_obj_t * obj, int32_t lines);
143
144/*=====================
145 * Getter functions
146 *====================*/
147
160lv_span_t * lv_spangroup_get_child(const lv_obj_t * obj, int32_t id);
161
167uint32_t lv_spangroup_get_child_cnt(const lv_obj_t * obj);
168
174lv_text_align_t lv_spangroup_get_align(lv_obj_t * obj);
175
181lv_span_overflow_t lv_spangroup_get_overflow(lv_obj_t * obj);
182
188lv_coord_t lv_spangroup_get_indent(lv_obj_t * obj);
189
194lv_span_mode_t lv_spangroup_get_mode(lv_obj_t * obj);
195
201int32_t lv_spangroup_get_lines(lv_obj_t * obj);
202
207lv_coord_t lv_spangroup_get_max_line_h(lv_obj_t * obj);
208
216uint32_t lv_spangroup_get_expand_width(lv_obj_t * obj, uint32_t max_width);
217
222lv_coord_t lv_spangroup_get_expand_height(lv_obj_t * obj, lv_coord_t width);
223
224
225/*=====================
226 * Other functions
227 *====================*/
228
233void lv_spangroup_refr_mode(lv_obj_t * obj);
234
235/**********************
236 * MACROS
237 **********************/
238
239#endif /*LV_USE_SPAN*/
240
241#ifdef __cplusplus
242} /* extern "C" */
243#endif
244
245#endif /*LV_SPAN_H*/
Definition lv_obj_class.h:49
Definition lv_obj.h:174
Definition lv_ll.h:32
Definition lv_style.h:318