flipperzero-firmware/applications/gui/modules/byte_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

76 lines
1.7 KiB
C

#pragma once
#include <gui/view.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Byte input anonymous structure
*
*/
typedef struct ByteInput ByteInput;
/**
* @brief callback that is executed on save button press
*
*/
typedef void (*ByteInputCallback)(void* context, uint8_t* bytes, uint8_t bytes_count);
/**
* @brief callback that is executed when byte buffer is changed
*
*/
typedef void (*ByteChangedCallback)(void* context, uint8_t* bytes, uint8_t bytes_count);
/**
* @brief Allocate and initialize byte input. This byte input is used to enter bytes.
*
* @return ByteInput instance pointer
*/
ByteInput* byte_input_alloc();
/**
* @brief Deinitialize and free byte input
*
* @param byte_input Byte input instance
*/
void byte_input_free(ByteInput* byte_input);
/**
* @brief Get byte input view
*
* @param byte_input byte input instance
* @return View instance that can be used for embedding
*/
View* byte_input_get_view(ByteInput* byte_input);
/**
* @brief Set byte input result callback
*
* @param byte_input byte input instance
* @param input_callback input callback fn
* @param changed_callback changed callback fn
* @param callback_context callback context
* @param bytes buffer to use
* @param bytes_count buffer length
*/
void byte_input_set_result_callback(
ByteInput* byte_input,
ByteInputCallback input_callback,
ByteChangedCallback changed_callback,
void* callback_context,
uint8_t* bytes,
uint8_t bytes_count);
/**
* @brief Set byte input header text
*
* @param byte_input byte input instance
* @param text text to be shown
*/
void byte_input_set_header_text(ByteInput* byte_input, const char* text);
#ifdef __cplusplus
}
#endif