flipperzero-firmware/applications/gui/modules/text_box.h
gornekich 20fe544b4f
[FL-1501] NFC: read Mifare Ultralight (#571)
* nfc: add scripts menu scene
* canvas: add glyph width api
* app_scene: add state to Scene template
* gui: introduce TextBox view
* nfc: add mifare ultralight read scenes
* nfc: add mifare ultralight menu scene
* nfc: fix scene functions declaration
* Gui: use size_t for sizes.

Co-authored-by: あく <alleteam@gmail.com>
2021-07-08 23:41:34 +03:00

64 lines
1.4 KiB
C

#pragma once
#include <gui/view.h>
#ifdef __cplusplus
extern "C" {
#endif
/* TextBox anonymous structure */
typedef struct TextBox TextBox;
typedef void (*TextBoxExitCallback)(void* context);
typedef enum {
TextBoxFontText,
TextBoxFontHex,
} TextBoxFont;
/** Allocate and initialize text_box
*/
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_clean(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 text_box context
* @param text_box TextBox instance
* @param context context pointer
*/
void text_box_set_context(TextBox* text_box, void* context);
/** Set exit callback
* @param text_box TextBox instance
* @param callback TextBoxExitCallback callback pointer
*/
void text_box_set_exit_callback(TextBox* text_box, TextBoxExitCallback callback);
#ifdef __cplusplus
}
#endif