Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
nbgl_use_case.h
Go to the documentation of this file.
1
7#ifndef NBGL_USE_CASE_H
8#define NBGL_USE_CASE_H
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14/*********************
15 * INCLUDES
16 *********************/
17
18#include "nbgl_content.h"
19#ifdef NBGL_PAGE
20#include "nbgl_page.h"
21#else // NBGL_PAGE
22#include "nbgl_flow.h"
23#endif // NBGL_PAGE
24
25/*********************
26 * DEFINES
27 *********************/
32#define FIRST_USER_TOKEN 50
33
38#define LAST_PAGE_FOR_REVIEW 0xFF
39
43#if defined(TARGET_STAX)
44#define NB_MAX_LINES_IN_DETAILS 12
45#elif defined(TARGET_FLEX)
46#define NB_MAX_LINES_IN_DETAILS 11
47#elif defined(TARGET_APEX)
48#define NB_MAX_LINES_IN_DETAILS 11
49#else
50// Nano
51#define NB_MAX_LINES_IN_DETAILS 3
52#endif // TARGETS
53
57#if defined(TARGET_STAX)
58#define NB_MAX_LINES_IN_REVIEW 10
59#elif defined(TARGET_FLEX)
60#define NB_MAX_LINES_IN_REVIEW 9
61#elif defined(TARGET_APEX)
62#define NB_MAX_LINES_IN_REVIEW 9
63#else
64// Nano
65#define NB_MAX_LINES_IN_REVIEW 3
66#endif // TARGETS
67
73#define NB_MAX_DISPLAYED_PAIRS_IN_REVIEW 4
74
78#define TAG_VALUE_AREA_HEIGHT (SCREEN_HEIGHT - SMALL_CENTERING_HEADER - SIMPLE_FOOTER_HEIGHT)
79
83#define INFOS_AREA_HEIGHT (SCREEN_HEIGHT - TOUCHABLE_HEADER_BAR_HEIGHT)
84
88#define TAGLINE_PART1 "This app enables signing\ntransactions on the"
89#define TAGLINE_PART2 "network."
90
94#define APP_DESCRIPTION_MAX_LEN 74
95
99#define MAX_APP_NAME_FOR_SDK_TAGLINE \
100 (APP_DESCRIPTION_MAX_LEN - 1 - (sizeof(TAGLINE_PART1) + sizeof(TAGLINE_PART2)))
101
107#define INIT_HOME_PAGE 0xff
108
110#define STATUS_SCREEN_DURATION 3000
111
117#define REAL_TYPE_MASK 0x7
118
119// returns true if the given warning structure requires display of an initial page (internal usage)
120#define HAS_INITIAL_WARNING(_warning) \
121 ((_warning->predefinedSet \
122 & ((1 << W3C_THREAT_DETECTED_WARN) | (1 << W3C_RISK_DETECTED_WARN) \
123 | (1 << BLIND_SIGNING_WARN))) \
124 || (_warning->info != NULL))
125
126/**********************
127 * MACROS
128 **********************/
129
130/**********************
131 * TYPEDEFS
132 **********************/
136typedef void (*nbgl_callback_t)(void);
137
144typedef bool (*nbgl_navCallback_t)(uint8_t page, nbgl_pageContent_t *content);
145
150typedef void (*nbgl_choiceCallback_t)(bool confirm);
151
156typedef void (*nbgl_actionCallback_t)(uint8_t page);
157
163typedef void (*nbgl_pinValidCallback_t)(const uint8_t *pin, uint8_t pinLen);
164
171 uint32_t *mask);
172
178typedef void (*nbgl_contentCallback_t)(uint8_t contentIndex, nbgl_content_t *content);
179
190
199
210
216typedef struct {
217 const char *text;
219 const char *modalTitle;
221 union {
224 };
226
237
239
244typedef struct {
245 uint8_t nbBars;
246 const char *const *texts;
247 const char *const *subTexts;
249 const struct nbgl_genericDetails_s
252
254
273
275
289
302
334
335#ifdef NBGL_KEYBOARD
339typedef struct {
340#ifdef HAVE_SE_TOUCH
341 const char *buttonText;
342#endif
345
357
382#endif // NBGL_KEYBOARD
383
395
401#define SKIPPABLE_OPERATION (1 << 4)
402
408#define BLIND_OPERATION (1 << 5)
409
415typedef uint32_t nbgl_operationType_t;
416
431
432/**********************
433 * GLOBAL PROTOTYPES
434 **********************/
435
436void nbgl_useCaseHomeAndSettings(const char *appName,
437 const nbgl_icon_details_t *appIcon,
438 const char *tagline,
439 const uint8_t initSettingPage,
440 const nbgl_genericContents_t *settingContents,
441 const nbgl_contentInfoList_t *infosList,
442 const nbgl_homeAction_t *action,
443 nbgl_callback_t quitCallback);
444
446 const nbgl_contentTagValueList_t *tagValueList,
447 const nbgl_icon_details_t *icon,
448 const char *reviewTitle,
449 const char *reviewSubTitle,
450 const char *finishTitle,
451 nbgl_choiceCallback_t choiceCallback);
452
454 const nbgl_contentTagValueList_t *tagValueList,
455 const nbgl_icon_details_t *icon,
456 const char *reviewTitle,
457 const char *reviewSubTitle,
458 const char *finishTitle,
459 const nbgl_tipBox_t *tipBox,
460 nbgl_choiceCallback_t choiceCallback);
462 const nbgl_contentTagValueList_t *tagValueList,
463 const nbgl_icon_details_t *icon,
464 const char *reviewTitle,
465 const char *reviewSubTitle,
466 const char *finishTitle,
467 const nbgl_tipBox_t *tipBox,
468 const nbgl_warning_t *warning,
469 nbgl_choiceCallback_t choiceCallback);
470
472 const nbgl_contentTagValueList_t *tagValueList,
473 const nbgl_icon_details_t *icon,
474 const char *reviewTitle,
475 const char *reviewSubTitle,
476 const char *finishTitle,
477 nbgl_choiceCallback_t choiceCallback);
478
479void nbgl_useCaseAddressReview(const char *address,
480 const nbgl_contentTagValueList_t *additionalTagValueList,
481 const nbgl_icon_details_t *icon,
482 const char *reviewTitle,
483 const char *reviewSubTitle,
484 nbgl_choiceCallback_t choiceCallback);
485
487 nbgl_callback_t quitCallback);
488
490 const nbgl_icon_details_t *icon,
491 const char *reviewTitle,
492 const char *reviewSubTitle,
493 nbgl_choiceCallback_t choiceCallback);
494
496 const nbgl_icon_details_t *icon,
497 const char *reviewTitle,
498 const char *reviewSubTitle,
499 nbgl_choiceCallback_t choiceCallback);
500
502 const nbgl_icon_details_t *icon,
503 const char *reviewTitle,
504 const char *reviewSubTitle,
505 const nbgl_warning_t *warning,
506 nbgl_choiceCallback_t choiceCallback);
507
509 nbgl_choiceCallback_t choiceCallback,
510 nbgl_callback_t skipCallback);
511
513 nbgl_choiceCallback_t choiceCallback);
514
515void nbgl_useCaseReviewStreamingFinish(const char *finishTitle,
516 nbgl_choiceCallback_t choiceCallback);
517
519 const char *rejectText,
520 nbgl_callback_t rejectCallback);
521
522void nbgl_useCaseGenericConfiguration(const char *title,
523 uint8_t initPage,
524 const nbgl_genericContents_t *contents,
525 nbgl_callback_t quitCallback);
526
527void nbgl_useCaseGenericSettings(const char *appName,
528 uint8_t initPage,
529 const nbgl_genericContents_t *settingContents,
530 const nbgl_contentInfoList_t *infosList,
531 nbgl_callback_t quitCallback);
532
534 const char *message,
535 const char *subMessage,
536 const char *confirmText,
537 const char *rejectString,
538 nbgl_choiceCallback_t callback);
540 const char *message,
541 const char *subMessage,
542 const char *confirmText,
543 const char *cancelText,
544 nbgl_warningDetails_t *details,
545 nbgl_choiceCallback_t callback);
546void nbgl_useCaseStatus(const char *message, bool isSuccess, nbgl_callback_t quitCallback);
547
548void nbgl_useCaseConfirm(const char *message,
549 const char *subMessage,
550 const char *confirmText,
551 const char *rejectText,
552 nbgl_callback_t callback);
553
555 const char *message,
556 const char *actionText,
557 nbgl_callback_t callback);
558
559void nbgl_useCaseSpinner(const char *text);
560
561void nbgl_useCaseNavigableContent(const char *title,
562 uint8_t initPage,
563 uint8_t nbPages,
564 nbgl_callback_t quitCallback,
565 nbgl_navCallback_t navCallback,
566 nbgl_layoutTouchCallback_t controlsCallback);
567
568// utils
569uint8_t nbgl_useCaseGetNbTagValuesInPage(uint8_t nbPairs,
570 const nbgl_contentTagValueList_t *tagValueList,
571 uint8_t startIndex,
572 bool *requireSpecificDisplay);
574 const nbgl_contentTagValueList_t *tagValueList,
575 uint8_t startIndex,
576 bool isSkippable,
577 bool *requireSpecificDisplay);
578uint8_t nbgl_useCaseGetNbInfosInPage(uint8_t nbInfos,
579 const nbgl_contentInfoList_t *infosList,
580 uint8_t startIndex,
581 bool withNav);
582uint8_t nbgl_useCaseGetNbSwitchesInPage(uint8_t nbSwitches,
583 const nbgl_contentSwitchesList_t *switchesList,
584 uint8_t startIndex,
585 bool withNav);
586uint8_t nbgl_useCaseGetNbBarsInPage(uint8_t nbBars,
587 const nbgl_contentBarsList_t *barsList,
588 uint8_t startIndex,
589 bool withNav);
590uint8_t nbgl_useCaseGetNbChoicesInPage(uint8_t nbChoices,
591 const nbgl_contentRadioChoice_t *choicesList,
592 uint8_t startIndex,
593 bool withNav);
595
596#ifdef NBGL_KEYPAD
597void nbgl_useCaseKeypad(const char *title,
598 uint8_t minDigits,
599 uint8_t maxDigits,
600 bool shuffled,
601 bool hidden,
602 nbgl_pinValidCallback_t validatePinCallback,
603 nbgl_callback_t backCallback);
604#endif // NBGL_KEYPAD
605
606#ifdef NBGL_KEYBOARD
608#endif // NBGL_KEYBOARD
609
610#ifdef HAVE_SE_TOUCH
611// use case drawing
612DEPRECATED void nbgl_useCaseHome(const char *appName,
613 const nbgl_icon_details_t *appIcon,
614 const char *tagline,
615 bool withSettings,
616 nbgl_callback_t topRightCallback,
617 nbgl_callback_t quitCallback);
618DEPRECATED void nbgl_useCaseHomeExt(const char *appName,
619 const nbgl_icon_details_t *appIcon,
620 const char *tagline,
621 bool withSettings,
622 const char *actionButtonText,
623 nbgl_callback_t actionCallback,
624 nbgl_callback_t topRightCallback,
625 nbgl_callback_t quitCallback);
626DEPRECATED void nbgl_useCaseSettings(const char *settingsTitle,
627 uint8_t initPage,
628 uint8_t nbPages,
629 bool touchableTitle,
630 nbgl_callback_t quitCallback,
631 nbgl_navCallback_t navCallback,
632 nbgl_layoutTouchCallback_t controlsCallback);
634 const char *reviewTitle,
635 const char *reviewSubTitle,
636 const char *rejectText,
637 nbgl_callback_t continueCallback,
638 nbgl_callback_t rejectCallback);
639DEPRECATED void nbgl_useCaseRegularReview(uint8_t initPage,
640 uint8_t nbPages,
641 const char *rejectText,
642 nbgl_layoutTouchCallback_t buttonCallback,
643 nbgl_navCallback_t navCallback,
644 nbgl_choiceCallback_t choiceCallback);
646 const nbgl_pageInfoLongPress_t *infoLongPress,
647 const char *rejectText,
648 nbgl_choiceCallback_t callback);
650 const nbgl_pageInfoLongPress_t *infoLongPress,
651 const char *rejectText,
652 nbgl_choiceCallback_t callback);
653
654DEPRECATED void nbgl_useCaseAddressConfirmationExt(const char *address,
655 nbgl_choiceCallback_t callback,
656 const nbgl_contentTagValueList_t *tagValueList);
657#define nbgl_useCaseAddressConfirmation(__address, __callback) \
658 nbgl_useCaseAddressConfirmationExt(__address, __callback, NULL)
659#endif // HAVE_SE_TOUCH
660
661#ifdef __cplusplus
662} /* extern "C" */
663#endif
664
665#endif /* NBGL_USE_CASE_H */
common content for Graphical Library
nbgl_contentType_t
The different types of predefined contents.
Flow construction API of NBGL.
void(* nbgl_layoutTouchCallback_t)(int token, uint8_t index)
prototype of function to be called when an object is touched
nbgl_layoutKeyboardContentType_t
The different types of keyboard contents.
keyboardCase_t
Letters casing in which to open/set the keyboard.
Definition nbgl_obj.h:617
keyboardMode_t
Mode in which to open/set the keyboard.
Definition nbgl_obj.h:600
API of the Advanced BOLOS Graphical Library, for predefined pages.
struct PACKED__ nbgl_icon_details_s nbgl_icon_details_t
Represents all information about an icon.
DEPRECATED void nbgl_useCaseHome(const char *appName, const nbgl_icon_details_t *appIcon, const char *tagline, bool withSettings, nbgl_callback_t topRightCallback, nbgl_callback_t quitCallback)
nbgl_genericDetailsType_t
The different types of generic detailed page contents.
@ NO_TYPE_WARNING
Invalid type (to use for bars leading to nothing)
@ CENTERED_INFO_WARNING
Centered info.
@ QRCODE_WARNING
QR Code.
@ BAR_LIST_WARNING
list of touchable bars, to display sub-pages
DEPRECATED void nbgl_useCaseSettings(const char *settingsTitle, uint8_t initPage, uint8_t nbPages, bool touchableTitle, nbgl_callback_t quitCallback, nbgl_navCallback_t navCallback, nbgl_layoutTouchCallback_t controlsCallback)
uint8_t nbgl_useCaseGetNbTagValuesInPageExt(uint8_t nbPairs, const nbgl_contentTagValueList_t *tagValueList, uint8_t startIndex, bool isSkippable, bool *requireSpecificDisplay)
nbgl_genericDetailsType_t nbgl_warningDetailsType_t
void(* nbgl_callback_t)(void)
prototype of generic callback function
struct nbgl_preludeDetails_s nbgl_preludeDetails_t
The necessary parameters to build the prelude of a review use-case.
void nbgl_useCaseGenericSettings(const char *appName, uint8_t initPage, const nbgl_genericContents_t *settingContents, const nbgl_contentInfoList_t *infosList, nbgl_callback_t quitCallback)
uint32_t nbgl_operationType_t
This mask is used to describe the type of operation to review with additional options It is a mask of...
void nbgl_useCaseReview(nbgl_operationType_t operationType, const nbgl_contentTagValueList_t *tagValueList, const nbgl_icon_details_t *icon, const char *reviewTitle, const char *reviewSubTitle, const char *finishTitle, nbgl_choiceCallback_t choiceCallback)
struct nbgl_genericDetails_s nbgl_genericDetails_t
The necessary parameters to build the page(s) displayed when the top-right button is touched in intro...
void nbgl_useCaseAction(const nbgl_icon_details_t *icon, const char *message, const char *actionText, nbgl_callback_t callback)
uint8_t nbgl_useCaseGetNbTagValuesInPage(uint8_t nbPairs, const nbgl_contentTagValueList_t *tagValueList, uint8_t startIndex, bool *requireSpecificDisplay)
uint8_t nbgl_useCaseGetNbPagesForTagValueList(const nbgl_contentTagValueList_t *tagValueList)
DEPRECATED void nbgl_useCaseRegularReview(uint8_t initPage, uint8_t nbPages, const char *rejectText, nbgl_layoutTouchCallback_t buttonCallback, nbgl_navCallback_t navCallback, nbgl_choiceCallback_t choiceCallback)
void(* nbgl_pinValidCallback_t)(const uint8_t *pin, uint8_t pinLen)
prototype of pin validation callback function
void nbgl_useCaseReviewStreamingStart(nbgl_operationType_t operationType, const nbgl_icon_details_t *icon, const char *reviewTitle, const char *reviewSubTitle, nbgl_choiceCallback_t choiceCallback)
void nbgl_useCaseHomeAndSettings(const char *appName, const nbgl_icon_details_t *appIcon, const char *tagline, const uint8_t initSettingPage, const nbgl_genericContents_t *settingContents, const nbgl_contentInfoList_t *infosList, const nbgl_homeAction_t *action, nbgl_callback_t quitCallback)
nbgl_genericDetails_t nbgl_warningDetails_t
void nbgl_useCaseStaticReviewLight(const nbgl_contentTagValueList_t *tagValueList, const nbgl_pageInfoLongPress_t *infoLongPress, const char *rejectText, nbgl_choiceCallback_t callback)
uint8_t nbgl_useCaseGetNbInfosInPage(uint8_t nbInfos, const nbgl_contentInfoList_t *infosList, uint8_t startIndex, bool withNav)
void(* nbgl_choiceCallback_t)(bool confirm)
prototype of choice callback function
uint8_t nbgl_useCaseGetNbBarsInPage(uint8_t nbBars, const nbgl_contentBarsList_t *barsList, uint8_t startIndex, bool withNav)
void nbgl_useCaseNavigableContent(const char *title, uint8_t initPage, uint8_t nbPages, nbgl_callback_t quitCallback, nbgl_navCallback_t navCallback, nbgl_layoutTouchCallback_t controlsCallback)
nbgl_homeActionStyle_t
The different types of action button in Home Screen.
@ SOFT_HOME_ACTION
White button, more for extended features.
@ STRONG_HOME_ACTION
Black button, implicating the main action of the App.
void nbgl_useCaseReviewStreamingFinish(const char *finishTitle, nbgl_choiceCallback_t choiceCallback)
void nbgl_useCaseChoiceWithDetails(const nbgl_icon_details_t *icon, const char *message, const char *subMessage, const char *confirmText, const char *cancelText, nbgl_warningDetails_t *details, nbgl_choiceCallback_t callback)
void nbgl_useCaseSpinner(const char *text)
void nbgl_useCaseConfirm(const char *message, const char *subMessage, const char *confirmText, const char *rejectText, nbgl_callback_t callback)
void nbgl_useCaseReviewStart(const nbgl_icon_details_t *icon, const char *reviewTitle, const char *reviewSubTitle, const char *rejectText, nbgl_callback_t continueCallback, nbgl_callback_t rejectCallback)
DEPRECATED void nbgl_useCaseHomeExt(const char *appName, const nbgl_icon_details_t *appIcon, const char *tagline, bool withSettings, const char *actionButtonText, nbgl_callback_t actionCallback, nbgl_callback_t topRightCallback, nbgl_callback_t quitCallback)
void nbgl_useCaseStatus(const char *message, bool isSuccess, nbgl_callback_t quitCallback)
nbgl_warningType_t
The different types of pre-defined warnings.
@ W3C_THREAT_DETECTED_WARN
Web3 Checks: Threat detected (see reportRisk field)
@ W3C_ISSUE_WARN
Web3 Checks issue (not available)
@ BLIND_SIGNING_WARN
Blind signing.
@ GATED_SIGNING_WARN
Gated signing.
@ W3C_NO_THREAT_WARN
Web3 Checks: No Threat detected.
@ W3C_RISK_DETECTED_WARN
Web3 Checks: Risk detected (see reportRisk field)
@ NB_WARNING_TYPES
DEPRECATED void nbgl_useCaseAddressConfirmationExt(const char *address, nbgl_choiceCallback_t callback, const nbgl_contentTagValueList_t *tagValueList)
void nbgl_useCaseGenericConfiguration(const char *title, uint8_t initPage, const nbgl_genericContents_t *contents, nbgl_callback_t quitCallback)
void(* nbgl_actionCallback_t)(uint8_t page)
prototype of function to be called when an page of settings is double-pressed
void nbgl_useCaseKeypad(const char *title, uint8_t minDigits, uint8_t maxDigits, bool shuffled, bool hidden, nbgl_pinValidCallback_t validatePinCallback, nbgl_callback_t backCallback)
void nbgl_useCaseReviewStreamingContinueExt(const nbgl_contentTagValueList_t *tagValueList, nbgl_choiceCallback_t choiceCallback, nbgl_callback_t skipCallback)
void nbgl_useCaseReviewBlindSigning(nbgl_operationType_t operationType, const nbgl_contentTagValueList_t *tagValueList, const nbgl_icon_details_t *icon, const char *reviewTitle, const char *reviewSubTitle, const char *finishTitle, const nbgl_tipBox_t *tipBox, nbgl_choiceCallback_t choiceCallback)
void nbgl_useCaseChoice(const nbgl_icon_details_t *icon, const char *message, const char *subMessage, const char *confirmText, const char *rejectString, nbgl_choiceCallback_t callback)
void nbgl_useCaseGenericReview(const nbgl_genericContents_t *contents, const char *rejectText, nbgl_callback_t rejectCallback)
void nbgl_useCaseKeyboard(const nbgl_keyboardParams_t *params, nbgl_callback_t backCallback)
void nbgl_useCaseStaticReview(const nbgl_contentTagValueList_t *tagValueList, const nbgl_pageInfoLongPress_t *infoLongPress, const char *rejectText, nbgl_choiceCallback_t callback)
void nbgl_useCaseReviewStreamingBlindSigningStart(nbgl_operationType_t operationType, const nbgl_icon_details_t *icon, const char *reviewTitle, const char *reviewSubTitle, nbgl_choiceCallback_t choiceCallback)
void nbgl_useCaseReviewStreamingContinue(const nbgl_contentTagValueList_t *tagValueList, nbgl_choiceCallback_t choiceCallback)
void nbgl_useCaseReviewLight(nbgl_operationType_t operationType, const nbgl_contentTagValueList_t *tagValueList, const nbgl_icon_details_t *icon, const char *reviewTitle, const char *reviewSubTitle, const char *finishTitle, nbgl_choiceCallback_t choiceCallback)
uint8_t nbgl_useCaseGetNbChoicesInPage(uint8_t nbChoices, const nbgl_contentRadioChoice_t *choicesList, uint8_t startIndex, bool withNav)
void(* nbgl_keyboardButtonsCallback_t)(nbgl_layoutKeyboardContent_t *content, uint32_t *mask)
prototype of keyboard buttons callback function
nbgl_genericBarList_t nbgl_warningBarList_t
void nbgl_useCaseReviewStatus(nbgl_reviewStatusType_t reviewStatusType, nbgl_callback_t quitCallback)
void(* nbgl_contentCallback_t)(uint8_t contentIndex, nbgl_content_t *content)
prototype of content navigation callback function
nbgl_reviewStatusType_t
The different types of review status.
@ STATUS_TYPE_TRANSACTION_REJECTED
@ STATUS_TYPE_ADDRESS_REJECTED
@ STATUS_TYPE_TRANSACTION_SIGNED
@ STATUS_TYPE_OPERATION_REJECTED
@ STATUS_TYPE_OPERATION_SIGNED
@ STATUS_TYPE_ADDRESS_VERIFIED
@ STATUS_TYPE_MESSAGE_SIGNED
@ STATUS_TYPE_MESSAGE_REJECTED
bool(* nbgl_navCallback_t)(uint8_t page, nbgl_pageContent_t *content)
prototype of navigation callback function
void nbgl_useCaseAddressReview(const char *address, const nbgl_contentTagValueList_t *additionalTagValueList, const nbgl_icon_details_t *icon, const char *reviewTitle, const char *reviewSubTitle, nbgl_choiceCallback_t choiceCallback)
nbgl_opType_t
The different types of operation to review.
@ TYPE_MESSAGE
@ TYPE_TRANSACTION
For operations transferring a coin or taken from an account to another.
@ TYPE_OPERATION
For other types of operation (generic type)
void nbgl_useCaseAdvancedReviewStreamingStart(nbgl_operationType_t operationType, const nbgl_icon_details_t *icon, const char *reviewTitle, const char *reviewSubTitle, const nbgl_warning_t *warning, nbgl_choiceCallback_t choiceCallback)
void nbgl_useCaseAdvancedReview(nbgl_operationType_t operationType, const nbgl_contentTagValueList_t *tagValueList, const nbgl_icon_details_t *icon, const char *reviewTitle, const char *reviewSubTitle, const char *finishTitle, const nbgl_tipBox_t *tipBox, const nbgl_warning_t *warning, nbgl_choiceCallback_t choiceCallback)
uint8_t nbgl_useCaseGetNbSwitchesInPage(uint8_t nbSwitches, const nbgl_contentSwitchesList_t *switchesList, uint8_t startIndex, bool withNav)
This structure contains data to build a BARS_LIST content.
This structure contains info to build a centered (vertically and horizontally) area,...
This structure contains data to build a INFOS_LIST content.
This structure contains data to build a centered info + long press button content.
This structure contains a list of names to build a list of radio buttons (on the right part of screen...
This structure contains a list of [tag,value] pairs.
This structure contains data to build a content.
The necessary parameters to build a list of touchable bars, to display sub-pages.
const struct nbgl_genericDetails_s * details
array of nbBars structures giving what to display when each bar is touched.
uint8_t nbBars
number of touchable bars
const nbgl_icon_details_t ** icons
array of icons for each bar (nbBars items)
const char *const * subTexts
array of texts for each bar (nbBars items, in black)
const char *const * texts
array of texts for each bar (nbBars items, in black/bold)
uint8_t nbContents
number of contents
const nbgl_content_t * contentsList
array of nbgl_content_t (nbContents items).
nbgl_contentCallback_t contentGetterCallback
function to call to retrieve a given content
The necessary parameters to build the page(s) displayed when the top-right button is touched in intro...
const char * title
text of the page (used to go back)
nbgl_genericBarList_t barList
touchable bars list, if type == BAR_LIST_WARNING
nbgl_layoutQRCode_t qrCode
QR code, if type == QRCODE_WARNING.
nbgl_genericDetailsType_t type
type of content in the page, determining what to use in the following union
nbgl_contentCenter_t centeredInfo
centered info, if type == CENTERED_INFO_WARNING
Structure describing the action button in Home Screen.
const nbgl_icon_details_t * icon
icon to use in action button in Home page
nbgl_callback_t callback
function to call when action button is touched in Home page
const char * text
text to use in action button in Home page
nbgl_homeActionStyle_t style
style of action button
Structure containing configuration for keyboard with confirmation button.
const char * buttonText
button title
nbgl_callback_t onButtonCallback
callback to call when the button is pressed
Structure containing configuration for keyboard with suggestion buttons.
nbgl_keyboardButtonsCallback_t updateButtonsCallback
callback to call when a key is pressed to update suggestions
nbgl_layoutTouchCallback_t onButtonCallback
callback to call when one of the buttons is pressed
const char ** buttons
array of strings for buttons (last ones can be NULL)
int firstButtonToken
first token used for buttons, provided in onButtonCallback
Structure containing all parameters for keyboard use case.
keyboardMode_t mode
keyboard mode to start with
nbgl_kbdSuggestParams_t suggestionParams
nbgl_kbdButtonParams_t confirmationParams
used if type is KEYBOARD_WITH_SUGGESTIONS
bool lettersOnly
if true, only display letter keys and Backspace
uint8_t entryMaxLen
maximum length of text that can be entered
nbgl_layoutKeyboardContentType_t type
type of content
bool numbered
if set to true, the text is preceded on the left by 'number.'
keyboardCase_t casing
keyboard casing mode (lower, upper once or upper locked)
const char * title
centered title explaining the screen
char * entryBuffer
already entered text
uint8_t number
if numbered is true, number used to build 'number.' text
This structure contains info to build a keyboard content (controls that are linked to keyboard)
This structure contains info to build a centered (vertically and horizontally) area,...
This structure contains data to build a page in multi-pages mode (nbgl_pageDrawGenericContent)
Definition nbgl_flow.h:58
This structure contains data to build a SWITCHES_LIST content.
The necessary parameters to build the prelude of a review use-case.
const nbgl_genericDetails_t * details
pointer to structure containing some details
const char * buttonText
text of the black button, used to open details
const char * footerText
text of the footer, used to continue to the review
const nbgl_icon_details_t * icon
icon of the centered info
const char * description
sub-text of the centered info
const char * title
title of the centered info
The necessary parameters to build a tip-box in first review page and the modal if this tip box is tou...
const char * modalTitle
title given to modal window displayed when tip-box is touched
nbgl_contentInfoList_t infos
infos pairs displayed in modal, if type is INFOS_LIST.
const char * text
text of the tip-box
nbgl_contentType_t type
type of page content in the following union
const nbgl_icon_details_t * icon
icon of the tip-box
The necessary parameters to build a warning page preceding a review. One can either use predefinedSet...
const nbgl_preludeDetails_t * prelude
if not null, means that the review can start by a prelude
const nbgl_icon_details_t * reviewTopRightIcon
const nbgl_warningDetails_t * introDetails
const char * dAppProvider
name of the dApp provider, used in some strings
const nbgl_warningDetails_t * reviewDetails
uint32_t predefinedSet
const char * providerMessage
Dedicated provider message. Default one will be used if NULL.
const nbgl_icon_details_t * introTopRightIcon
icon to use in the intro warning page, if not using pre-defined
const char * reportProvider
name of the security report provider, used in some strings
const char * reportUrl
URL of the report, used in some strings.
const nbgl_contentCenter_t * info
parameters to build the intro warning page, if not using pre-defined