1 /**
2  * @file lv_textarea_private.h
3  *
4  */
5 
6 #ifndef LV_TEXTAREA_PRIVATE_H
7 #define LV_TEXTAREA_PRIVATE_H
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 /*********************
14  *      INCLUDES
15  *********************/
16 
17 #include "../../core/lv_obj_private.h"
18 #include "lv_textarea.h"
19 
20 #if LV_USE_TEXTAREA != 0
21 
22 /*********************
23  *      DEFINES
24  *********************/
25 
26 /**********************
27  *      TYPEDEFS
28  **********************/
29 
30 /** Data of text area */
31 struct _lv_textarea_t {
32     lv_obj_t obj;
33     lv_obj_t * label;            /**< Label of the text area */
34     char * placeholder_txt;      /**< Place holder label. only visible if text is an empty string */
35     char * pwd_tmp;              /**< Used to store the original text in password mode */
36     char * pwd_bullet;           /**< Replacement characters displayed in password mode */
37     const char * accepted_chars; /**< Only these characters will be accepted. NULL: accept all */
38     uint32_t max_length;         /**< The max. number of characters. 0: no limit */
39     uint32_t pwd_show_time;      /**< Time to show characters in password mode before change them to '*' */
40     struct {
41         int32_t valid_x;         /**< Used when stepping up/down to a shorter line.
42                                   *(Used by the library) */
43         uint32_t pos;            /**< The current cursor position
44                                   *(0: before 1st letter; 1: before 2nd letter ...) */
45         lv_area_t area;          /**< Cursor area relative to the Text Area */
46         uint32_t txt_byte_pos;   /**< Byte index of the letter after (on) the cursor */
47         uint8_t show : 1;        /**< Cursor is visible now or not (Handled by the library) */
48         uint8_t click_pos : 1;   /**< 1: Enable positioning the cursor by clicking the text area */
49     } cursor;
50 #if LV_LABEL_TEXT_SELECTION
51     uint32_t sel_start;           /**< Temporary values for text selection */
52     uint32_t sel_end;
53     uint8_t text_sel_in_prog : 1; /**< User is in process of selecting */
54     uint8_t text_sel_en : 1;      /**< Text can be selected on this text area */
55 #endif
56     uint8_t pwd_mode : 1;         /**< Replace characters with '*' */
57     uint8_t one_line : 1;         /**< One line mode (ignore line breaks) */
58 };
59 
60 
61 /**********************
62  * GLOBAL PROTOTYPES
63  **********************/
64 
65 /**********************
66  *      MACROS
67  **********************/
68 
69 #endif /* LV_USE_TEXTAREA != 0 */
70 
71 #ifdef __cplusplus
72 } /*extern "C"*/
73 #endif
74 
75 #endif /*LV_TEXTAREA_PRIVATE_H*/
76