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
73void text_input_set_minimum_length(TextInput* text_input, size_t minimum_length);
74
75void text_input_set_validator(
76 TextInput* text_input,
77 TextInputValidatorCallback callback,
78 void* callback_context);
79
80TextInputValidatorCallback text_input_get_validator_callback(TextInput* text_input);
81
82void* text_input_get_validator_callback_context(TextInput* text_input);
83
89void text_input_set_header_text(TextInput* text_input, const char* text);
90
91#ifdef __cplusplus
92}
93#endif
Definition string.c:4
Definition services/gui/modules/text_input.c:6
Definition view_i.h:16
TextInput * text_input_alloc(void)
Allocate and initialize text input.
Definition services/gui/modules/text_input.c:443
void text_input_set_header_text(TextInput *text_input, const char *text)
Set text input header text.
Definition services/gui/modules/text_input.c:581
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 services/gui/modules/text_input.c:510
View * text_input_get_view(TextInput *text_input)
Get text input view.
Definition services/gui/modules/text_input.c:505
void text_input_set_minimum_length(TextInput *text_input, size_t minimum_length)
Sets the minimum length of a TextInput.
Definition services/gui/modules/text_input.c:536
void text_input_reset(TextInput *text_input)
Clean text input view Note: this function does not free memory.
Definition services/gui/modules/text_input.c:482
void text_input_free(TextInput *text_input)
Deinitialize and free text input.
Definition services/gui/modules/text_input.c:464
GUI: View API.