unleashed-firmware/applications/gui/modules/text_box.h
gornekich 8cfd0eab9e
[FL-2198], [FL-2161] NFC emulation refactoring (#968)
* rfal: add state changed callback
* furi_hal_nfc: add NFC-A emulation API
* nfc: add emulation logger, refactor scenes
* elements: fix text_box element
* gui: fix text box module
* nfc: remove unnecessary buffers
* nfc: introduce emulation callback concept
* nfc: format sources
* bt settings: fix incorrect scene switch
* bt settings: format sources
* Debug: fix x2d import for python 3
* Gui: rename method name widget_clear to widget_reset
* nfc: add nfca emulation handler
* nfc: add global custom events enum
* nfc: UID emulation Data -> Log
* furi_hal_nfc: fix incorrect timings
* u2f, badusb: widget_clear() -> widget_reset()

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-02-02 22:59:28 +03:00

78 lines
1.4 KiB
C
Executable File

/**
* @file text_box.h
* GUI: TextBox view module API
*/
#pragma once
#include <gui/view.h>
#ifdef __cplusplus
extern "C" {
#endif
/** TextBox anonymous structure */
typedef struct TextBox TextBox;
typedef enum {
TextBoxFontText,
TextBoxFontHex,
} TextBoxFont;
typedef enum {
TextBoxFocusStart,
TextBoxFocusEnd,
} TextBoxFocus;
/** Allocate and initialize text_box
*
* @return TextBox instance
*/
TextBox* text_box_alloc();
/** Deinitialize and free text_box
*
* @param text_box text_box instance
*/
void text_box_free(TextBox* text_box);
/** Get text_box view
*
* @param text_box TextBox instance
*
* @return View instance that can be used for embedding
*/
View* text_box_get_view(TextBox* text_box);
/** Clean text_box
*
* @param text_box TextBox instance
*/
void text_box_reset(TextBox* text_box);
/** Set text for text_box
*
* @param text_box TextBox instance
* @param text text to set
*/
void text_box_set_text(TextBox* text_box, const char* text);
/** Set TextBox font
*
* @param text_box TextBox instance
* @param font TextBoxFont instance
*/
void text_box_set_font(TextBox* text_box, TextBoxFont font);
/** Set TextBox focus
* @note Use to display from start or from end
*
* @param text_box TextBox instance
* @param focus TextBoxFocus instance
*/
void text_box_set_focus(TextBox* text_box, TextBoxFocus focus);
#ifdef __cplusplus
}
#endif