Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
nbgl_use_case.h
Go to the documentation of this file.
1
6
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_USE_CASE_ONLY
20// apollo apps: low-level NBGL headers are forbidden, only include the types used by this API
21#include "nbgl_obj_types.h"
22#include "nbgl_layout_types.h"
23#include "nbgl_page_types.h"
24#elif defined(NBGL_PAGE)
25#include "nbgl_page.h"
26#else // NBGL_USE_CASE_ONLY
27#include "nbgl_flow.h"
28#endif // NBGL_USE_CASE_ONLY
29
30/*********************
31 * DEFINES
32 *********************/
37#define FIRST_USER_TOKEN 50
38
43#define LAST_PAGE_FOR_REVIEW 0xFF
44
48#if defined(TARGET_STAX)
49#define NB_MAX_LINES_IN_DETAILS 12
50#elif defined(TARGET_FLEX) || defined(TARGET_APOLLO)
51#define NB_MAX_LINES_IN_DETAILS 11
52#elif defined(TARGET_APEX)
53#define NB_MAX_LINES_IN_DETAILS 11
54#else
55// Nano
56#define NB_MAX_LINES_IN_DETAILS 3
57#endif // TARGETS
58
62#if defined(TARGET_STAX)
63#define NB_MAX_LINES_IN_REVIEW 10
64#elif defined(TARGET_FLEX) || defined(TARGET_APOLLO)
65#define NB_MAX_LINES_IN_REVIEW 9
66#elif defined(TARGET_APEX)
67#define NB_MAX_LINES_IN_REVIEW 9
68#else
69// Nano
70#define NB_MAX_LINES_IN_REVIEW 3
71#endif // TARGETS
72
78#define NB_MAX_DISPLAYED_PAIRS_IN_REVIEW 4
79
80#ifndef NBGL_USE_CASE_ONLY
81// pixel heights of the SE-side layout: meaningless on apollo, where the MCU lays out and
82// paginates use cases
86#define TAG_VALUE_AREA_HEIGHT (SCREEN_HEIGHT - SMALL_CENTERING_HEADER - SIMPLE_FOOTER_HEIGHT)
87
91#define INFOS_AREA_HEIGHT (SCREEN_HEIGHT - TOUCHABLE_HEADER_BAR_HEIGHT)
92#endif // NBGL_USE_CASE_ONLY
93
97#define TAGLINE_PART1 "This app enables signing\ntransactions on the"
98#define TAGLINE_PART2 "network."
99
103#define APP_DESCRIPTION_MAX_LEN 74
104
108#define MAX_APP_NAME_FOR_SDK_TAGLINE \
109 (APP_DESCRIPTION_MAX_LEN - 1 - (sizeof(TAGLINE_PART1) + sizeof(TAGLINE_PART2)))
110
116#define INIT_HOME_PAGE 0xff
117
119#define STATUS_SCREEN_DURATION 3000
120
121// returns true if the given warning structure requires display of an initial page (internal usage)
122#define HAS_INITIAL_WARNING(_warning) \
123 ((_warning->predefinedSet \
124 & ((1 << W3C_THREAT_DETECTED_WARN) | (1 << W3C_RISK_DETECTED_WARN) \
125 | (1 << BLIND_SIGNING_WARN) | (1 << GATED_SIGNING_WARN))) \
126 || (_warning->info != NULL))
127
128/**********************
129 * MACROS
130 **********************/
131
132/**********************
133 * TYPEDEFS
134 **********************/
138typedef void (*nbgl_callback_t)(void);
139
146typedef bool (*nbgl_navCallback_t)(uint8_t page, nbgl_pageContent_t *content);
147
152typedef void (*nbgl_choiceCallback_t)(bool confirm);
153
158typedef void (*nbgl_actionCallback_t)(uint8_t page);
159
165typedef void (*nbgl_pinValidCallback_t)(const uint8_t *pin, uint8_t pinLen);
166
173 uint32_t *mask);
174
180typedef void (*nbgl_contentCallback_t)(uint8_t contentIndex, nbgl_content_t *content);
181
192
201
212
218typedef struct {
219 const char *text;
221 const char *modalTitle;
223 union {
226 };
228
240
242
247typedef struct {
248 uint8_t nbBars;
249 const char *const *texts;
250 const char *const *subTexts;
252 const struct nbgl_genericDetails_s
255
257
263typedef struct nbgl_genericDetails_s {
264 const char *title;
267 union {
270#ifdef NBGL_QRCODE
271 nbgl_layoutQRCode_t qrCode;
272#endif // NBGL_QRCODE
276 };
278
280
294
307
339
349static inline const char *nbgl_useCaseGetSignPrefix(const nbgl_warning_t *warning)
350{
351 if (warning == NULL) {
352 return "Sign";
353 }
354 if (warning->predefinedSet & (1 << W3C_THREAT_DETECTED_WARN)) {
355 return "Accept threat and sign";
356 }
357 if (warning->predefinedSet
358 & ((1 << W3C_RISK_DETECTED_WARN) | (1 << BLIND_SIGNING_WARN) | (1 << GATED_SIGNING_WARN))) {
359 return "Accept risk and sign";
360 }
361 return "Sign";
362}
363
364#ifdef NBGL_KEYBOARD
368typedef struct {
369#ifdef HAVE_SE_TOUCH
370 const char *buttonText;
371#endif
374
386
393typedef struct {
395 const char *title;
397 uint8_t entryMaxLen;
402#ifdef HAVE_SE_TOUCH
403 bool numbered;
404 uint8_t number;
405 keyboardCase_t casing;
406 bool obfuscated;
407#endif
408 union {
412 };
414#endif // NBGL_KEYBOARD
415
427
433#define REAL_TYPE_MASK 0xF
434
439#define SKIPPABLE_OPERATION (1 << 4)
440
441/* Compile-time invariants: nbgl_opType_t values must fit within REAL_TYPE_MASK, and the first
442 * modifier flag must start at the very next bit so that type bits and flag bits never overlap. */
443_Static_assert(TYPE_OPERATION <= REAL_TYPE_MASK,
444 "nbgl_opType_t max value exceeds REAL_TYPE_MASK — update the mask");
445_Static_assert(SKIPPABLE_OPERATION == (REAL_TYPE_MASK + 1),
446 "SKIPPABLE_OPERATION must be the first bit above REAL_TYPE_MASK");
447
453#define BLIND_OPERATION (1 << 5)
454
460#define RISKY_OPERATION (1 << 6)
461
467#define NO_THREAT_OPERATION (1 << 7)
468
474#define ADDRESS_BOOK_OPERATION (1 << 8)
475
482typedef uint32_t nbgl_operationType_t;
483
498
499/**********************
500 * GLOBAL PROTOTYPES
501 **********************/
502
503void nbgl_useCaseHomeAndSettings(const char *appName,
504 const nbgl_icon_details_t *appIcon,
505 const char *tagline,
506 const uint8_t initSettingPage,
507 const nbgl_genericContents_t *settingContents,
508 const nbgl_contentInfoList_t *infosList,
509 const nbgl_homeAction_t *action,
510 nbgl_callback_t quitCallback);
511bool nbgl_useCaseShowInfoAndSettings(uint8_t initPage);
512
514 const nbgl_contentTagValueList_t *tagValueList,
515 const nbgl_icon_details_t *icon,
516 const char *reviewTitle,
517 const char *reviewSubTitle,
518 const char *finishTitle,
519 nbgl_choiceCallback_t choiceCallback);
520
522 const nbgl_contentTagValueList_t *tagValueList,
523 const nbgl_icon_details_t *icon,
524 const char *reviewTitle,
525 const char *reviewSubTitle,
526 const char *finishTitle,
527 const nbgl_tipBox_t *tipBox,
528 nbgl_choiceCallback_t choiceCallback);
530 const nbgl_contentTagValueList_t *tagValueList,
531 const nbgl_icon_details_t *icon,
532 const char *reviewTitle,
533 const char *reviewSubTitle,
534 const char *finishTitle,
535 const nbgl_tipBox_t *tipBox,
536 const nbgl_warning_t *warning,
537 nbgl_choiceCallback_t choiceCallback);
538
540 const nbgl_contentTagValueList_t *tagValueList,
541 const nbgl_icon_details_t *icon,
542 const char *reviewTitle,
543 const char *reviewSubTitle,
544 const char *finishTitle,
545 nbgl_choiceCallback_t choiceCallback);
546
547void nbgl_useCaseAddressReview(const char *address,
548 const nbgl_contentTagValueList_t *additionalTagValueList,
549 const nbgl_icon_details_t *icon,
550 const char *reviewTitle,
551 const char *reviewSubTitle,
552 nbgl_choiceCallback_t choiceCallback);
553
555 nbgl_callback_t quitCallback);
556
558 const nbgl_icon_details_t *icon,
559 const char *reviewTitle,
560 const char *reviewSubTitle,
561 nbgl_choiceCallback_t choiceCallback);
562
564 const nbgl_icon_details_t *icon,
565 const char *reviewTitle,
566 const char *reviewSubTitle,
567 nbgl_choiceCallback_t choiceCallback);
568
570 const nbgl_icon_details_t *icon,
571 const char *reviewTitle,
572 const char *reviewSubTitle,
573 const nbgl_warning_t *warning,
574 nbgl_choiceCallback_t choiceCallback);
575
577 nbgl_choiceCallback_t choiceCallback,
578 nbgl_callback_t skipCallback);
579
581 nbgl_choiceCallback_t choiceCallback);
582
583void nbgl_useCaseReviewStreamingFinish(const char *finishTitle,
584 nbgl_choiceCallback_t choiceCallback);
585
587 const char *rejectText,
588 nbgl_callback_t rejectCallback);
589
590void nbgl_useCaseGenericConfiguration(const char *title,
591 uint8_t initPage,
592 const nbgl_genericContents_t *contents,
593 nbgl_callback_t quitCallback);
594
595void nbgl_useCaseGenericSettings(const char *appName,
596 uint8_t initPage,
597 const nbgl_genericContents_t *settingContents,
598 const nbgl_contentInfoList_t *infosList,
599 nbgl_callback_t quitCallback);
600
602 const char *message,
603 const char *subMessage,
604 const char *confirmText,
605 const char *rejectString,
606 nbgl_choiceCallback_t callback);
608 const char *message,
609 const char *subMessage,
610 const char *confirmText,
611 const char *cancelText,
612 nbgl_warningDetails_t *details,
613 nbgl_choiceCallback_t callback);
615 const nbgl_icon_details_t *headerIcon,
616 const char *title,
617 const char *message,
618 const char *subMessage,
619 const char *confirmText,
620 const char *cancelText,
621 nbgl_warningDetails_t *details,
622 nbgl_choiceCallback_t callback);
623void nbgl_useCaseStatus(const char *message, bool isSuccess, nbgl_callback_t quitCallback);
624
625void nbgl_useCaseConfirm(const char *message,
626 const char *subMessage,
627 const char *confirmText,
628 const char *rejectText,
629 nbgl_callback_t callback);
630
632 const char *message,
633 const char *actionText,
634 nbgl_callback_t callback);
635
636void nbgl_useCaseSpinner(const char *text);
637
638void nbgl_useCaseNavigableContent(const char *title,
639 uint8_t initPage,
640 uint8_t nbPages,
641 nbgl_callback_t quitCallback,
642 nbgl_navCallback_t navCallback,
643 nbgl_layoutTouchCallback_t controlsCallback);
644
645// utils
646uint8_t nbgl_useCaseGetNbTagValuesInPage(uint8_t nbPairs,
647 const nbgl_contentTagValueList_t *tagValueList,
648 uint8_t startIndex,
649 bool *requireSpecificDisplay);
650uint8_t nbgl_useCaseGetNbChoicesInPage(uint8_t nbChoices,
651 const nbgl_contentRadioChoice_t *choicesList,
652 uint8_t startIndex,
653 bool withNav);
654
655#ifdef NBGL_KEYPAD
656void nbgl_useCaseKeypad(const char *title,
657 uint8_t minDigits,
658 uint8_t maxDigits,
659 bool shuffled,
660 bool hidden,
661 nbgl_pinValidCallback_t validatePinCallback,
662 nbgl_callback_t backCallback);
663#endif // NBGL_KEYPAD
664
665#ifdef NBGL_KEYBOARD
667#endif // NBGL_KEYBOARD
668
669#ifdef HAVE_SE_TOUCH
670// use case drawing
671DEPRECATED void nbgl_useCaseHome(const char *appName,
672 const nbgl_icon_details_t *appIcon,
673 const char *tagline,
674 bool withSettings,
675 nbgl_callback_t topRightCallback,
676 nbgl_callback_t quitCallback);
677DEPRECATED void nbgl_useCaseSettings(const char *settingsTitle,
678 uint8_t initPage,
679 uint8_t nbPages,
680 bool touchableTitle,
681 nbgl_callback_t quitCallback,
682 nbgl_navCallback_t navCallback,
683 nbgl_layoutTouchCallback_t controlsCallback);
684void nbgl_useCaseReviewStart(const nbgl_icon_details_t *icon,
685 const char *reviewTitle,
686 const char *reviewSubTitle,
687 const char *rejectText,
688 nbgl_callback_t continueCallback,
689 nbgl_callback_t rejectCallback);
690void nbgl_useCaseStaticReview(const nbgl_contentTagValueList_t *tagValueList,
691 const nbgl_pageInfoLongPress_t *infoLongPress,
692 const char *rejectText,
693 nbgl_choiceCallback_t callback);
694void nbgl_useCaseStaticReviewLight(const nbgl_contentTagValueList_t *tagValueList,
695 const nbgl_pageInfoLongPress_t *infoLongPress,
696 const char *rejectText,
697 nbgl_choiceCallback_t callback);
698
699DEPRECATED void nbgl_useCaseAddressConfirmationExt(const char *address,
700 nbgl_choiceCallback_t callback,
701 const nbgl_contentTagValueList_t *tagValueList);
702#define nbgl_useCaseAddressConfirmation(__address, __callback) \
703 nbgl_useCaseAddressConfirmationExt(__address, __callback, NULL)
704#endif // HAVE_SE_TOUCH
705
706#ifdef __cplusplus
707} /* extern "C" */
708#endif
709
710#endif /* NBGL_USE_CASE_H */
common content for Graphical Library
struct nbgl_contentTagValueList_s nbgl_contentTagValueList_t
This structure contains a list of [tag,value] pairs.
nbgl_contentType_t
The different types of predefined contents.
struct nbgl_contentInfoList_s nbgl_contentInfoList_t
This structure contains data to build a INFOS_LIST content.
Flow construction API of NBGL.
struct nbgl_pageContent_s nbgl_pageContent_t
This structure contains data to build a page in multi-pages mode (nbgl_pageDrawGenericContent).
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
nbgl_layoutKeyboardContentType_t
The different types of keyboard contents.
Types of NBGL objects also used by the use-case API.
keyboardCase_t
Letters casing in which to open/set the keyboard.
keyboardMode_t
Mode in which to open/set the keyboard.
API of the Advanced BOLOS Graphical Library, for predefined pages.
Types of NBGL pages also used by the use-case API.
nbgl_contentInfoLongPress_t nbgl_pageInfoLongPress_t
Deprecated, kept for retro compatibility.
struct PACKED__ nbgl_icon_details_s nbgl_icon_details_t
Represents all information about an icon.
nbgl_genericDetailsType_t
The different types of generic detailed page contents.
@ NO_TYPE_WARNING
Invalid type (to use for bars leading to nothing).
@ LEFT_CONTENT_WARNING
left-aligned title and icon/text rows (touch devices only)
@ CENTERED_INFO_WARNING
Centered info.
@ QRCODE_WARNING
QR Code.
@ BAR_LIST_WARNING
list of touchable bars, to display sub-pages
static const char * nbgl_useCaseGetSignPrefix(const nbgl_warning_t *warning)
Get the start of the sentence confirming the signature, from the review warnings.
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.
#define SKIPPABLE_OPERATION
This is to use in nbgl_operationType_t when the operation is skippable. This is used to add a Skip bu...
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)
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_choiceCallback_t)(bool confirm)
prototype of choice callback function
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_useCaseAdvancedChoiceWithDetails(const nbgl_icon_details_t *centerIcon, const nbgl_icon_details_t *headerIcon, const char *title, 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)
bool nbgl_useCaseShowInfoAndSettings(uint8_t initPage)
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
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_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
#define REAL_TYPE_MASK
Mask to apply on nbgl_operationType_t to extract the base nbgl_opType_t. Bits 0-3 are reserved for th...
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)
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 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_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
nbgl_layoutLeftContent_t leftContent
left content, if type == LEFT_CONTENT_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.
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
nbgl_layoutKeyboardContentType_t type
type of content
const char * title
centered title explaining the screen
char * entryBuffer
already entered text
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.
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