29#define NBGL_NO_PROGRESS_INDICATOR 0xFF
32#define NBGL_INVALID_TOKEN 0xFF
39#if defined(TARGET_STAX)
40#define NB_MAX_SUGGESTION_BUTTONS 12
42#define NB_MAX_VISIBLE_SUGGESTION_BUTTONS 4
43#define TOUCHABLE_HEADER_BAR_HEIGHT 88
44#define SMALL_FOOTER_HEIGHT 88
45#define SIMPLE_FOOTER_HEIGHT 92
46#define SMALL_CENTERING_HEADER 32
47#define MEDIUM_CENTERING_HEADER 56
48#define LARGE_CENTERING_HEADER 56
49#define MEDIUM_CENTERING_FOOTER 88
50#define LONG_PRESS_BUTTON_HEIGHT 128
51#define UP_FOOTER_BUTTON_HEIGHT 120
52#define ACTION_AND_FOOTER_FOOTER_HEIGHT 216
53#define BOTH_ROUNDED_FOOTER_HEIGHT 216
55#define LIST_ITEM_MIN_TEXT_HEIGHT 40
56#define LIST_ITEM_PRE_HEADING 28
57#define LIST_ITEM_PRE_HEADING_LARGE 28
58#define LIST_ITEM_HEADING_SUB_TEXT 12
60#define PRE_TAG_VALUE_MARGIN 24
61#define INTER_TAG_VALUE_MARGIN 12
63#define PROGRESSBAR_WIDTH 120
64#define PROGRESSBAR_HEIGHT 12
65#define BACK_KEY_WIDTH 88
66#define ICON_TITLE_MARGIN 24
67#define TITLE_DESC_MARGIN 16
69#elif defined(TARGET_FLEX) || defined(TARGET_APOLLO)
70#define NB_MAX_SUGGESTION_BUTTONS 8
72#define NB_MAX_VISIBLE_SUGGESTION_BUTTONS 2
73#define TOUCHABLE_HEADER_BAR_HEIGHT 96
74#define SMALL_FOOTER_HEIGHT 96
75#define SIMPLE_FOOTER_HEIGHT 96
76#define SMALL_CENTERING_HEADER 40
77#define MEDIUM_CENTERING_HEADER 64
78#define LARGE_CENTERING_HEADER 64
79#define MEDIUM_CENTERING_FOOTER 64
80#define LONG_PRESS_BUTTON_HEIGHT 152
81#define UP_FOOTER_BUTTON_HEIGHT 136
82#define ACTION_AND_FOOTER_FOOTER_HEIGHT 232
83#define BOTH_ROUNDED_FOOTER_HEIGHT 232
85#define LIST_ITEM_MIN_TEXT_HEIGHT SMALL_ICON_SIZE
86#define LIST_ITEM_PRE_HEADING 26
87#define LIST_ITEM_PRE_HEADING_LARGE 30
88#define LIST_ITEM_HEADING_SUB_TEXT 12
90#define PRE_TAG_VALUE_MARGIN 0
91#define INTER_TAG_VALUE_MARGIN 24
93#define PROGRESSBAR_WIDTH 120
94#define PROGRESSBAR_HEIGHT 12
95#define BACK_KEY_WIDTH 104
96#define ICON_TITLE_MARGIN 24
97#define TITLE_DESC_MARGIN 16
99#elif defined(TARGET_APEX)
100#define NB_MAX_SUGGESTION_BUTTONS 8
102#define NB_MAX_VISIBLE_SUGGESTION_BUTTONS 2
103#define TOUCHABLE_HEADER_BAR_HEIGHT 60
104#define SMALL_FOOTER_HEIGHT 60
105#define SIMPLE_FOOTER_HEIGHT 60
106#define SMALL_CENTERING_HEADER 24
107#define MEDIUM_CENTERING_HEADER 40
108#define LARGE_CENTERING_HEADER 60
109#define MEDIUM_CENTERING_FOOTER 40
110#define LONG_PRESS_BUTTON_HEIGHT 88
111#define UP_FOOTER_BUTTON_HEIGHT 88
112#define ACTION_AND_FOOTER_FOOTER_HEIGHT 128
113#define BOTH_ROUNDED_FOOTER_HEIGHT 148
115#define LIST_ITEM_MIN_TEXT_HEIGHT SMALL_ICON_SIZE
116#define LIST_ITEM_PRE_HEADING 22
117#define LIST_ITEM_PRE_HEADING_LARGE 22
118#define LIST_ITEM_HEADING_SUB_TEXT 8
120#define PRE_TAG_VALUE_MARGIN 0
121#define INTER_TAG_VALUE_MARGIN 16
123#define PROGRESSBAR_WIDTH 78
124#define PROGRESSBAR_HEIGHT 8
125#define BACK_KEY_WIDTH 56
126#define ICON_TITLE_MARGIN 16
127#define TITLE_DESC_MARGIN 12
130#error Undefined target
133#define TAG_VALUE_INTERVALE 4
134#define VALUE_ICON_INTERVALE 12
136#define AVAILABLE_WIDTH (SCREEN_WIDTH - 2 * BORDER_MARGIN)
139#define NB_MAX_LINES 12
143#define NB_MAX_SUGGESTION_BUTTONS 8
145#define AVAILABLE_WIDTH (SCREEN_WIDTH - 2 * 7)
147#define NB_MAX_LINES 4
151#define SPINNER_FIXED 0xFF
153#define NB_MAX_DESCRIPTIONS 3
295typedef const char *(*nbgl_menuListCallback_t)(uint8_t choiceIndex);
586 bool enableBackspace;
589 uint8_t selectedCharIndex;
605 tune_index_e tuneId);
628 tune_index_e tuneId);
632 tune_index_e tuneId);
634 const char *leftText,
636 const char *rightText,
638 tune_index_e tuneId);
647 tune_index_e tuneId);
653 tune_index_e tuneId);
661 uint8_t initPosition);
670 tune_index_e tuneId);
698int nbgl_layoutAddEnteredText(
nbgl_layout_t *layout,
const char *text,
bool lettersOnly);
703int nbgl_layoutUpdateEnteredText(
nbgl_layout_t *layout, uint8_t index,
const char *text);
714 bool enableBackspace,
724 uint8_t nbActiveDigits,
736 bool enableBackspace);
737int nbgl_layoutAddHiddenDigits(
nbgl_layout_t *layout, uint8_t nbDigits);
738int nbgl_layoutUpdateHiddenDigits(
nbgl_layout_t *layout, uint8_t index, uint8_t nbActive);
745 uint8_t nbActiveDigits,
common content for Graphical Library
nbgl_contentCenteredInfoStyle_t
possible styles for Centered Info Area
struct nbgl_contentTagValueList_s nbgl_contentTagValueList_t
This structure contains a list of [tag,value] pairs.
int nbgl_layoutAddTagValueList(nbgl_layout_t *layout, const nbgl_layoutTagValueList_t *list)
Creates a list of [tag,value] pairs.
int nbgl_layoutAddContentCenter(nbgl_layout_t *layout, const nbgl_contentCenter_t *info)
Creates an area on the center of the main panel, with a possible icon, and possible texts under it.
int nbgl_layoutAddUpFooter(nbgl_layout_t *layout, const nbgl_layoutUpFooter_t *upFooterDesc)
Creates a touchable area on top of the footer of the screen, containing various controls,...
int nbgl_layoutUpdateKeyboard(nbgl_layout_t *layout, uint8_t index, uint32_t keyMask, bool updateCasing, keyboardCase_t casing)
Updates an existing keyboard on bottom of the screen, with the given configuration.
int nbgl_layoutAddKeyboard(nbgl_layout_t *layout, const nbgl_layoutKbd_t *kbdInfo)
Creates a keyboard on bottom of the screen, 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_layoutAddText(nbgl_layout_t *layout, const char *text, const char *subText)
Creates an area with given text (in bold) and sub text (in regular).
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_layoutUpdateKeypad(nbgl_layout_t *layout, uint8_t index, bool enableValidate, bool enableBackspace, bool enableDigits)
Updates an existing keypad on bottom of the screen, with the given configuration.
int nbgl_layoutAddProgressIndicator(nbgl_layout_t *layout, uint8_t activePage, uint8_t nbPages, bool withBack, uint8_t backToken, tune_index_e tuneId)
Creates a kind of navigation bar with an optional <- arrow on the left. This widget is placed on top ...
int nbgl_layoutAddNavigationBar(nbgl_layout_t *layout, const nbgl_layoutNavigationBar_t *info)
Creates a navigation bar on bottom of main container.
int nbgl_layoutAddKeyboardContent(nbgl_layout_t *layout, nbgl_layoutKeyboardContent_t *content)
Adds an area containing a potential title, a text entry and either confirmation or suggestion buttons...
int nbgl_layoutAddSeparationLine(nbgl_layout_t *layout)
adds a separation line on bottom of the last added item
int nbgl_layoutAddQRCode(nbgl_layout_t *layout, const nbgl_layoutQRCode_t *info)
Creates an area on the center of the main panel, with a QRCode, a possible text in black (bold) under...
int nbgl_layoutAddRadioChoice(nbgl_layout_t *layout, const nbgl_layoutRadioChoice_t *choices)
Creates a list of radio buttons (on the right).
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_layoutUpdateKeypadValidation(nbgl_layout_t *layout, bool softValidation)
Updates an existing keypad on bottom of the screen, with the given configuration, without redraw.
nbgl_contentSwitch_t nbgl_layoutSwitch_t
Deprecated, kept for retro compatibility.
int nbgl_layoutAddSplitFooter(nbgl_layout_t *layout, const char *leftText, uint8_t leftToken, const char *rightText, uint8_t rightToken, tune_index_e tuneId)
Creates 2 touchable texts at the footer of the screen, separated with a thin line from the rest of th...
int nbgl_layoutAddTextWithAlias(nbgl_layout_t *layout, const char *text, const char *subText, uint8_t token, uint8_t index)
Creates an area with given text (in bold) and sub text (in regular), with a.
int nbgl_layoutDraw(nbgl_layout_t *layout)
Applies given layout. The screen will be redrawn.
int nbgl_layoutAddTouchableBar(nbgl_layout_t *layout, const nbgl_layoutBar_t *barLayout)
Creates a touchable bar in main panel.
nbgl_layoutButtonStyle_t
The different styles for a button.
@ WHITE_BACKGROUND
rounded bordered button, with text/icon in black, on white background
@ NO_BORDER
simple clickable text, in black
@ LONG_PRESS
long press button, with progress indicator
@ BLACK_BACKGROUND
rounded bordered button, with text/icon in white, on black background
int nbgl_layoutAddTopRightButton(nbgl_layout_t *layout, const nbgl_icon_details_t *icon, uint8_t token, tune_index_e tuneId)
Creates a Top-right button in the top right corner of the top panel.
int nbgl_layoutInvertBackground(nbgl_layout_t *layout)
Inverts the background color (black instead of white).
int nbgl_layoutAddTextContent(nbgl_layout_t *layout, nbgl_layoutTextContent_t *content)
Creates in the main container three text areas:
nbgl_layoutUpFooterType_t
The different types of area on top of footer.
@ UP_FOOTER_TEXT
grayed-out text, for example "Tap to continue"
@ UP_FOOTER_BUTTON
simple button
@ UP_FOOTER_LONG_PRESS
long-press button
@ UP_FOOTER_TIP_BOX
Tip-box.
@ UP_FOOTER_HORIZONTAL_BUTTONS
2 buttons, on the same line
int nbgl_layoutAddSwipe(nbgl_layout_t *layout, uint16_t swipesMask, const char *text, uint8_t token, tune_index_e tuneId)
Creates a swipe interaction on the main container.
void * nbgl_layout_t
type shared externally
int nbgl_layoutAddSwitch(nbgl_layout_t *layout, const nbgl_layoutSwitch_t *switchLayout)
Creates a switch with the given text and its state.
int nbgl_layoutAddHorizontalButtons(nbgl_layout_t *layout, const nbgl_layoutHorizontalButtons_t *info)
Creates two buttons to make a choice. Both buttons are mandatory The left one contains only an icon a...
nbgl_layoutHeaderType_t
The different types of extended header.
@ HEADER_TITLE
simple centered text
@ HEADER_BACK_AND_PROGRESS
optional back key and progress indicator (only on Stax)
@ HEADER_EMPTY
empty space, to have a better vertical centering of centered info
@ HEADER_EXTENDED_BACK
back key, centered text and touchable key on the right
@ HEADER_BACK_AND_TEXT
back key and optional text
@ HEADER_RIGHT_TEXT
touchable text on the right, with a vertical separation line
@ HEADER_BACK_ICON_AND_TEXT
back key and optional icon and text
int nbgl_layoutUpdateKeyboardContent(nbgl_layout_t *layout, nbgl_layoutKeyboardContent_t *content)
Updates an area containing a potential title, a text entry and either confirmation or suggestion butt...
const char *(* nbgl_menuListCallback_t)(uint8_t choiceIndex)
prototype of menu list item retrieval callback
int nbgl_layoutAddKeypadContent(nbgl_layout_t *layout, const char *title, 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_layoutAddButton(nbgl_layout_t *layout, const nbgl_layoutButton_t *buttonInfo)
Creates a rounded button in the main container.
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_layoutAddExtendedFooter(nbgl_layout_t *layout, const nbgl_layoutFooter_t *footerDesc)
Creates a touchable area at the footer of the screen, containing various controls,...
int nbgl_layoutAddLeftContent(nbgl_layout_t *layout, const nbgl_layoutLeftContent_t *info)
Creates an area with a title, and rows of icon + text, left aligned.
nbgl_layoutChoiceButtonsStyle_t
The different styles for a pair of buttons.
@ SOFT_ACTION_AND_FOOTER_STYLE
A white button on top of a footer, with a separation line.
@ BOTH_ROUNDED_STYLE
A black button on top of a white button.
@ ROUNDED_AND_FOOTER_STYLE
A black background button on top of a footer.
@ STRONG_ACTION_AND_FOOTER_STYLE
A black button on top of a footer, with a separation line.
int nbgl_layoutAddChoiceButtons(nbgl_layout_t *layout, const nbgl_layoutChoiceButtons_t *info)
Creates two buttons to make a choice. Both buttons are mandatory. Both buttons are full width,...
int nbgl_layoutAddSpinner(nbgl_layout_t *layout, const char *text, const char *subText, uint8_t initPosition)
Creates a centered (vertically & horizontally) spinner with a text under it.
int nbgl_layoutUpdateSpinner(nbgl_layout_t *layout, const char *text, const char *subText, uint8_t position)
Update an existing spinner (must be the only object of the layout).
int nbgl_layoutAddLongPressButton(nbgl_layout_t *layout, const char *text, uint8_t token, tune_index_e tuneId)
Creates a long press button in the main container.
struct nbgl_layoutDescription_s nbgl_layoutDescription_t
Structure containing all information when creating a layout. This structure must be passed as argumen...
int nbgl_layoutAddProgressBar(nbgl_layout_t *layout, const char *text, const char *subText, uint8_t percentage)
Creates an area in main panel to display a progress bar, with a title text and a subtext if needed.
int nbgl_layoutAddHeader(nbgl_layout_t *layout, const nbgl_layoutHeader_t *headerDesc)
Creates a touchable (or not) area at the header of the screen, containing various controls,...
#define NB_MAX_DESCRIPTIONS
max number of descriptions in nbgl_layoutTextContent_t
int nbgl_layoutAddBottomButton(nbgl_layout_t *layout, const nbgl_icon_details_t *icon, uint8_t token, bool separationLine, tune_index_e tuneId)
Creates a centered button at bottom of main container.
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
nbgl_layoutFooterType_t
The different types of extended footer.
@ FOOTER_SIMPLE_TEXT
simple touchable text in bold
@ FOOTER_NAV
navigation bar
@ FOOTER_SIMPLE_BUTTON
simple black or white button (see nbgl_layoutButtonStyle_t)
@ FOOTER_DOUBLE_TEXT
2 touchable texts in bold, separated by a vertical line (only on Stax)
@ FOOTER_EMPTY
empty space, to have a better vertical centering of centered info
@ FOOTER_CHOICE_BUTTONS
double buttons (see nbgl_layoutChoiceButtonsStyle_t)
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.
int nbgl_layoutAddFooter(nbgl_layout_t *layout, const char *text, uint8_t token, tune_index_e tuneId)
Creates a touchable text at the footer of the screen, separated with a thin line from the rest of the...
int nbgl_layoutAddKeypad(nbgl_layout_t *layout, keyboardCallback_t callback, bool shuffled)
Adds a keypad on bottom of the screen, with the associated callback.
int nbgl_layoutAddLargeCaseText(nbgl_layout_t *layout, const char *text, bool grayedOut)
Creates an area with given text in 32px font (in Black or Light Gray).
bool nbgl_layoutKeyboardNeedsRefresh(nbgl_layout_t *layout, uint8_t index)
function called to know whether the keyboard has been redrawn and needs a refresh
nbgl_contentTagValue_t nbgl_layoutTagValue_t
Deprecated, kept for retro compatibility.
nbgl_contentCenteredInfo_t nbgl_layoutCenteredInfo_t
Deprecated, kept for retro compatibility.
Types of NBGL layouts also used by the use-case API.
void(* nbgl_layoutTouchCallback_t)(int token, uint8_t index)
prototype of function to be called when an object is touched
Included by every low-level NBGL header, to forbid them in apollo app code.
API to draw all basic graphic objects.
void(* keyboardCallback_t)(char touchedKey)
prototype of function to be called when a valid key is pressed on keyboard Backspace is equal to 0x8 ...
keyboardCase_t
Letters casing in which to open/set the keyboard.
keyboardMode_t
Mode in which to open/set the keyboard.
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 [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
const char * tapActionText
Light gray text used when main container is "tapable".
nbgl_layoutTouchCallback_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 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
keyboardCase_t casing
keyboard casing mode (lower, upper once or upper locked)
This structure contains info to build a keyboard content (controls that are linked to keyboard).
This structure contains info to build a left content area.
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 to build a centered (vertically and horizontally) area,...
This structure contains info for Text content, to be set with nbgl_layoutAddTextContent().
const char * descriptions[NB_MAX_DESCRIPTIONS]
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)