34 = {.
type =
HEADER_EMPTY, .separationLine =
false, .emptySpace.height = height};
43 if (content->title != NULL) {
45 .separationLine =
true,
46 .backAndText.token = content->titleToken,
47 .backAndText.tuneId = content->tuneId,
48 .backAndText.
text = content->title};
52 if (content->topRightIcon != NULL) {
54 layout, content->topRightIcon, content->topRightToken, content->tuneId);
56 switch (content->type) {
59 centeredInfo.
icon = content->infoLongPress.
icon;
60 centeredInfo.
title = content->infoLongPress.
text;
68 content->infoLongPress.longPressText,
69 content->infoLongPress.longPressToken,
70 content->infoLongPress.tuneId);
77 centeredInfo.
icon = content->infoButton.
icon;
78 centeredInfo.
title = content->infoButton.
text;
87 buttonInfo.
icon = NULL;
90 buttonInfo.
text = content->infoButton.buttonText;
91 buttonInfo.
token = content->infoButton.buttonToken;
92 buttonInfo.tuneId = content->infoButton.tuneId;
104 if ((!headerAdded) && (content->extendedCenter.tipBox.
text == NULL)) {
108 if (content->extendedCenter.tipBox.
text != NULL) {
111 .tipBox.text = content->extendedCenter.tipBox.
text,
112 .tipBox.icon = content->extendedCenter.tipBox.
icon,
113 .tipBox.token = content->extendedCenter.tipBox.token,
114 .tipBox.tuneId = content->extendedCenter.tipBox.tuneId};
133 content->tagValueDetails.tagValueList.nbMaxLinesForValue -= 3;
136 buttonInfo.
icon = content->tagValueDetails.detailsButtonIcon;
138 buttonInfo.
text = content->tagValueDetails.detailsButtonText;
139 buttonInfo.
token = content->tagValueDetails.detailsButtonToken;
140 buttonInfo.tuneId = content->tagValueDetails.tuneId;
153 if (content->tagValueConfirm.detailsButtonText != NULL) {
155 buttonInfo.
icon = content->tagValueConfirm.detailsButtonIcon;
157 buttonInfo.
text = content->tagValueConfirm.detailsButtonText;
158 buttonInfo.
token = content->tagValueConfirm.detailsButtonToken;
159 buttonInfo.tuneId = content->tagValueConfirm.tuneId;
163 else if ((content->tagValueConfirm.detailsButtonIcon != NULL)
164 && (content->tagValueConfirm.confirmationText != NULL)) {
168 = {.
leftIcon = content->tagValueConfirm.detailsButtonIcon,
169 .rightText = content->tagValueConfirm.confirmationText,
170 .leftToken = content->tagValueConfirm.detailsButtonToken,
171 .rightToken = content->tagValueConfirm.confirmationToken,
172 .tuneId = content->tagValueConfirm.tuneId};
176 if (content->tagValueConfirm.confirmationText != NULL) {
178 buttonInfo.
icon = NULL;
180 buttonInfo.
text = content->tagValueConfirm.confirmationText;
181 buttonInfo.
token = content->tagValueConfirm.confirmationToken;
182 buttonInfo.tuneId = content->tagValueConfirm.tuneId;
190 for (i = 0; i < content->switchesList.nbSwitches; i++) {
193 if (availableHeight > 10) {
201 for (i = 0; i < content->infosList.nbInfos; i++) {
203 if ((content->infosList.withExtensions ==
true)
204 && (content->infosList.infoExtensions != NULL)
205 && (content->infosList.infoExtensions[i].fullValue != NULL)) {
208 content->infosList.infoTypes[i],
209 content->infosList.infoContents[i],
210 content->infosList.token,
215 content->infosList.infoTypes[i],
216 content->infosList.infoContents[i]);
219 if (availableHeight > 10) {
230 for (i = 0; i < content->barsList.nbBars; i++) {
232 bar.
text = content->barsList.barTexts[i];
236 bar.
token = content->barsList.tokens[i];
237 bar.tuneId = content->barsList.tuneId;
242 if (availableHeight > 10) {
275 .icon = &C_Check_Circle_64px,
278 layoutDescription.
modal =
false;
284 layoutDescription.tapTuneId = TUNE_TAP_CASUAL;
286 layoutDescription.
ticker.tickerCallback = ticker->tickerCallback;
287 layoutDescription.
ticker.tickerIntervale = ticker->tickerIntervale;
288 layoutDescription.
ticker.tickerValue = ticker->tickerValue;
312 layoutDescription.
modal =
false;
318 layoutDescription.
ticker.tickerCallback = NULL;
344 layoutDescription.
modal =
false;
351 layoutDescription.tapTuneId = info->
tuneId;
354 if (ticker != NULL) {
355 layoutDescription.
ticker.tickerCallback = ticker->tickerCallback;
356 layoutDescription.
ticker.tickerIntervale = ticker->tickerIntervale;
357 layoutDescription.
ticker.tickerValue = ticker->tickerValue;
360 layoutDescription.
ticker.tickerCallback = NULL;
411 .bottomText =
"Quit app",
473 layoutDescription.
ticker.tickerCallback = NULL;
504 bool headerAdded =
false;
506 layoutDescription.
modal = modal;
509 layoutDescription.
ticker.tickerCallback = NULL;
514 layoutDescription.tapTuneId = nav->
tuneId;
547 bool drawFooter =
true;
551 .separationLine =
false,
554 .rightText.tuneId = nav->
tuneId};
577 footerDesc.
textAndNav.navigation.withExitKey =
false;
579 footerDesc.
textAndNav.navigation.visibleIndicator
581 footerDesc.
textAndNav.navigation.withPageIndicator =
true;
610 addContent(content, layout, availableHeight, headerAdded);
@ LARGE_CASE_INFO
text in BLACK and large case (INTER 32px), subText in black in Inter24px
@ INFO_LONG_PRESS
a centered info and a long press button
@ EXTENDED_CENTER
a centered content and a possible tip-box
@ CHOICES_LIST
list of choices through radio buttons
@ CENTERED_INFO
a centered info
@ SWITCHES_LIST
list of switches with descriptions
@ TAG_VALUE_DETAILS
a tag/value pair and a small button to get details.
@ INFOS_LIST
list of infos with titles
@ TAG_VALUE_CONFIRM
tag/value pairs and a black button/footer to confirm/cancel.
@ TAG_VALUE_LIST
list of tag/value pairs
@ BARS_LIST
list of touchable bars (with > on the right to go to sub-pages)
@ INFO_BUTTON
a centered info and a simple black button
#define LOG_DEBUG(__logger,...)
void(* nbgl_layoutTouchCallback_t)(int token, uint8_t index)
prototype of function to be called when an object is touched
#define SIMPLE_FOOTER_HEIGHT
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,...
#define MEDIUM_CENTERING_HEADER
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)
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_layoutAddSeparationLine(nbgl_layout_t *layout)
adds a separation line on bottom of the last added item
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_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 icon on right of text to ...
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.
@ WHITE_BACKGROUND
rounded bordered button, with text/icon in black, on white background
@ 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.
@ UP_FOOTER_TIP_BOX
Tip-box.
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...
@ HEADER_EMPTY
empty space, to have a better vertical centering of centered info
@ HEADER_BACK_AND_TEXT
back key and optional text
@ HEADER_RIGHT_TEXT
touchable text on the right, with a vertical separation line
int nbgl_layoutAddButton(nbgl_layout_t *layout, const nbgl_layoutButton_t *buttonInfo)
Creates a rounded button in the main container.
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,...
@ SOFT_ACTION_AND_FOOTER_STYLE
A white button on top of a footer, with a separation line.
@ 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_layoutAddLongPressButton(nbgl_layout_t *layout, const char *text, uint8_t token, tune_index_e tuneId)
Creates a long press button in the main container.
#define BOTH_ROUNDED_STYLE
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 SMALL_CENTERING_HEADER
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.
@ FOOTER_SIMPLE_TEXT
simple touchable text in bold
@ FOOTER_NAV
navigation bar
int nbgl_layoutRelease(nbgl_layout_t *layout)
Release the layout obtained with nbgl_layoutGet()
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_layoutAddSpinner(nbgl_layout_t *layout, const char *text, bool fixed)
Creates a centered (vertically & horizontally) spinner with a text under it.
nbgl_layout_t * nbgl_layoutGet(const nbgl_layoutDescription_t *description)
returns a layout of the given type. The layout is reset
nbgl_page_t * nbgl_pageDrawGenericContent(nbgl_layoutTouchCallback_t onActionCallback, const nbgl_pageNavigationInfo_t *nav, nbgl_pageContent_t *content)
draw a generic content page, with the given content, and if nav parameter is not NULL,...
nbgl_page_t * nbgl_pageDrawSpinner(nbgl_layoutTouchCallback_t onActionCallback, const char *text)
draw a spinner page with the given parameters. The spinner will "rotate" automatically every 800 ms
nbgl_page_t * nbgl_pageDrawLedgerInfo(nbgl_layoutTouchCallback_t onActionCallback, const nbgl_screenTickerConfiguration_t *ticker, const char *text, int tapActionToken)
draw a page with a centered text in large case, with a round check icon
int nbgl_pageRelease(nbgl_page_t *page)
Release the page obtained with any of the nbgl_pageDrawXXX() functions.
nbgl_page_t * nbgl_pageDrawGenericContentExt(nbgl_layoutTouchCallback_t onActionCallback, const nbgl_pageNavigationInfo_t *nav, nbgl_pageContent_t *content, bool modal)
draw a generic content page, with the given content, and if nav parameter is not NULL,...
nbgl_page_t * nbgl_pageDrawInfo(nbgl_layoutTouchCallback_t onActionCallback, const nbgl_screenTickerConfiguration_t *ticker, const nbgl_pageInfoDescription_t *info)
draw a page with a centered info (icon and/or texts) with a touchable footer, in a potential "tapable...
nbgl_page_t * nbgl_pageDrawConfirmation(nbgl_layoutTouchCallback_t onActionCallback, const nbgl_pageConfirmationDescription_t *info)
draw a confirmation page, with a centered info (icon and/or text), a button to confirm and a footer t...
API of the Advanced BOLOS Graphical Library, for predefined pages.
void * nbgl_page_t
type shared externally
@ NAV_WITH_BUTTONS
move forward and backward with buttons in bottom nav bar
@ NAV_WITH_TAP
move forward with "tap" and possibly backward with top left arrow
@ QUIT_APP_TEXT
A full width button with "Quit app" text (only for bottom button)
@ INFO_ICON
info (i) icon in the button.
@ QUIT_ICON
quit (X) icon in the button.
@ NO_BUTTON_STYLE
no button.
@ SETTINGS_ICON
settings (wheel) icon in the button.
struct PACKED__ nbgl_screenTickerConfiguration_s nbgl_screenTickerConfiguration_t
struct to configure a screen layer
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,...
uint16_t iconHug
vertical margin to apply on top and bottom of the icon
const nbgl_icon_details_t * icon
the icon (can be null)
const char * title
title in black large (can be null)
const char * description
description in black small regular case (can be null)
const char * subText
sub-text in dark gray regular small case
bool padding
if true, apply a padding of 40px at the bottom
const char * smallTitle
sub-title in black small bold case (can be null)
This structure contains info to build a centered (vertically and horizontally) area,...
const char * text1
first text (can be null)
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)
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
uint8_t activePage
index of active page (from 0 to nbPages-1).
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)
Structure containing all specific information when creating a confirmation page.
const char * cancelText
the text used for cancel action, if NULL a simple X button is used
uint8_t confirmationToken
the token used as argument of the onActionCallback
bool modal
if true, page is open as a modal
const char * confirmationText
text of the confirmation button
nbgl_layoutCenteredInfo_t centeredInfo
description of the centered info to be used
tune_index_e tuneId
if not NBGL_NO_TUNE, a tune will be played when button is pressed
Structure containing all specific information when creating an information page.
nbgl_layoutButtonStyle_t actionButtonStyle
style of "action" button
const char * actionButtonText
if not NULL an "action" button is set under the centered info
const char * tapActionText
uint8_t bottomButtonsToken
const char * footerText
if not NULL, add a touchable footer
nbgl_pageButtonStyle_t topRightStyle
style to apply to the Top-Right button
uint8_t topRightToken
the token that will be used as argument of the onActionCallback
bool isSwipeable
if true, main area is swipeable
tune_index_e tuneId
if not NBGL_NO_TUNE, a tune will be played when button/footer is pressed
uint8_t footerToken
the token that will be used as argument of the onActionCallback
const nbgl_icon_details_t * actionButtonIcon
potential icon of "action" button
nbgl_pageButtonStyle_t bottomButtonStyle
style to apply to the Bottom button
nbgl_layoutCenteredInfo_t centeredInfo
description of the centered info to be used
Structure containing all specific information when creating a multi-screens page.
uint8_t nbPages
the number of pages to display (if <2, no navigation bar)
uint8_t quitToken
the token used as argument of the actionCallback when the footer is touched
uint8_t skipToken
if skipText is NULL the token used when right part of footer is touched
nbgl_pageNavigationType_t navType
uint8_t activePage
the index of the page to display at start-up
bool progressIndicator
if set to true, display a progress indicator on top of the page
nbgl_pageNavWithButtons_t navWithButtons
structure used when navigation with buttons
nbgl_pageNavWithTap_t navWithTap
structure used when navigation with "tap"
tune_index_e tuneId
if not NBGL_NO_TUNE, a tune will be played when next or back is pressed
bool visiblePageIndicator
if set to true, the page indicator will be visible in navigation
bool quitButton
if set to true, a quit button (X) is displayed in the nav bar
const char * quitText
the text displayed in footer (on the left), used to quit (only on Flex)
bool backButton
if set to true, a back button (<-) is displayed in the nav bar
const char * quitText
the text displayed in footer, used to quit
const char * nextPageText
Structure containing all specific information when creating a NBGL step.
const nbgl_icon_details_t * icon
icon to display in step (text must be single-page)
const char * text
text to display in step (can be multi-pages if icon == NULL)