Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
nbgl_layout.h
Go to the documentation of this file.
1
7#ifndef NBGL_LAYOUT_H
8#define NBGL_LAYOUT_H
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14#include "nbgl_obj.h"
15#include "nbgl_screen.h"
16#include "nbgl_types.h"
17#include "nbgl_content.h"
18
19/*********************
20 * INCLUDES
21 *********************/
22
23/*********************
24 * DEFINES
25 *********************/
26#define NBGL_NO_TUNE NB_TUNES
27#define NBGL_NO_PROGRESS_INDICATOR 0xFF
28
30#define NBGL_INVALID_TOKEN 0xFF
31
32#ifdef HAVE_SE_TOUCH
35#define EXIT_PAGE 0xFF
36
37#if defined(TARGET_STAX)
38#define NB_MAX_SUGGESTION_BUTTONS 12
39// only 4 buttons are visible at the same time on Stax
40#define NB_MAX_VISIBLE_SUGGESTION_BUTTONS 4
41#define TOUCHABLE_HEADER_BAR_HEIGHT 88
42#define SMALL_FOOTER_HEIGHT 88
43#define SIMPLE_FOOTER_HEIGHT 92
44#define SMALL_CENTERING_HEADER 32
45#define MEDIUM_CENTERING_HEADER 56
46#define LARGE_CENTERING_HEADER 56
47#define MEDIUM_CENTERING_FOOTER 88
48#define LONG_PRESS_BUTTON_HEIGHT 128
49#define UP_FOOTER_BUTTON_HEIGHT 120
50#define ACTION_AND_FOOTER_FOOTER_HEIGHT 216
51#define BOTH_ROUNDED_FOOTER_HEIGHT 216
52
53#define LIST_ITEM_MIN_TEXT_HEIGHT 40
54#define LIST_ITEM_PRE_HEADING 28
55#define LIST_ITEM_PRE_HEADING_LARGE 28
56#define LIST_ITEM_HEADING_SUB_TEXT 12
57
58#define PRE_TAG_VALUE_MARGIN 24
59#define INTER_TAG_VALUE_MARGIN 12
60// width & height for progress bar
61#define PROGRESSBAR_WIDTH 120
62#define PROGRESSBAR_HEIGHT 12
63#define BACK_KEY_WIDTH 88
64#define ICON_TITLE_MARGIN 24
65#define TITLE_DESC_MARGIN 16
66
67#elif defined(TARGET_FLEX)
68#define NB_MAX_SUGGESTION_BUTTONS 8
69// only 2 buttons are visible at the same time on Flex
70#define NB_MAX_VISIBLE_SUGGESTION_BUTTONS 2
71#define TOUCHABLE_HEADER_BAR_HEIGHT 96
72#define SMALL_FOOTER_HEIGHT 96
73#define SIMPLE_FOOTER_HEIGHT 96
74#define SMALL_CENTERING_HEADER 40
75#define MEDIUM_CENTERING_HEADER 64
76#define LARGE_CENTERING_HEADER 64
77#define MEDIUM_CENTERING_FOOTER 64
78#define LONG_PRESS_BUTTON_HEIGHT 152
79#define UP_FOOTER_BUTTON_HEIGHT 136
80#define ACTION_AND_FOOTER_FOOTER_HEIGHT 232
81#define BOTH_ROUNDED_FOOTER_HEIGHT 232
82
83#define LIST_ITEM_MIN_TEXT_HEIGHT SMALL_ICON_SIZE
84#define LIST_ITEM_PRE_HEADING 26
85#define LIST_ITEM_PRE_HEADING_LARGE 30
86#define LIST_ITEM_HEADING_SUB_TEXT 12
87
88#define PRE_TAG_VALUE_MARGIN 0
89#define INTER_TAG_VALUE_MARGIN 24
90// width & height for progress bar
91#define PROGRESSBAR_WIDTH 120
92#define PROGRESSBAR_HEIGHT 12
93#define BACK_KEY_WIDTH 104
94#define ICON_TITLE_MARGIN 24
95#define TITLE_DESC_MARGIN 16
96
97#elif defined(TARGET_APEX)
98#define NB_MAX_SUGGESTION_BUTTONS 8
99// only 2 buttons are visible at the same time on Apex
100#define NB_MAX_VISIBLE_SUGGESTION_BUTTONS 2
101#define TOUCHABLE_HEADER_BAR_HEIGHT 60
102#define SMALL_FOOTER_HEIGHT 60
103#define SIMPLE_FOOTER_HEIGHT 60
104#define SMALL_CENTERING_HEADER 24
105#define MEDIUM_CENTERING_HEADER 40
106#define LARGE_CENTERING_HEADER 60
107#define MEDIUM_CENTERING_FOOTER 40
108#define LONG_PRESS_BUTTON_HEIGHT 88
109#define UP_FOOTER_BUTTON_HEIGHT 88
110#define ACTION_AND_FOOTER_FOOTER_HEIGHT 128
111#define BOTH_ROUNDED_FOOTER_HEIGHT 148
112
113#define LIST_ITEM_MIN_TEXT_HEIGHT SMALL_ICON_SIZE
114#define LIST_ITEM_PRE_HEADING 22
115#define LIST_ITEM_PRE_HEADING_LARGE 22
116#define LIST_ITEM_HEADING_SUB_TEXT 8
117
118#define PRE_TAG_VALUE_MARGIN 0
119#define INTER_TAG_VALUE_MARGIN 16
120// width & height for progress bar
121#define PROGRESSBAR_WIDTH 78
122#define PROGRESSBAR_HEIGHT 8
123#define BACK_KEY_WIDTH 56
124#define ICON_TITLE_MARGIN 16
125#define TITLE_DESC_MARGIN 12
126
127#else // TARGETS
128#error Undefined target
129#endif // TARGETS
130
131#define TAG_VALUE_INTERVALE 4
132#define VALUE_ICON_INTERVALE 12
133
134#define AVAILABLE_WIDTH (SCREEN_WIDTH - 2 * BORDER_MARGIN)
135
136// not really used
137#define NB_MAX_LINES 12
138
139#else // HAVE_SE_TOUCH
140// maximum suggestion buttons for keyboard
141#define NB_MAX_SUGGESTION_BUTTONS 8
142// 7 pixels on each side
143#define AVAILABLE_WIDTH (SCREEN_WIDTH - 2 * 7)
144// maximum number of lines in screen
145#define NB_MAX_LINES 4
146
147#endif // HAVE_SE_TOUCH
148
149#define SPINNER_FIXED 0xFF
150
151#define NB_MAX_DESCRIPTIONS 3
152
153/**********************
154 * TYPEDEFS
155 **********************/
156
161typedef void *nbgl_layout_t;
162
169typedef void (*nbgl_layoutTouchCallback_t)(int token, uint8_t index);
170
177
198
207
217
227
235 bool modal;
237#ifdef HAVE_SE_TOUCH
238 bool withLeftBorder;
240 const char *tapActionText;
241 uint8_t tapActionToken;
243 tune_index_e tapTuneId;
247#else // HAVE_SE_TOUCH
250#endif // HAVE_SE_TOUCH
251 nbgl_screenTickerConfiguration_t ticker; // configuration of ticker (timeout)
253
258typedef struct {
261 const char *text;
264 const char *subText;
265 bool large;
266 uint8_t token;
267 bool inactive;
268 bool centered;
269 tune_index_e tuneId;
271
277typedef struct {
278 const char *title;
279 const char *info;
280 const char *descriptions[NB_MAX_DESCRIPTIONS];
284
290
295
301typedef const char *(*nbgl_menuListCallback_t)(uint8_t choiceIndex);
302
313
318
323
329
334typedef struct {
335 uint8_t nbRows;
336 const char *title;
337 const char **rowTexts;
340
350
354typedef struct {
355 const char **buttons;
359 uint16_t nbCandidates;
365
369typedef struct {
370 const char *text;
371 int token;
372 bool active;
374
379typedef struct {
381 const char *title;
382 const char *text;
384 bool numbered;
385 uint8_t number;
389 union {
394 };
395#ifdef HAVE_SE_TOUCH
396 tune_index_e tuneId;
397#endif
399
400#ifdef HAVE_SE_TOUCH
401
408typedef struct {
409 const char *url;
410 const char *text1;
411 const char *text2;
412 int16_t offsetY;
413 bool centered;
414 bool largeText1;
415} nbgl_layoutQRCode_t;
416
421typedef enum {
422 ROUNDED_AND_FOOTER_STYLE = 0,
423 STRONG_ACTION_AND_FOOTER_STYLE,
424 SOFT_ACTION_AND_FOOTER_STYLE,
425 BOTH_ROUNDED_STYLE
426} nbgl_layoutChoiceButtonsStyle_t;
427
433typedef struct {
434 const char *topText;
435 const char *bottomText;
436 const nbgl_icon_details_t *topIcon;
437 uint8_t token;
438 nbgl_layoutChoiceButtonsStyle_t style;
439 tune_index_e tuneId;
440} nbgl_layoutChoiceButtons_t;
441
448typedef struct {
449 const nbgl_icon_details_t *leftIcon;
450 const char *rightText;
451 uint8_t leftToken;
452 uint8_t rightToken;
453 tune_index_e tuneId;
454} nbgl_layoutHorizontalButtons_t;
455
460typedef enum {
461 BLACK_BACKGROUND
462 = 0,
464 NO_BORDER,
465 LONG_PRESS
467
471typedef struct {
472 const char *text;
473 const nbgl_icon_details_t *icon;
474 uint8_t token;
476 bool fittingContent;
477 bool onBottom;
479 tune_index_e tuneId;
481
486typedef enum {
487 HEADER_EMPTY = 0,
488 HEADER_BACK_AND_TEXT,
489 HEADER_BACK_ICON_AND_TEXT,
490 HEADER_BACK_AND_PROGRESS,
491 HEADER_TITLE,
492 HEADER_EXTENDED_BACK,
493 HEADER_RIGHT_TEXT,
494 NB_HEADER_TYPES
495} nbgl_layoutHeaderType_t;
496
501typedef struct {
502 nbgl_layoutHeaderType_t type;
503 bool separationLine;
504 union {
505 struct {
506 uint16_t height;
507 } emptySpace;
508 struct {
510 *icon;
511 const char *text;
512 uint8_t token;
513 tune_index_e tuneId;
514 } backAndText;
515 struct {
516 const nbgl_icon_details_t *actionIcon;
517 uint8_t activePage;
518 uint8_t nbPages;
519 bool withBack;
520 uint8_t token;
521 uint8_t actionToken;
522 tune_index_e tuneId;
523 } progressAndBack;
524 struct {
525 const char *text;
526 } title;
527 struct {
528 const nbgl_icon_details_t *actionIcon;
529 const char *text;
530 const char *subText;
531 uint8_t textToken;
532 uint8_t backToken;
533 uint8_t actionToken;
534 tune_index_e tuneId;
535 } extendedBack;
536 struct {
537 const char *text;
538 uint8_t token;
539 tune_index_e tuneId;
540 } rightText;
541 };
542} nbgl_layoutHeader_t;
543
548typedef enum {
549 FOOTER_EMPTY = 0,
550 FOOTER_SIMPLE_TEXT,
551 FOOTER_DOUBLE_TEXT,
552 FOOTER_TEXT_AND_NAV,
554 FOOTER_NAV,
555 FOOTER_SIMPLE_BUTTON,
556 FOOTER_CHOICE_BUTTONS,
557 NB_FOOTER_TYPES
558} nbgl_layoutFooterType_t;
559
564typedef struct {
565 nbgl_layoutFooterType_t type;
566 bool separationLine;
567 union {
568 struct {
569 uint16_t height;
570 } emptySpace;
571 struct {
572 const char *text;
573 bool mutedOut;
574 uint8_t token;
575 tune_index_e tuneId;
576 } simpleText;
577 struct {
578 const char *leftText;
579 const char *rightText;
580 uint8_t leftToken;
581 uint8_t rightToken;
582 tune_index_e tuneId;
583 } doubleText;
584 struct {
586 const char *text;
587 uint8_t token;
588 tune_index_e tuneId;
589 } textAndNav;
590 nbgl_layoutNavigationBar_t navigation;
591 nbgl_layoutButton_t button;
592 nbgl_layoutChoiceButtons_t choiceButtons;
593 };
594} nbgl_layoutFooter_t;
595
600typedef enum {
601 UP_FOOTER_LONG_PRESS = 0,
602 UP_FOOTER_BUTTON,
603 UP_FOOTER_HORIZONTAL_BUTTONS,
604 UP_FOOTER_TIP_BOX,
605 UP_FOOTER_TEXT,
606 NB_UP_FOOTER_TYPES
607} nbgl_layoutUpFooterType_t;
608
613typedef struct {
614 nbgl_layoutUpFooterType_t type;
615 union {
616 struct {
617 const char *text;
618 uint8_t token;
619 tune_index_e tuneId;
620 } longPress;
621 nbgl_layoutButton_t button;
622 nbgl_layoutHorizontalButtons_t
623 horizontalButtons;
624 nbgl_contentTipBox_t tipBox;
625 struct {
626 const char *text;
627 uint8_t token;
628 tune_index_e tuneId;
629 } text;
630 };
631} nbgl_layoutUpFooter_t;
632#else // HAVE_SE_TOUCH
640
649
650#endif // HAVE_SE_TOUCH
651
657typedef struct {
658 uint8_t percentage;
659 const char *text;
660 const char *subText;
662
667typedef struct {
668 uint32_t keyMask;
674#ifdef HAVE_SE_TOUCH
675 keyboardCase_t casing;
676#else // HAVE_SE_TOUCH
681#endif // HAVE_SE_TOUCH
683
684/**********************
685 * GLOBAL PROTOTYPES
686 **********************/
691
692#ifdef HAVE_SE_TOUCH
693int nbgl_layoutAddTopRightButton(nbgl_layout_t *layout,
694 const nbgl_icon_details_t *icon,
695 uint8_t token,
696 tune_index_e tuneId);
697int nbgl_layoutAddTouchableBar(nbgl_layout_t *layout, const nbgl_layoutBar_t *barLayout);
698int nbgl_layoutAddSwitch(nbgl_layout_t *layout, const nbgl_layoutSwitch_t *switchLayout);
699int nbgl_layoutAddText(nbgl_layout_t *layout, const char *text, const char *subText);
700int nbgl_layoutAddTextWithAlias(nbgl_layout_t *layout,
701 const char *text,
702 const char *subText,
703 uint8_t token,
704 uint8_t index);
705int nbgl_layoutAddRadioChoice(nbgl_layout_t *layout, const nbgl_layoutRadioChoice_t *choices);
706int nbgl_layoutAddQRCode(nbgl_layout_t *layout, const nbgl_layoutQRCode_t *info);
707int nbgl_layoutAddChoiceButtons(nbgl_layout_t *layout, const nbgl_layoutChoiceButtons_t *info);
708int nbgl_layoutAddHorizontalButtons(nbgl_layout_t *layout,
709 const nbgl_layoutHorizontalButtons_t *info);
710int nbgl_layoutAddTagValueList(nbgl_layout_t *layout, const nbgl_layoutTagValueList_t *list);
711int nbgl_layoutAddLargeCaseText(nbgl_layout_t *layout, const char *text, bool grayedOut);
712int nbgl_layoutAddTextContent(nbgl_layout_t *layout, nbgl_layoutTextContent_t *content);
713int nbgl_layoutAddSeparationLine(nbgl_layout_t *layout);
714
715int nbgl_layoutAddButton(nbgl_layout_t *layout, const nbgl_layoutButton_t *buttonInfo);
716int nbgl_layoutAddLongPressButton(nbgl_layout_t *layout,
717 const char *text,
718 uint8_t token,
719 tune_index_e tuneId);
720int nbgl_layoutAddFooter(nbgl_layout_t *layout,
721 const char *text,
722 uint8_t token,
723 tune_index_e tuneId);
724int nbgl_layoutAddSplitFooter(nbgl_layout_t *layout,
725 const char *leftText,
726 uint8_t leftToken,
727 const char *rightText,
728 uint8_t rightToken,
729 tune_index_e tuneId);
730int nbgl_layoutAddHeader(nbgl_layout_t *layout, const nbgl_layoutHeader_t *headerDesc);
731int nbgl_layoutAddExtendedFooter(nbgl_layout_t *layout, const nbgl_layoutFooter_t *footerDesc);
732int nbgl_layoutAddUpFooter(nbgl_layout_t *layout, const nbgl_layoutUpFooter_t *upFooterDesc);
733int nbgl_layoutAddNavigationBar(nbgl_layout_t *layout, const nbgl_layoutNavigationBar_t *info);
734int nbgl_layoutAddBottomButton(nbgl_layout_t *layout,
735 const nbgl_icon_details_t *icon,
736 uint8_t token,
737 bool separationLine,
738 tune_index_e tuneId);
739int nbgl_layoutAddProgressIndicator(nbgl_layout_t *layout,
740 uint8_t activePage,
741 uint8_t nbPages,
742 bool withBack,
743 uint8_t backToken,
744 tune_index_e tuneId);
746 const char *text,
747 const char *subText,
748 uint8_t percentage);
749int nbgl_layoutAddSpinner(nbgl_layout_t *layout,
750 const char *text,
751 const char *subText,
752 uint8_t initPosition);
753int nbgl_layoutUpdateSpinner(nbgl_layout_t *layout,
754 const char *text,
755 const char *subText,
756 uint8_t position);
757int nbgl_layoutAddSwipe(nbgl_layout_t *layout,
758 uint16_t swipesMask,
759 const char *text,
760 uint8_t token,
761 tune_index_e tuneId);
762int nbgl_layoutInvertBackground(nbgl_layout_t *layout);
763#else // HAVE_SE_TOUCH
765 const char *text,
766 const char *subText,
771int nbgl_layoutAddButton(nbgl_layout_t *layout, const nbgl_layoutButton_t *buttonInfo);
772int nbgl_layoutAddSwitch(nbgl_layout_t *layout, const nbgl_layoutSwitch_t *switchLayout);
773#endif // HAVE_SE_TOUCH
774
775#ifdef NBGL_KEYBOARD
776/* layout objects for page with keyboard */
777int nbgl_layoutAddKeyboard(nbgl_layout_t *layout, const nbgl_layoutKbd_t *kbdInfo);
778#ifdef HAVE_SE_TOUCH
780 uint8_t index,
781 uint32_t keyMask,
782 bool updateCasing,
783 keyboardCase_t casing);
784bool nbgl_layoutKeyboardNeedsRefresh(nbgl_layout_t *layout, uint8_t index);
785DEPRECATED int nbgl_layoutAddSuggestionButtons(nbgl_layout_t *layout,
786 uint8_t nbUsedButtons,
787 const char *buttonTexts[NB_MAX_SUGGESTION_BUTTONS],
788 int firstButtonToken,
789 tune_index_e tuneId);
790DEPRECATED int nbgl_layoutAddEnteredText(nbgl_layout_t *layout,
791 bool numbered,
792 uint8_t number,
793 const char *text,
794 bool grayedOut,
795 int offsetY,
796 int token);
797DEPRECATED int nbgl_layoutUpdateEnteredText(nbgl_layout_t *layout,
798 uint8_t index,
799 bool numbered,
800 uint8_t number,
801 const char *text,
802 bool grayedOut);
803DEPRECATED int nbgl_layoutAddConfirmationButton(nbgl_layout_t *layout,
804 bool active,
805 const char *text,
806 int token,
807 tune_index_e tuneId);
808DEPRECATED int nbgl_layoutUpdateConfirmationButton(nbgl_layout_t *layout,
809 uint8_t index,
810 bool active,
811 const char *text);
812int nbgl_layoutAddKeyboardContent(nbgl_layout_t *layout, nbgl_layoutKeyboardContent_t *content);
813int nbgl_layoutUpdateKeyboardContent(nbgl_layout_t *layout, nbgl_layoutKeyboardContent_t *content);
814#else // HAVE_SE_TOUCH
815int nbgl_layoutUpdateKeyboard(nbgl_layout_t *layout, uint8_t index, uint32_t keyMask);
816int nbgl_layoutAddEnteredText(nbgl_layout_t *layout, const char *text, bool lettersOnly);
818 const char *text,
819 bool lettersOnly,
820 bool obfuscated);
821int nbgl_layoutUpdateEnteredText(nbgl_layout_t *layout, uint8_t index, const char *text);
822#endif // HAVE_SE_TOUCH
823#endif // NBGL_KEYBOARD
824
825#ifdef NBGL_KEYPAD
826#ifdef HAVE_SE_TOUCH
827/* layout objects for page with keypad (Stax) */
828int nbgl_layoutAddKeypad(nbgl_layout_t *layout, keyboardCallback_t callback, bool shuffled);
830 uint8_t index,
831 bool enableValidate,
832 bool enableBackspace,
833 bool enableDigits);
834int nbgl_layoutUpdateKeypadValidation(nbgl_layout_t *layout, bool softValidation);
835DEPRECATED int nbgl_layoutAddHiddenDigits(nbgl_layout_t *layout, uint8_t nbDigits);
836DEPRECATED int nbgl_layoutUpdateHiddenDigits(nbgl_layout_t *layout,
837 uint8_t index,
838 uint8_t nbActive);
840 const char *title,
841 bool hidden,
842 uint8_t nbDigits,
843 const char *text);
845 bool hidden,
846 uint8_t nbActiveDigits,
847 const char *text);
848
849#else // HAVE_SE_TOUCH
850/* layout objects for pages with keypad (nanos) */
852 keyboardCallback_t callback,
853 const char *text,
854 bool shuffled);
856 uint8_t index,
857 bool enableValidate,
858 bool enableBackspace);
859int nbgl_layoutAddHiddenDigits(nbgl_layout_t *layout, uint8_t nbDigits);
860int nbgl_layoutUpdateHiddenDigits(nbgl_layout_t *layout, uint8_t index, uint8_t nbActive);
862 bool hidden,
863 uint8_t nbDigits,
864 const char *text);
866 bool hidden,
867 uint8_t nbActiveDigits,
868 const char *text);
869#endif // HAVE_SE_TOUCH
870#endif // NBGL_KEYPAD
871
872/* generic functions */
873int nbgl_layoutDraw(nbgl_layout_t *layout);
875
876/**********************
877 * MACROS
878 **********************/
879
880#ifdef __cplusplus
881} /* extern "C" */
882#endif
883
884#endif /* NBGL_LAYOUT_H */
common content for Graphical Library
nbgl_contentCenteredInfoStyle_t
possible styles for Centered Info Area
void(* nbgl_layoutTouchCallback_t)(int token, uint8_t index)
prototype of function to be called when an object is touched
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
#define NB_MAX_SUGGESTION_BUTTONS
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.
nbgl_layoutKeyboardContentType_t
The different types of keyboard contents.
@ KEYBOARD_WITH_BUTTON
text entry area + confirmation button
@ KEYBOARD_WITH_SUGGESTIONS
text entry area + suggestion buttons
@ NB_KEYBOARD_CONTENT_TYPES
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.
API to draw all basic graphic objects.
keyboardCase_t
Letters casing in which to open/set the keyboard.
Definition nbgl_obj.h:622
nbgl_buttonEvent_t
Definition nbgl_obj.h:315
keyboardMode_t
Mode in which to open/set the keyboard.
Definition nbgl_obj.h:605
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:599
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 list of [tag,value] pairs.
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
This structure contains info to build a confirmation button.
int token
token of the button
const char * text
text of the button
bool active
if true, button is active, otherwise inactive (grayed-out)
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)
uint8_t number
if numbered is true, number used to build 'number.' text
const char * text
already entered text
nbgl_layoutKeyboardContentType_t type
type of content
nbgl_layoutSuggestionButtons_t suggestionButtons
nbgl_layoutConfirmationButton_t confirmationButton
used if type is KEYBOARD_WITH_SUGGESTIONS
const char * title
centered title explaining the screen
bool numbered
if set to true, the text is preceded on the left by 'number.'
bool grayedOut
(unused, kept for compatibility)
This structure contains info to build a left content area.
uint8_t nbRows
number of rows in the area
const char * title
title of area in bold
const nbgl_icon_details_t ** rowIcons
array of nbRows icon
const char ** rowTexts
array of nbRows texts (displayed in regular)
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 to build suggestion buttons.
uint8_t nbUsedButtons
the number of actually used (displayed) buttons
const char ** buttons
array of 4 strings for buttons (last ones can be NULL)
This structure contains info for Text content, to be set with nbgl_layoutAddTextContent().
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)