flipperzero-firmware/applications/gui/modules/text_input.h
SG 0b14db4fb3
C++ apps: templated scene controller (#517)
* C++ apps: templated scene controller
* templated app: fix type names
* templated app: text store component
* Applications: add "Templated Scene" application
* templated app: refractoring
* Gui module byte input: fix docs
* templated app: new byte input scene
* templated app: dialog ex view module
* templated app: popup view module
* templated app: dialog-ex view module, fix docs
* templated app: text input view module
* Gui module text input: fix docs
* Furi: duplicated include
* templated app: record holder (controller) class
* templated app: view modules can now be accessed via cast
* templated app: remove unused includes
* templated app: fix return code
2021-06-15 14:01:56 +03:00

60 lines
1.3 KiB
C

#pragma once
#include <gui/view.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Text input anonymous structure */
typedef struct TextInput TextInput;
typedef void (*TextInputCallback)(void* context, char* text);
/**
* @brief Allocate and initialize text input
* This text input is used to enter string
*
*/
TextInput* text_input_alloc();
/**
* @brief Deinitialize and free text input
*
* @param text_input - Text input instance
*/
void text_input_free(TextInput* text_input);
/**
* @brief Get text input view
*
* @param text_input - Text input instance
* @return View instance that can be used for embedding
*/
View* text_input_get_view(TextInput* text_input);
/**
* @brief Set text input result callback
*
* @param text_input - Text input instance
* @param callback - callback fn
* @param callback_context - callback context
* @param text - text buffer to use
* @param max_text_length - text buffer length
*/
void text_input_set_result_callback(
TextInput* text_input,
TextInputCallback callback,
void* callback_context,
char* text,
uint8_t max_text_length);
/**
* @brief Set text input header text
*
* @param text input - Text input instance
* @param text - text to be shown
*/
void text_input_set_header_text(TextInput* text_input, const char* text);
#ifdef __cplusplus
}
#endif