Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
nbgl_layout.h
Go to the documentation of this file.
1
6
7#ifndef NBGL_LAYOUT_H
8#define NBGL_LAYOUT_H
9
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16#include "nbgl_obj.h"
17#include "nbgl_screen.h"
18#include "nbgl_types.h"
19#include "nbgl_content.h"
20#include "nbgl_layout_types.h"
21
22/*********************
23 * INCLUDES
24 *********************/
25
26/*********************
27 * DEFINES
28 *********************/
29#define NBGL_NO_PROGRESS_INDICATOR 0xFF
30
32#define NBGL_INVALID_TOKEN 0xFF
33
34#ifdef HAVE_SE_TOUCH
37#define EXIT_PAGE 0xFF
38
39#if defined(TARGET_STAX)
40#define NB_MAX_SUGGESTION_BUTTONS 12
41// only 4 buttons are visible at the same time on Stax
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
54
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
59
60#define PRE_TAG_VALUE_MARGIN 24
61#define INTER_TAG_VALUE_MARGIN 12
62// width & height for progress bar
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
68
69#elif defined(TARGET_FLEX) || defined(TARGET_APOLLO)
70#define NB_MAX_SUGGESTION_BUTTONS 8
71// only 2 buttons are visible at the same time on Flex
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
84
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
89
90#define PRE_TAG_VALUE_MARGIN 0
91#define INTER_TAG_VALUE_MARGIN 24
92// width & height for progress bar
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
98
99#elif defined(TARGET_APEX)
100#define NB_MAX_SUGGESTION_BUTTONS 8
101// only 2 buttons are visible at the same time on Apex
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
114
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
119
120#define PRE_TAG_VALUE_MARGIN 0
121#define INTER_TAG_VALUE_MARGIN 16
122// width & height for progress bar
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
128
129#else // TARGETS
130#error Undefined target
131#endif // TARGETS
132
133#define TAG_VALUE_INTERVALE 4
134#define VALUE_ICON_INTERVALE 12
135
136#define AVAILABLE_WIDTH (SCREEN_WIDTH - 2 * BORDER_MARGIN)
137
138// not really used
139#define NB_MAX_LINES 12
140
141#else // HAVE_SE_TOUCH
142// maximum suggestion buttons for keyboard
143#define NB_MAX_SUGGESTION_BUTTONS 8
144// 7 pixels on each side
145#define AVAILABLE_WIDTH (SCREEN_WIDTH - 2 * 7)
146// maximum number of lines in screen
147#define NB_MAX_LINES 4
148
149#endif // HAVE_SE_TOUCH
150
151#define SPINNER_FIXED 0xFF
152
153#define NB_MAX_DESCRIPTIONS 3
154
155/**********************
156 * TYPEDEFS
157 **********************/
158
163typedef void *nbgl_layout_t;
164
171
192
201
211
221
229 bool modal;
231#ifdef HAVE_SE_TOUCH
232 bool withLeftBorder;
234 const char *tapActionText;
235 uint8_t tapActionToken;
237 tune_index_e tapTuneId;
241#else // HAVE_SE_TOUCH
244#endif // HAVE_SE_TOUCH
245 nbgl_screenTickerConfiguration_t ticker; // configuration of ticker (timeout)
247
252typedef struct {
255 const char *text;
258 const char *subText;
259 bool large;
260 uint8_t token;
261 bool inactive;
262 bool centered;
263 tune_index_e tuneId;
265
271typedef struct {
272 const char *title;
273 const char *info;
278
284
289
295typedef const char *(*nbgl_menuListCallback_t)(uint8_t choiceIndex);
296
307
312
317
323
324#ifdef HAVE_SE_TOUCH
325
330typedef enum {
331 ROUNDED_AND_FOOTER_STYLE = 0,
332 STRONG_ACTION_AND_FOOTER_STYLE,
333 SOFT_ACTION_AND_FOOTER_STYLE,
334 BOTH_ROUNDED_STYLE
335} nbgl_layoutChoiceButtonsStyle_t;
336
342typedef struct {
343 const char *topText;
344 const char *bottomText;
345 const nbgl_icon_details_t *topIcon;
346 uint8_t token;
347 nbgl_layoutChoiceButtonsStyle_t style;
348 tune_index_e tuneId;
349} nbgl_layoutChoiceButtons_t;
350
357typedef struct {
358 const nbgl_icon_details_t *leftIcon;
359 const char *rightText;
360 uint8_t leftToken;
361 uint8_t rightToken;
362 tune_index_e tuneId;
363} nbgl_layoutHorizontalButtons_t;
364
369typedef enum {
370 BLACK_BACKGROUND
371 = 0,
373 NO_BORDER,
374 LONG_PRESS
376
380typedef struct {
381 const char *text;
382 const nbgl_icon_details_t *icon;
383 uint8_t token;
385 bool fittingContent;
386 bool onBottom;
388 tune_index_e tuneId;
390
395typedef enum {
396 HEADER_EMPTY = 0,
397 HEADER_BACK_AND_TEXT,
398 HEADER_BACK_ICON_AND_TEXT,
399 HEADER_BACK_AND_PROGRESS,
400 HEADER_TITLE,
401 HEADER_EXTENDED_BACK,
402 HEADER_RIGHT_TEXT,
403 NB_HEADER_TYPES
404} nbgl_layoutHeaderType_t;
405
410typedef struct {
411 nbgl_layoutHeaderType_t type;
412 bool separationLine;
413 union {
414 struct {
415 uint16_t height;
416 } emptySpace;
417 struct {
419 *icon;
420 const char *text;
421 uint8_t token;
422 tune_index_e tuneId;
423 } backAndText;
424 struct {
425 const nbgl_icon_details_t *actionIcon;
426 uint8_t activePage;
427 uint8_t nbPages;
428 bool withBack;
429 uint8_t token;
430 uint8_t actionToken;
431 tune_index_e tuneId;
432 } progressAndBack;
433 struct {
434 const char *text;
435 } title;
436 struct {
437 const nbgl_icon_details_t *actionIcon;
438 const char *text;
439 const char *subText;
440 uint8_t textToken;
441 uint8_t backToken;
442 uint8_t actionToken;
443 tune_index_e tuneId;
444 } extendedBack;
445 struct {
446 const char *text;
447 uint8_t token;
448 tune_index_e tuneId;
449 } rightText;
450 };
451} nbgl_layoutHeader_t;
452
457typedef enum {
458 FOOTER_EMPTY = 0,
459 FOOTER_SIMPLE_TEXT,
460 FOOTER_DOUBLE_TEXT,
461 FOOTER_TEXT_AND_NAV,
463 FOOTER_NAV,
464 FOOTER_SIMPLE_BUTTON,
465 FOOTER_CHOICE_BUTTONS,
466 NB_FOOTER_TYPES
467} nbgl_layoutFooterType_t;
468
473typedef struct {
474 nbgl_layoutFooterType_t type;
475 bool separationLine;
476 union {
477 struct {
478 uint16_t height;
479 } emptySpace;
480 struct {
481 const char *text;
482 bool mutedOut;
483 uint8_t token;
484 tune_index_e tuneId;
485 } simpleText;
486 struct {
487 const char *leftText;
488 const char *rightText;
489 uint8_t leftToken;
490 uint8_t rightToken;
491 tune_index_e tuneId;
492 } doubleText;
493 struct {
495 const char *text;
496 uint8_t token;
497 tune_index_e tuneId;
498 } textAndNav;
499 nbgl_layoutNavigationBar_t navigation;
500 nbgl_layoutButton_t button;
501 nbgl_layoutChoiceButtons_t choiceButtons;
502 };
503} nbgl_layoutFooter_t;
504
509typedef enum {
510 UP_FOOTER_LONG_PRESS = 0,
511 UP_FOOTER_BUTTON,
512 UP_FOOTER_HORIZONTAL_BUTTONS,
513 UP_FOOTER_TIP_BOX,
514 UP_FOOTER_TEXT,
515 NB_UP_FOOTER_TYPES
516} nbgl_layoutUpFooterType_t;
517
522typedef struct {
523 nbgl_layoutUpFooterType_t type;
524 union {
525 struct {
526 const char *text;
527 uint8_t token;
528 tune_index_e tuneId;
529 } longPress;
530 nbgl_layoutButton_t button;
531 nbgl_layoutHorizontalButtons_t
532 horizontalButtons;
533 nbgl_contentTipBox_t tipBox;
534 struct {
535 const char *text;
536 uint8_t token;
537 tune_index_e tuneId;
538 } text;
539 };
540} nbgl_layoutUpFooter_t;
541#else // HAVE_SE_TOUCH
549
558
559#endif // HAVE_SE_TOUCH
560
566typedef struct {
567 uint8_t percentage;
568 const char *text;
569 const char *subText;
571
576typedef struct {
577 uint32_t keyMask;
583#ifdef HAVE_SE_TOUCH
584 keyboardCase_t casing;
585#else // HAVE_SE_TOUCH
590#endif // HAVE_SE_TOUCH
592
593/**********************
594 * GLOBAL PROTOTYPES
595 **********************/
600
601#ifdef HAVE_SE_TOUCH
602int nbgl_layoutAddTopRightButton(nbgl_layout_t *layout,
603 const nbgl_icon_details_t *icon,
604 uint8_t token,
605 tune_index_e tuneId);
606int nbgl_layoutAddTouchableBar(nbgl_layout_t *layout, const nbgl_layoutBar_t *barLayout);
607int nbgl_layoutAddSwitch(nbgl_layout_t *layout, const nbgl_layoutSwitch_t *switchLayout);
608int nbgl_layoutAddText(nbgl_layout_t *layout, const char *text, const char *subText);
609int nbgl_layoutAddTextWithAlias(nbgl_layout_t *layout,
610 const char *text,
611 const char *subText,
612 uint8_t token,
613 uint8_t index);
614int nbgl_layoutAddRadioChoice(nbgl_layout_t *layout, const nbgl_layoutRadioChoice_t *choices);
615int nbgl_layoutAddQRCode(nbgl_layout_t *layout, const nbgl_layoutQRCode_t *info);
616int nbgl_layoutAddChoiceButtons(nbgl_layout_t *layout, const nbgl_layoutChoiceButtons_t *info);
617int nbgl_layoutAddHorizontalButtons(nbgl_layout_t *layout,
618 const nbgl_layoutHorizontalButtons_t *info);
619int nbgl_layoutAddTagValueList(nbgl_layout_t *layout, const nbgl_layoutTagValueList_t *list);
620int nbgl_layoutAddLargeCaseText(nbgl_layout_t *layout, const char *text, bool grayedOut);
621int nbgl_layoutAddTextContent(nbgl_layout_t *layout, nbgl_layoutTextContent_t *content);
622int nbgl_layoutAddSeparationLine(nbgl_layout_t *layout);
623
624int nbgl_layoutAddButton(nbgl_layout_t *layout, const nbgl_layoutButton_t *buttonInfo);
625int nbgl_layoutAddLongPressButton(nbgl_layout_t *layout,
626 const char *text,
627 uint8_t token,
628 tune_index_e tuneId);
629int nbgl_layoutAddFooter(nbgl_layout_t *layout,
630 const char *text,
631 uint8_t token,
632 tune_index_e tuneId);
633int nbgl_layoutAddSplitFooter(nbgl_layout_t *layout,
634 const char *leftText,
635 uint8_t leftToken,
636 const char *rightText,
637 uint8_t rightToken,
638 tune_index_e tuneId);
639int nbgl_layoutAddHeader(nbgl_layout_t *layout, const nbgl_layoutHeader_t *headerDesc);
640int nbgl_layoutAddExtendedFooter(nbgl_layout_t *layout, const nbgl_layoutFooter_t *footerDesc);
641int nbgl_layoutAddUpFooter(nbgl_layout_t *layout, const nbgl_layoutUpFooter_t *upFooterDesc);
642int nbgl_layoutAddNavigationBar(nbgl_layout_t *layout, const nbgl_layoutNavigationBar_t *info);
643int nbgl_layoutAddBottomButton(nbgl_layout_t *layout,
644 const nbgl_icon_details_t *icon,
645 uint8_t token,
646 bool separationLine,
647 tune_index_e tuneId);
648int nbgl_layoutAddProgressIndicator(nbgl_layout_t *layout,
649 uint8_t activePage,
650 uint8_t nbPages,
651 bool withBack,
652 uint8_t backToken,
653 tune_index_e tuneId);
655 const char *text,
656 const char *subText,
657 uint8_t percentage);
658int nbgl_layoutAddSpinner(nbgl_layout_t *layout,
659 const char *text,
660 const char *subText,
661 uint8_t initPosition);
662int nbgl_layoutUpdateSpinner(nbgl_layout_t *layout,
663 const char *text,
664 const char *subText,
665 uint8_t position);
666int nbgl_layoutAddSwipe(nbgl_layout_t *layout,
667 uint16_t swipesMask,
668 const char *text,
669 uint8_t token,
670 tune_index_e tuneId);
671int nbgl_layoutInvertBackground(nbgl_layout_t *layout);
672#else // HAVE_SE_TOUCH
674 const char *text,
675 const char *subText,
680int nbgl_layoutAddButton(nbgl_layout_t *layout, const nbgl_layoutButton_t *buttonInfo);
681int nbgl_layoutAddSwitch(nbgl_layout_t *layout, const nbgl_layoutSwitch_t *switchLayout);
682#endif // HAVE_SE_TOUCH
683
684#ifdef NBGL_KEYBOARD
685/* layout objects for page with keyboard */
686int nbgl_layoutAddKeyboard(nbgl_layout_t *layout, const nbgl_layoutKbd_t *kbdInfo);
687#ifdef HAVE_SE_TOUCH
689 uint8_t index,
690 uint32_t keyMask,
691 bool updateCasing,
692 keyboardCase_t casing);
693bool nbgl_layoutKeyboardNeedsRefresh(nbgl_layout_t *layout, uint8_t index);
694int nbgl_layoutAddKeyboardContent(nbgl_layout_t *layout, nbgl_layoutKeyboardContent_t *content);
695int nbgl_layoutUpdateKeyboardContent(nbgl_layout_t *layout, nbgl_layoutKeyboardContent_t *content);
696#else // HAVE_SE_TOUCH
697int nbgl_layoutUpdateKeyboard(nbgl_layout_t *layout, uint8_t index, uint32_t keyMask);
698int nbgl_layoutAddEnteredText(nbgl_layout_t *layout, const char *text, bool lettersOnly);
700 const char *text,
701 bool lettersOnly,
702 bool obfuscated);
703int nbgl_layoutUpdateEnteredText(nbgl_layout_t *layout, uint8_t index, const char *text);
704#endif // HAVE_SE_TOUCH
705#endif // NBGL_KEYBOARD
706
707#ifdef NBGL_KEYPAD
708#ifdef HAVE_SE_TOUCH
709/* layout objects for page with keypad (Stax) */
710int nbgl_layoutAddKeypad(nbgl_layout_t *layout, keyboardCallback_t callback, bool shuffled);
712 uint8_t index,
713 bool enableValidate,
714 bool enableBackspace,
715 bool enableDigits);
716int nbgl_layoutUpdateKeypadValidation(nbgl_layout_t *layout, bool softValidation);
718 const char *title,
719 bool hidden,
720 uint8_t nbDigits,
721 const char *text);
723 bool hidden,
724 uint8_t nbActiveDigits,
725 const char *text);
726
727#else // HAVE_SE_TOUCH
728/* layout objects for pages with keypad (nanos) */
730 keyboardCallback_t callback,
731 const char *text,
732 bool shuffled);
734 uint8_t index,
735 bool enableValidate,
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);
740 bool hidden,
741 uint8_t nbDigits,
742 const char *text);
744 bool hidden,
745 uint8_t nbActiveDigits,
746 const char *text);
747#endif // HAVE_SE_TOUCH
748#endif // NBGL_KEYPAD
749
750/* generic functions */
751int nbgl_layoutDraw(nbgl_layout_t *layout);
753
754/**********************
755 * MACROS
756 **********************/
757
758#ifdef __cplusplus
759} /* extern "C" */
760#endif
761
762#endif /* NBGL_LAYOUT_H */
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_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)
@ NO_ARROWS
@ 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
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.
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.
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.
nbgl_buttonEvent_t
Definition nbgl_obj.h:196
void(* keyboardCallback_t)(char touchedKey)
prototype of function to be called when a valid key is pressed on keyboard Backspace is equal to 0x8 ...
Definition nbgl_obj.h:480
keyboardCase_t
Letters casing in which to open/set the keyboard.
keyboardMode_t
Mode in which to open/set the keyboard.
API to manage screens.
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
This structure contains info to build a single button.
const char * text
button text
const nbgl_icon_details_t * icon
a buffer containing the 1BPP icon for button
nbgl_layoutButtonStyle_t style
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).
This structure contains info to build a left content area.
This structure contains a list of names to build a menu list on Nanos, with for each item a descripti...
nbgl_menuListCallback_t callback
function to call to retrieve a menu list item text
uint8_t nbChoices
total number of choices in the menu list
uint8_t selectedChoice
index of the selected choice (centered, in bold)
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().
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)