Loading...
Searching...
No Matches
text_input.h
Go to the documentation of this file.
1
6#pragma once
7
8#include <gui/view.h>
9#include "validators.h"
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
16typedef struct TextInput TextInput;
17typedef void (*TextInputCallback)(void* context);
18typedef bool (*TextInputValidatorCallback)(const char* text, FuriString* error, void* context);
19
27
32void text_input_free(TextInput* text_input);
33
38void text_input_reset(TextInput* text_input);
39
47
61 TextInput* text_input,
62 TextInputCallback callback,
63 void* callback_context,
64 char* text_buffer,
65 size_t text_buffer_size,
66 bool clear_default_text);
67
68void text_input_set_validator(
69 TextInput* text_input,
70 TextInputValidatorCallback callback,
71 void* callback_context);
72
73TextInputValidatorCallback text_input_get_validator_callback(TextInput* text_input);
74
75void* text_input_get_validator_callback_context(TextInput* text_input);
76
82void text_input_set_header_text(TextInput* text_input, const char* text);
83
84#ifdef __cplusplus
85}
86#endif
Definition string.c:4
Definition text_input.c:6
Definition view_i.h:16
TextInput * text_input_alloc(void)
Allocate and initialize text input.
Definition text_input.c:442
void text_input_set_header_text(TextInput *text_input, const char *text)
Set text input header text.
Definition text_input.c:571
void text_input_set_result_callback(TextInput *text_input, TextInputCallback callback, void *callback_context, char *text_buffer, size_t text_buffer_size, bool clear_default_text)
Set text input result callback.
Definition text_input.c:508
View * text_input_get_view(TextInput *text_input)
Get text input view.
Definition text_input.c:503
void text_input_reset(TextInput *text_input)
Clean text input view Note: this function does not free memory.
Definition text_input.c:481
void text_input_free(TextInput *text_input)
Deinitialize and free text input.
Definition text_input.c:463
GUI: View API.