26#define NBGL_NO_TUNE NB_TUNES
27#define NBGL_NO_PROGRESS_INDICATOR 0xFF
30#define NBGL_INVALID_TOKEN 0xFF
37#if defined(TARGET_STAX)
38#define NB_MAX_SUGGESTION_BUTTONS 12
40#define NB_MAX_VISIBLE_SUGGESTION_BUTTONS 4
41#define TOUCHABLE_HEADER_BAR_HEIGHT 88
42#define SMALL_FOOTER_HEIGHT 88
43#define SIMPLE_FOOTER_HEIGHT 92
44#define SMALL_CENTERING_HEADER 32
45#define MEDIUM_CENTERING_HEADER 56
46#define LARGE_CENTERING_HEADER 56
47#define MEDIUM_CENTERING_FOOTER 88
48#define LONG_PRESS_BUTTON_HEIGHT 128
49#define UP_FOOTER_BUTTON_HEIGHT 120
50#define ACTION_AND_FOOTER_FOOTER_HEIGHT 216
51#define BOTH_ROUNDED_FOOTER_HEIGHT 216
53#define LIST_ITEM_MIN_TEXT_HEIGHT 40
54#define LIST_ITEM_PRE_HEADING 28
55#define LIST_ITEM_PRE_HEADING_LARGE 28
56#define LIST_ITEM_HEADING_SUB_TEXT 12
58#define PRE_TAG_VALUE_MARGIN 24
59#define INTER_TAG_VALUE_MARGIN 12
61#define PROGRESSBAR_WIDTH 120
62#define PROGRESSBAR_HEIGHT 12
63#define BACK_KEY_WIDTH 88
64#define ICON_TITLE_MARGIN 24
65#define TITLE_DESC_MARGIN 16
67#elif defined(TARGET_FLEX)
68#define NB_MAX_SUGGESTION_BUTTONS 8
70#define NB_MAX_VISIBLE_SUGGESTION_BUTTONS 2
71#define TOUCHABLE_HEADER_BAR_HEIGHT 96
72#define SMALL_FOOTER_HEIGHT 96
73#define SIMPLE_FOOTER_HEIGHT 96
74#define SMALL_CENTERING_HEADER 40
75#define MEDIUM_CENTERING_HEADER 64
76#define LARGE_CENTERING_HEADER 64
77#define MEDIUM_CENTERING_FOOTER 64
78#define LONG_PRESS_BUTTON_HEIGHT 152
79#define UP_FOOTER_BUTTON_HEIGHT 136
80#define ACTION_AND_FOOTER_FOOTER_HEIGHT 232
81#define BOTH_ROUNDED_FOOTER_HEIGHT 232
83#define LIST_ITEM_MIN_TEXT_HEIGHT SMALL_ICON_SIZE
84#define LIST_ITEM_PRE_HEADING 26
85#define LIST_ITEM_PRE_HEADING_LARGE 30
86#define LIST_ITEM_HEADING_SUB_TEXT 12
88#define PRE_TAG_VALUE_MARGIN 0
89#define INTER_TAG_VALUE_MARGIN 24
91#define PROGRESSBAR_WIDTH 120
92#define PROGRESSBAR_HEIGHT 12
93#define BACK_KEY_WIDTH 104
94#define ICON_TITLE_MARGIN 24
95#define TITLE_DESC_MARGIN 16
97#elif defined(TARGET_APEX)
98#define NB_MAX_SUGGESTION_BUTTONS 8
100#define NB_MAX_VISIBLE_SUGGESTION_BUTTONS 2
101#define TOUCHABLE_HEADER_BAR_HEIGHT 60
102#define SMALL_FOOTER_HEIGHT 60
103#define SIMPLE_FOOTER_HEIGHT 60
104#define SMALL_CENTERING_HEADER 24
105#define MEDIUM_CENTERING_HEADER 40
106#define LARGE_CENTERING_HEADER 60
107#define MEDIUM_CENTERING_FOOTER 40
108#define LONG_PRESS_BUTTON_HEIGHT 88
109#define UP_FOOTER_BUTTON_HEIGHT 88
110#define ACTION_AND_FOOTER_FOOTER_HEIGHT 128
111#define BOTH_ROUNDED_FOOTER_HEIGHT 148
113#define LIST_ITEM_MIN_TEXT_HEIGHT SMALL_ICON_SIZE
114#define LIST_ITEM_PRE_HEADING 22
115#define LIST_ITEM_PRE_HEADING_LARGE 22
116#define LIST_ITEM_HEADING_SUB_TEXT 8
118#define PRE_TAG_VALUE_MARGIN 0
119#define INTER_TAG_VALUE_MARGIN 16
121#define PROGRESSBAR_WIDTH 78
122#define PROGRESSBAR_HEIGHT 8
123#define BACK_KEY_WIDTH 56
124#define ICON_TITLE_MARGIN 16
125#define TITLE_DESC_MARGIN 12
128#error Undefined target
131#define TAG_VALUE_INTERVALE 4
132#define VALUE_ICON_INTERVALE 12
134#define AVAILABLE_WIDTH (SCREEN_WIDTH - 2 * BORDER_MARGIN)
137#define NB_MAX_LINES 12
141#define NB_MAX_SUGGESTION_BUTTONS 8
143#define AVAILABLE_WIDTH (SCREEN_WIDTH - 2 * 7)
145#define NB_MAX_LINES 4
149#define SPINNER_FIXED 0xFF
151#define NB_MAX_DESCRIPTIONS 3
240 const char *tapActionText;
241 uint8_t tapActionToken;
243 tune_index_e tapTuneId;
301typedef const char *(*nbgl_menuListCallback_t)(uint8_t choiceIndex);
410} nbgl_layoutQRCode_t;
417 ROUNDED_AND_FOOTER_STYLE = 0,
418 STRONG_ACTION_AND_FOOTER_STYLE,
419 SOFT_ACTION_AND_FOOTER_STYLE,
421} nbgl_layoutChoiceButtonsStyle_t;
430 const char *bottomText;
433 nbgl_layoutChoiceButtonsStyle_t style;
435} nbgl_layoutChoiceButtons_t;
445 const char *rightText;
449} nbgl_layoutHorizontalButtons_t;
483 HEADER_BACK_AND_TEXT,
484 HEADER_BACK_ICON_AND_TEXT,
485 HEADER_BACK_AND_PROGRESS,
487 HEADER_EXTENDED_BACK,
490} nbgl_layoutHeaderType_t;
497 nbgl_layoutHeaderType_t type;
537} nbgl_layoutHeader_t;
550 FOOTER_SIMPLE_BUTTON,
551 FOOTER_CHOICE_BUTTONS,
553} nbgl_layoutFooterType_t;
560 nbgl_layoutFooterType_t type;
573 const char *leftText;
574 const char *rightText;
587 nbgl_layoutChoiceButtons_t choiceButtons;
589} nbgl_layoutFooter_t;
596 UP_FOOTER_LONG_PRESS = 0,
598 UP_FOOTER_HORIZONTAL_BUTTONS,
602} nbgl_layoutUpFooterType_t;
609 nbgl_layoutUpFooterType_t type;
617 nbgl_layoutHorizontalButtons_t
626} nbgl_layoutUpFooter_t;
691 tune_index_e tuneId);
701int nbgl_layoutAddQRCode(
nbgl_layout_t *layout,
const nbgl_layoutQRCode_t *info);
702int nbgl_layoutAddChoiceButtons(
nbgl_layout_t *layout,
const nbgl_layoutChoiceButtons_t *info);
704 const nbgl_layoutHorizontalButtons_t *info);
706int nbgl_layoutAddLargeCaseText(
nbgl_layout_t *layout,
const char *text,
bool grayedOut);
714 tune_index_e tuneId);
718 tune_index_e tuneId);
720 const char *leftText,
722 const char *rightText,
724 tune_index_e tuneId);
725int nbgl_layoutAddHeader(
nbgl_layout_t *layout,
const nbgl_layoutHeader_t *headerDesc);
726int nbgl_layoutAddExtendedFooter(
nbgl_layout_t *layout,
const nbgl_layoutFooter_t *footerDesc);
727int nbgl_layoutAddUpFooter(
nbgl_layout_t *layout,
const nbgl_layoutUpFooter_t *upFooterDesc);
733 tune_index_e tuneId);
739 tune_index_e tuneId);
747 uint8_t initPosition);
756 tune_index_e tuneId);
779bool nbgl_layoutKeyboardNeedsRefresh(
nbgl_layout_t *layout, uint8_t index);
780DEPRECATED
int nbgl_layoutAddSuggestionButtons(
nbgl_layout_t *layout,
781 uint8_t nbUsedButtons,
783 int firstButtonToken,
784 tune_index_e tuneId);
798DEPRECATED
int nbgl_layoutAddConfirmationButton(
nbgl_layout_t *layout,
802 tune_index_e tuneId);
803DEPRECATED
int nbgl_layoutUpdateConfirmationButton(
nbgl_layout_t *layout,
827 bool enableBackspace,
829int nbgl_layoutUpdateKeypadValidation(
nbgl_layout_t *layout,
bool softValidation);
841 uint8_t nbActiveDigits,
853 bool enableBackspace);
862 uint8_t nbActiveDigits,
common content for Graphical Library
nbgl_contentCenteredInfoStyle_t
possible styles for Centered Info Area
void(* nbgl_layoutTouchCallback_t)(int token, uint8_t index)
prototype of function to be called when an object is touched
int nbgl_layoutAddContentCenter(nbgl_layout_t *layout, const nbgl_contentCenter_t *info)
int nbgl_layoutAddKeyboard(nbgl_layout_t *layout, const nbgl_layoutKbd_t *kbdInfo)
Creates a keyboard on bottom of the screen, with the given configuration.
int nbgl_layoutUpdateKeyboard(nbgl_layout_t *layout, uint8_t index, uint32_t keyMask)
Updates an existing keyboard on bottom of the screen, with the given configuration.
int nbgl_layoutUpdateKeypad(nbgl_layout_t *layout, uint8_t index, bool enableValidate, bool enableBackspace)
Updates an existing keypad on bottom of the screen, with the given configuration.
int nbgl_layoutAddMenuList(nbgl_layout_t *layout, nbgl_layoutMenuList_t *list)
Creates a menu list (only for nanos) with the given parameters. The navigation (and selection) must b...
int nbgl_layoutAddHiddenDigits(nbgl_layout_t *layout, uint8_t nbDigits)
Adds a placeholder for hidden digits on top of a keypad, to represent the entered digits,...
int nbgl_layoutUpdateHiddenDigits(nbgl_layout_t *layout, uint8_t index, uint8_t nbActive)
Updates an existing set of hidden digits, with the given configuration.
nbgl_layoutNavDirection_t
possible directions for Navigation arrows
@ VERTICAL_NAV
'\/' and '/\' are displayed, to navigate in a list (vertical scrolling)
@ HORIZONTAL_NAV
'<' and '>' are displayed, to navigate between pages and steps
int nbgl_layoutAddKeypadContent(nbgl_layout_t *layout, bool hidden, uint8_t nbDigits, const char *text)
Adds an area with a title and a placeholder for hidden digits on top of a keypad, to represent the en...
int nbgl_layoutUpdateEnteredText(nbgl_layout_t *layout, uint8_t index, const char *text)
Updates an existing "text entry" area, created with nbgl_layoutAddEnteredText()
nbgl_contentRadioChoice_t nbgl_layoutRadioChoice_t
Deprecated, kept for retro compatibility.
nbgl_layoutNavIndication_t
possible styles for Navigation arrows (it's a bit field)
@ LEFT_ARROW
left arrow is used
@ RIGHT_ARROW
right arrow is used
int nbgl_layoutAddNavigation(nbgl_layout_t *layout, nbgl_layoutNavigation_t *info)
Creates navigation arrows on side(s) of the screen.
int nbgl_layoutAddEnteredText(nbgl_layout_t *layout, const char *text, bool lettersOnly)
Adds a "text entry" area under the previously entered object. The max number of really displayable ch...
int nbgl_layoutAddCenteredInfo(nbgl_layout_t *layout, const nbgl_layoutCenteredInfo_t *info)
Creates an area on the center of the main panel, with a possible icon/image, a possible text in black...
int nbgl_layoutAddText(nbgl_layout_t *layout, const char *text, const char *subText, nbgl_contentCenteredInfoStyle_t style)
Creates an area with given text and sub text, using the given style.
nbgl_contentSwitch_t nbgl_layoutSwitch_t
Deprecated, kept for retro compatibility.
int nbgl_layoutAddProgressBar(nbgl_layout_t *layout, const nbgl_layoutProgressBar_t *barLayout)
Creates an area in main panel to display a progress bar, with a title text and a description under th...
int nbgl_layoutDraw(nbgl_layout_t *layout)
Applies given layout. The screen will be redrawn.
nbgl_layoutButtonStyle_t
The different styles for a button.
@ WHITE_BACKGROUND
rounded bordered button, with text/icon in black, on white background
#define NB_MAX_SUGGESTION_BUTTONS
void * nbgl_layout_t
type shared externally
int nbgl_layoutAddSwitch(nbgl_layout_t *layout, const nbgl_layoutSwitch_t *switchLayout)
Creates an area in main panel to display a switch.
const char *(* nbgl_menuListCallback_t)(uint8_t choiceIndex)
prototype of menu list item retrieval callback
int nbgl_layoutAddEnteredTextAdvanced(nbgl_layout_t *layout, const char *text, bool lettersOnly, bool obfuscated)
Adds a "text entry" area under the previously entered object. The max number of really displayable ch...
int nbgl_layoutAddButton(nbgl_layout_t *layout, const nbgl_layoutButton_t *buttonInfo)
Creates an area in main panel to display a button, with the given style.
int nbgl_layoutUpdateKeypadContent(nbgl_layout_t *layout, bool hidden, uint8_t nbActiveDigits, const char *text)
Updates an existing set of hidden digits, with the given configuration.
nbgl_layout_t * nbgl_layoutGet(const nbgl_layoutDescription_t *description)
returns a layout of the given type. The layout is reset
int nbgl_layoutAddLeftContent(nbgl_layout_t *layout, const nbgl_layoutLeftContent_t *info)
struct nbgl_layoutDescription_s nbgl_layoutDescription_t
Structure containing all information when creating a layout. This structure must be passed as argumen...
#define NB_MAX_DESCRIPTIONS
max number of descriptions in nbgl_layoutTextContent_t
int nbgl_layoutAddKeypad(nbgl_layout_t *layout, keyboardCallback_t callback, const char *text, bool shuffled)
Adds a keypad on bottom of the screen, with the associated callback.
nbgl_layoutKeyboardContentType_t
The different types of keyboard contents.
@ KEYBOARD_WITH_BUTTON
text entry area + confirmation button
@ KEYBOARD_WITH_SUGGESTIONS
text entry area + suggestion buttons
@ NB_KEYBOARD_CONTENT_TYPES
void(* nbgl_layoutButtonCallback_t)(nbgl_layout_t *layout, nbgl_buttonEvent_t event)
prototype of function to be called when buttons are touched on a screen
int nbgl_layoutRelease(nbgl_layout_t *layout)
Release the layout obtained with nbgl_layoutGet()
nbgl_contentTagValueList_t nbgl_layoutTagValueList_t
Deprecated, kept for retro compatibility.
nbgl_contentTagValue_t nbgl_layoutTagValue_t
Deprecated, kept for retro compatibility.
nbgl_contentCenteredInfo_t nbgl_layoutCenteredInfo_t
Deprecated, kept for retro compatibility.
API to draw all basic graphic objects.
keyboardCase_t
Letters casing in which to open/set the keyboard.
keyboardMode_t
Mode in which to open/set the keyboard.
void(* keyboardCallback_t)(char touchedKey)
prototype of function to be called when a valid key is pressed on keyboard Backspace is equal to 0x8 ...
struct PACKED__ nbgl_screenTickerConfiguration_s nbgl_screenTickerConfiguration_t
struct to configure a screen layer
common types for Graphical Library
struct PACKED__ nbgl_icon_details_s nbgl_icon_details_t
Represents all information about an icon.
This structure contains info to build a centered (vertically and horizontally) area,...
This structure contains info to build a centered (vertically and horizontally) area,...
This structure contains a list of names to build a list of radio buttons (on the right part of screen...
This structure contains info to build a switch (on the right) with a description (on the left),...
This structure contains a list of [tag,value] pairs.
This structure contains a [tag,value] pair and possible extensions.
This structure contains data to build a tip-box, on top of a footer, on bottom of a content center.
This structure contains info to build a clickable "bar" with a text and an icon.
bool inactive
if set to true, the bar is grayed-out and cannot be touched
const char * text
text (can be NULL)
uint8_t token
the token that will be used as argument of the callback
bool large
set to true only for the main level of OS settings
const char * subText
sub text (can be NULL)
bool centered
DEPRECATED, not used.
tune_index_e tuneId
if not NBGL_NO_TUNE, a tune will be played
const nbgl_icon_details_t * iconLeft
a buffer containing the 1BPP icon for icon on left (can be NULL)
const nbgl_icon_details_t * iconRight
Structure containing all information when creating a layout. This structure must be passed as argumen...
nbgl_screenTickerConfiguration_t ticker
nbgl_layoutButtonCallback_t onActionCallback
the callback to be called on any action on the layout
This structure contains info to build a keyboard with nbgl_layoutAddKeyboard()
bool enableBackspace
if true, Backspace key is enabled
uint8_t selectedCharIndex
bool enableValidate
if true, Validate key is enabled
bool lettersOnly
if true, only display letter keys and Backspace
keyboardCallback_t callback
function called when an active key is pressed
keyboardMode_t mode
keyboard mode to start with
This structure contains info to build a keyboard content (controls that are linked to keyboard)
uint8_t number
if numbered is true, number used to build 'number.' text
const char * text
already entered text
nbgl_layoutKeyboardContentType_t type
type of content
nbgl_layoutSuggestionButtons_t suggestionButtons
nbgl_layoutConfirmationButton_t confirmationButton
used if type is KEYBOARD_WITH_SUGGESTIONS
const char * title
centered title explaining the screen
bool numbered
if set to true, the text is preceded on the left by 'number.'
bool grayedOut
(unused, kept for compatibility)
This structure contains info to build a left content area.
uint8_t nbRows
number of rows in the area
const char * title
title of area in bold
const nbgl_icon_details_t ** rowIcons
array of nbRows icon
const char ** rowTexts
array of nbRows texts (displayed in regular)
This structure contains info to build a navigation bar at the bottom of the screen.
uint8_t activePage
index of active page (from 0 to nbPages-1).
tune_index_e tuneId
if not NBGL_NO_TUNE, a tune will be played when pressing keys)
bool withBackKey
if set to true, the "back" key is drawn
bool withExitKey
if set to true, an exit button is drawn (X on the left)
uint8_t token
the token that will be used as argument of the callback
uint8_t nbPages
number of pages. (if 0, no navigation)
This structure contains info to build a navigation bar at the bottom of the screen.
nbgl_layoutNavDirection_t direction
vertical or horizontal navigation
nbgl_layoutNavIndication_t indication
specifies which arrows to use (left or right)
This structure contains info to build a progress bar with info. The progress bar itself is 120px widt...
uint8_t percentage
percentage of completion, from 0 to 100.
const char * text
text in black, on top of progress bar
const char * subText
text in gray, under progress bar
This structure contains info for Text content, to be set with nbgl_layoutAddTextContent().
uint8_t nbDescriptions
number of used descriptions in above array
const char * info
description at bottom (in small gray)
const char * title
main text (in large bold font)