mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-22 12:51:39 +03:00
23ff6723cf
* bt: update connection parameters * bt: set correct connection latency and timeout * gui popup: add clean method * furi_hal_bt: add connection parameters request, clear database * bt: add forget bonded devices API * bt_settings: add forget bonded devices GUI * bt: rework pin code show with view port to hide view * bt: support conn parameters for different profiles * furi_hal_bt: sync f6 target * target f6: fix build * bt: format sources * furi_hal_bt: update connection parameters * bt: update connection params, fix GUI * FuriHal: fix spelling * Refactoring: rename _clean to _reset Co-authored-by: あく <alleteam@gmail.com>
95 lines
2.5 KiB
C
95 lines
2.5 KiB
C
/**
|
|
* @file button_menu.h
|
|
* GUI: ButtonMenu view module API
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <stdint.h>
|
|
#include <gui/view.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/** ButtonMenu anonymous structure */
|
|
typedef struct ButtonMenu ButtonMenu;
|
|
|
|
/** ButtonMenuItem anonymous structure */
|
|
typedef struct ButtonMenuItem ButtonMenuItem;
|
|
|
|
/** Callback for any button menu actions */
|
|
typedef void (*ButtonMenuItemCallback)(void* context, int32_t index, InputType type);
|
|
|
|
/** Type of button. Difference in drawing buttons. */
|
|
typedef enum {
|
|
ButtonMenuItemTypeCommon,
|
|
ButtonMenuItemTypeControl,
|
|
} ButtonMenuItemType;
|
|
|
|
/** Get button menu view
|
|
*
|
|
* @param button_menu ButtonMenu instance
|
|
*
|
|
* @return View instance that can be used for embedding
|
|
*/
|
|
View* button_menu_get_view(ButtonMenu* button_menu);
|
|
|
|
/** Clean button menu
|
|
*
|
|
* @param button_menu ButtonMenu instance
|
|
*/
|
|
void button_menu_reset(ButtonMenu* button_menu);
|
|
|
|
/** Add item to button menu instance
|
|
*
|
|
* @param button_menu ButtonMenu instance
|
|
* @param label text inside new button
|
|
* @param index value to distinct between buttons inside
|
|
* ButtonMenuItemCallback
|
|
* @param callback The callback
|
|
* @param type type of button to create. Differ by button
|
|
* drawing. Control buttons have no frames, and
|
|
* have more squared borders.
|
|
* @param callback_context The callback context
|
|
*
|
|
* @return pointer to just-created item
|
|
*/
|
|
ButtonMenuItem* button_menu_add_item(
|
|
ButtonMenu* button_menu,
|
|
const char* label,
|
|
int32_t index,
|
|
ButtonMenuItemCallback callback,
|
|
ButtonMenuItemType type,
|
|
void* callback_context);
|
|
|
|
/** Allocate and initialize new instance of ButtonMenu model
|
|
*
|
|
* @return just-created ButtonMenu model
|
|
*/
|
|
ButtonMenu* button_menu_alloc(void);
|
|
|
|
/** Free ButtonMenu element
|
|
*
|
|
* @param button_menu ButtonMenu instance
|
|
*/
|
|
void button_menu_free(ButtonMenu* button_menu);
|
|
|
|
/** Set ButtonMenu header on top of canvas
|
|
*
|
|
* @param button_menu ButtonMenu instance
|
|
* @param header header on the top of button menu
|
|
*/
|
|
void button_menu_set_header(ButtonMenu* button_menu, const char* header);
|
|
|
|
/** Set selected item
|
|
*
|
|
* @param button_menu ButtonMenu instance
|
|
* @param index index of ButtonMenu to be selected
|
|
*/
|
|
void button_menu_set_selected_item(ButtonMenu* button_menu, uint32_t index);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|