Loading...
Searching...
No Matches
text_input.h File Reference

GUI: TextInput keyboard view module API. More...

#include <gui/view.h>
#include "validators.h"

Go to the source code of this file.

Typedefs

typedef struct TextInput TextInput
 Text input anonymous structure.
 
typedef void(* TextInputCallback) (void *context)
 
typedef bool(* TextInputValidatorCallback) (const char *text, FuriString *error, void *context)
 

Functions

TextInputtext_input_alloc (void)
 Allocate and initialize text input.
 
void text_input_free (TextInput *text_input)
 Deinitialize and free text input.
 
void text_input_reset (TextInput *text_input)
 Clean text input view Note: this function does not free memory.
 
Viewtext_input_get_view (TextInput *text_input)
 Get text input view.
 
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.
 
void text_input_set_minimum_length (TextInput *text_input, size_t minimum_length)
 Sets the minimum length of a TextInput.
 
void text_input_set_validator (TextInput *text_input, TextInputValidatorCallback callback, void *callback_context)
 
TextInputValidatorCallback text_input_get_validator_callback (TextInput *text_input)
 
void * text_input_get_validator_callback_context (TextInput *text_input)
 
void text_input_set_header_text (TextInput *text_input, const char *text)
 Set text input header text.
 

Detailed Description

GUI: TextInput keyboard view module API.

Function Documentation

◆ text_input_alloc()

TextInput * text_input_alloc ( void )

Allocate and initialize text input.

This text input is used to enter string

Returns
TextInput instance

◆ text_input_free()

void text_input_free ( TextInput * text_input)

Deinitialize and free text input.

Parameters
text_inputTextInput instance

◆ text_input_get_view()

View * text_input_get_view ( TextInput * text_input)

Get text input view.

Parameters
text_inputTextInput instance
Returns
View instance that can be used for embedding

◆ text_input_reset()

void text_input_reset ( TextInput * text_input)

Clean text input view Note: this function does not free memory.

Parameters
text_inputText input instance

◆ text_input_set_header_text()

void text_input_set_header_text ( TextInput * text_input,
const char * text )

Set text input header text.

Parameters
text_inputTextInput instance
texttext to be shown

◆ text_input_set_minimum_length()

void text_input_set_minimum_length ( TextInput * text_input,
size_t minimum_length )

Sets the minimum length of a TextInput.

Parameters
[in]text_inputTextInput
[in]minimum_lengthMinimum input length

◆ text_input_set_result_callback()

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.

Parameters
text_inputTextInput instance
callbackcallback fn
callback_contextcallback context
text_bufferpointer to YOUR text buffer, that we going to modify
text_buffer_sizeYOUR text buffer size in bytes. Max string length will be text_buffer_size-1.
clear_default_textclear text from text_buffer on first OK event