|
Embedded SDK
Embedded SDK
|
API of the Advanced BOLOS Graphical Library, for predefined layouts. More...


Go to the source code of this file.
Classes | |
| struct | nbgl_layoutNavigationBar_t |
| This structure contains info to build a navigation bar at the bottom of the screen. More... | |
| struct | nbgl_layoutNavigation_t |
| This structure contains info to build a navigation bar at the bottom of the screen. More... | |
| struct | nbgl_layoutDescription_s |
| Structure containing all information when creating a layout. This structure must be passed as argument to nbgl_layoutGet. More... | |
| struct | nbgl_layoutBar_t |
| This structure contains info to build a clickable "bar" with a text and an icon. More... | |
| struct | nbgl_layoutMenuList_t |
| This structure contains a list of names to build a menu list on Nanos, with for each item a description (names array) More... | |
| struct | nbgl_layoutLeftContent_t |
| This structure contains info to build a left content area. More... | |
| struct | nbgl_layoutQRCode_t |
| This structure contains info to build a centered (vertically and horizontally) area, with a QR Code, a possible text (black, bold) under it, and a possible sub-text (black, regular) under it. More... | |
| struct | nbgl_layoutChoiceButtons_t |
| This structure contains info to build a pair of buttons, one on top of the other. More... | |
| struct | nbgl_layoutHorizontalButtons_t |
| This structure contains info to build a pair of buttons, the small one, with icon, on the left of the other. More... | |
| struct | nbgl_layoutButton_t |
| This structure contains info to build a single button. More... | |
| struct | nbgl_layoutSuggestionButtons_t |
| This structure contains info to build suggestion buttons. More... | |
| struct | nbgl_layoutConfirmationButton_t |
| This structure contains info to build a confirmation button. More... | |
| struct | nbgl_layoutKeyboardContent_t |
| This structure contains info to build a keyboard content (controls that are linked to keyboard) More... | |
| struct | nbgl_layoutHeader_t |
| This structure contains info to build a header. More... | |
| struct | nbgl_layoutFooter_t |
| This structure contains info to build an extended footer. More... | |
| struct | nbgl_layoutUpFooter_t |
| This structure contains info to build an up-footer (area on top of footer). More... | |
| struct | nbgl_layoutProgressBar_t |
| This structure contains info to build a progress bar with info. The progress bar itself is 120px width * 12px height. More... | |
| struct | nbgl_layoutKbd_t |
| This structure contains info to build a keyboard with nbgl_layoutAddKeyboard() More... | |
Macros | |
| #define | NBGL_NO_TUNE NB_TUNES |
| #define | NBGL_NO_PROGRESS_INDICATOR 0xFF |
| To be used when a control token shall not be used. | |
| #define | NBGL_INVALID_TOKEN 0xFF |
| #define | EXIT_PAGE 0xFF |
| #define | AVAILABLE_WIDTH (SCREEN_WIDTH - 2 * BORDER_MARGIN) |
| #define | NB_MAX_LINES 12 |
| #define | SPINNER_FIXED 0xFF |
| position to use for a "fixed" spinner | |
Typedefs | |
| typedef void * | nbgl_layout_t |
| type shared externally | |
| typedef void(* | nbgl_layoutTouchCallback_t) (int token, uint8_t index) |
| prototype of function to be called when an object is touched | |
| typedef 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 | |
| typedef struct nbgl_layoutDescription_s | nbgl_layoutDescription_t |
| Structure containing all information when creating a layout. This structure must be passed as argument to nbgl_layoutGet. | |
| typedef nbgl_contentSwitch_t | nbgl_layoutSwitch_t |
| Deprecated, kept for retro compatibility. | |
| typedef nbgl_contentRadioChoice_t | nbgl_layoutRadioChoice_t |
| Deprecated, kept for retro compatibility. | |
| typedef const char *(* | nbgl_menuListCallback_t) (uint8_t choiceIndex) |
| prototype of menu list item retrieval callback | |
| typedef nbgl_contentTagValue_t | nbgl_layoutTagValue_t |
| Deprecated, kept for retro compatibility. | |
| typedef nbgl_contentTagValueList_t | nbgl_layoutTagValueList_t |
| Deprecated, kept for retro compatibility. | |
| typedef nbgl_contentCenteredInfo_t | nbgl_layoutCenteredInfo_t |
| Deprecated, kept for retro compatibility. | |
Functions | |
| nbgl_layout_t * | nbgl_layoutGet (const nbgl_layoutDescription_t *description) |
| returns a layout of the given type. The layout is reset | |
| 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 under it, and a possible text in gray under it. | |
| int | nbgl_layoutAddContentCenter (nbgl_layout_t *layout, const nbgl_contentCenter_t *info) |
| Creates an area on the center of the main panel, with a possible icon, and possible texts under it. | |
| int | nbgl_layoutAddLeftContent (nbgl_layout_t *layout, const nbgl_layoutLeftContent_t *info) |
| Creates an area with a title, and rows of icon + text, left aligned. | |
| int | nbgl_layoutAddTopRightButton (nbgl_layout_t *layout, const nbgl_icon_details_t *icon, uint8_t token, tune_index_e tuneId) |
| Creates a Top-right button in the top right corner of the top panel. | |
| int | nbgl_layoutAddTouchableBar (nbgl_layout_t *layout, const nbgl_layoutBar_t *barLayout) |
| Creates a touchable bar in main panel. | |
| int | nbgl_layoutAddSwitch (nbgl_layout_t *layout, const nbgl_layoutSwitch_t *switchLayout) |
| Creates a switch with the given text and its state. | |
| int | nbgl_layoutAddText (nbgl_layout_t *layout, const char *text, const char *subText) |
| Creates an area with given text (in bold) and sub text (in regular) | |
| int | nbgl_layoutAddTextWithAlias (nbgl_layout_t *layout, const char *text, const char *subText, uint8_t token, uint8_t index) |
Creates an area with given text (in bold) and sub text (in regular), with a
| |
| int | nbgl_layoutAddRadioChoice (nbgl_layout_t *layout, const nbgl_layoutRadioChoice_t *choices) |
| Creates a list of radio buttons (on the right) | |
| int | nbgl_layoutAddQRCode (nbgl_layout_t *layout, const nbgl_layoutQRCode_t *info) |
| Creates an area on the center of the main panel, with a QRCode, a possible text in black (bold) under it, and a possible text in black under it. | |
| int | nbgl_layoutAddChoiceButtons (nbgl_layout_t *layout, const nbgl_layoutChoiceButtons_t *info) |
| Creates two buttons to make a choice. Both buttons are mandatory. Both buttons are full width, one under the other. | |
| int | nbgl_layoutAddHorizontalButtons (nbgl_layout_t *layout, const nbgl_layoutHorizontalButtons_t *info) |
| Creates two buttons to make a choice. Both buttons are mandatory The left one contains only an icon and is round, the other contains only a text. | |
| int | nbgl_layoutAddTagValueList (nbgl_layout_t *layout, const nbgl_layoutTagValueList_t *list) |
| Creates a list of [tag,value] pairs. | |
| int | nbgl_layoutAddLargeCaseText (nbgl_layout_t *layout, const char *text, bool grayedOut) |
| Creates an area with given text in 32px font (in Black or Light Gray) | |
| int | nbgl_layoutAddTextContent (nbgl_layout_t *layout, const char *title, const char *description, const char *info) |
| Creates in the main container three text areas: | |
| int | nbgl_layoutAddSeparationLine (nbgl_layout_t *layout) |
| adds a separation line on bottom of the last added item | |
| int | nbgl_layoutAddButton (nbgl_layout_t *layout, const nbgl_layoutButton_t *buttonInfo) |
| Creates a rounded button in the main container. | |
| int | nbgl_layoutAddLongPressButton (nbgl_layout_t *layout, const char *text, uint8_t token, tune_index_e tuneId) |
| Creates a long press button in the main container. | |
| int | nbgl_layoutAddFooter (nbgl_layout_t *layout, const char *text, uint8_t token, tune_index_e tuneId) |
| Creates a touchable text at the footer of the screen, separated with a thin line from the rest of the screen. | |
| int | nbgl_layoutAddSplitFooter (nbgl_layout_t *layout, const char *leftText, uint8_t leftToken, const char *rightText, uint8_t rightToken, tune_index_e tuneId) |
| Creates 2 touchable texts at the footer of the screen, separated with a thin line from the rest of the screen, and from each other. | |
| int | nbgl_layoutAddHeader (nbgl_layout_t *layout, const nbgl_layoutHeader_t *headerDesc) |
| Creates a touchable (or not) area at the header of the screen, containing various controls, described in the given structure. This header is not part of the main container. | |
| int | nbgl_layoutAddExtendedFooter (nbgl_layout_t *layout, const nbgl_layoutFooter_t *footerDesc) |
| Creates a touchable area at the footer of the screen, containing various controls, described in the given structure. This footer is not part of the main container. | |
| int | nbgl_layoutAddUpFooter (nbgl_layout_t *layout, const nbgl_layoutUpFooter_t *upFooterDesc) |
| Creates a touchable area on top of the footer of the screen, containing various controls, described in the given structure. This up-footer is not part of the main container. | |
| int | nbgl_layoutAddNavigationBar (nbgl_layout_t *layout, const nbgl_layoutNavigationBar_t *info) |
| Creates a navigation bar on bottom of main container. | |
| int | nbgl_layoutAddBottomButton (nbgl_layout_t *layout, const nbgl_icon_details_t *icon, uint8_t token, bool separationLine, tune_index_e tuneId) |
| Creates a centered button at bottom of main container. | |
| int | nbgl_layoutAddProgressIndicator (nbgl_layout_t *layout, uint8_t activePage, uint8_t nbPages, bool withBack, uint8_t backToken, tune_index_e tuneId) |
| Creates a kind of navigation bar with an optional <- arrow on the left. This widget is placed on top of the main container. | |
| int | nbgl_layoutAddProgressBar (nbgl_layout_t *layout, const char *text, const char *subText, uint8_t percentage) |
| Creates an area in main panel to display a progress bar, with a title text and a subtext if needed. | |
| int | nbgl_layoutAddSpinner (nbgl_layout_t *layout, const char *text, const char *subText, uint8_t initPosition) |
| Creates a centered (vertically & horizontally) spinner with a text under it. | |
| int | nbgl_layoutUpdateSpinner (nbgl_layout_t *layout, const char *text, const char *subText, uint8_t position) |
| Update an existing spinner (must be the only object of the layout) | |
| int | nbgl_layoutAddSwipe (nbgl_layout_t *layout, uint16_t swipesMask, const char *text, uint8_t token, tune_index_e tuneId) |
| Creates a swipe interaction on the main container. | |
| int | nbgl_layoutInvertBackground (nbgl_layout_t *layout) |
| Inverts the background color (black instead of white) | |
| 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, bool updateCasing, keyboardCase_t casing) |
| Updates an existing keyboard on bottom of the screen, with the given configuration. | |
| bool | nbgl_layoutKeyboardNeedsRefresh (nbgl_layout_t *layout, uint8_t index) |
| function called to know whether the keyboard has been redrawn and needs a refresh | |
| DEPRECATED int | nbgl_layoutAddSuggestionButtons (nbgl_layout_t *layout, uint8_t nbUsedButtons, const char *buttonTexts[NB_MAX_SUGGESTION_BUTTONS], int firstButtonToken, tune_index_e tuneId) |
| DEPRECATED int | nbgl_layoutAddEnteredText (nbgl_layout_t *layout, bool numbered, uint8_t number, const char *text, bool grayedOut, int offsetY, int token) |
| Adds a "text entry" area under the previously entered object. This area can be preceded (beginning of line) by an index, indicating for example the entered world. A vertical gray line is placed under the text. This text must be vertical placed in the screen with offsetY. | |
| DEPRECATED int | nbgl_layoutUpdateEnteredText (nbgl_layout_t *layout, uint8_t index, bool numbered, uint8_t number, const char *text, bool grayedOut) |
| Updates an existing "text entry" area, created with nbgl_layoutAddEnteredText() | |
| DEPRECATED int | nbgl_layoutAddConfirmationButton (nbgl_layout_t *layout, bool active, const char *text, int token, tune_index_e tuneId) |
| Adds a black full width confirmation button on top of the previously added keyboard. | |
| DEPRECATED int | nbgl_layoutUpdateConfirmationButton (nbgl_layout_t *layout, uint8_t index, bool active, const char *text) |
| Updates an existing black full width confirmation button on top of the previously added keyboard. | |
| int | nbgl_layoutAddKeyboardContent (nbgl_layout_t *layout, nbgl_layoutKeyboardContent_t *content) |
| Adds an area containing a potential title, a text entry and either confirmation or suggestion buttons, on top of the keyboard. | |
| int | nbgl_layoutUpdateKeyboardContent (nbgl_layout_t *layout, nbgl_layoutKeyboardContent_t *content) |
| Updates an area containing a potential title, a text entry and either confirmation or suggestion buttons, on top of the keyboard This area must have been built with nbgl_layoutAddKeyboardContent, and the type must not change. | |
| int | nbgl_layoutAddKeypad (nbgl_layout_t *layout, keyboardCallback_t callback, bool shuffled) |
| Adds a keypad on bottom of the screen, with the associated callback. | |
| int | nbgl_layoutUpdateKeypad (nbgl_layout_t *layout, uint8_t index, bool enableValidate, bool enableBackspace, bool enableDigits) |
| Updates an existing keypad on bottom of the screen, with the given configuration. | |
| int | nbgl_layoutUpdateKeypadValidation (nbgl_layout_t *layout, bool softValidation) |
| Updates an existing keypad on bottom of the screen, with the given configuration, without redraw. | |
| DEPRECATED 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, as full circles The placeholder is "underligned" with a thin horizontal line of the expected full length. | |
| DEPRECATED int | nbgl_layoutUpdateHiddenDigits (nbgl_layout_t *layout, uint8_t index, uint8_t nbActive) |
| Updates an existing set of hidden digits, with the given configuration. | |
| int | nbgl_layoutAddKeypadContent (nbgl_layout_t *layout, const char *title, 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 entered digits as small discs. On Stax, the placeholder is "underligned" with a thin horizontal line of the expected full length. | |
| 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. | |
| int | nbgl_layoutDraw (nbgl_layout_t *layout) |
| Applies given layout. The screen will be redrawn. | |
| int | nbgl_layoutRelease (nbgl_layout_t *layout) |
| Release the layout obtained with nbgl_layoutGet() | |
API of the Advanced BOLOS Graphical Library, for predefined layouts.
Definition in file nbgl_layout.h.
| #define AVAILABLE_WIDTH (SCREEN_WIDTH - 2 * BORDER_MARGIN) |
Definition at line 131 of file nbgl_layout.h.
| #define EXIT_PAGE 0xFF |
Definition at line 35 of file nbgl_layout.h.
| #define NB_MAX_LINES 12 |
Definition at line 134 of file nbgl_layout.h.
| #define NBGL_INVALID_TOKEN 0xFF |
special code used as index of action callback to inform when Exit key (X) is pressed in the navigation bar
Definition at line 34 of file nbgl_layout.h.
| #define NBGL_NO_PROGRESS_INDICATOR 0xFF |
To be used when a control token shall not be used.
Definition at line 29 of file nbgl_layout.h.
| #define NBGL_NO_TUNE NB_TUNES |
Definition at line 26 of file nbgl_layout.h.
| #define SPINNER_FIXED 0xFF |
position to use for a "fixed" spinner
Definition at line 144 of file nbgl_layout.h.
| typedef void* nbgl_layout_t |
type shared externally
Definition at line 154 of file nbgl_layout.h.
| typedef 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
| layout | layout concerned by the event |
| event | type of button event |
Definition at line 169 of file nbgl_layout.h.
Deprecated, kept for retro compatibility.
Definition at line 308 of file nbgl_layout.h.
| typedef struct nbgl_layoutDescription_s nbgl_layoutDescription_t |
Structure containing all information when creating a layout. This structure must be passed as argument to nbgl_layoutGet.
Deprecated, kept for retro compatibility.
Definition at line 274 of file nbgl_layout.h.
Deprecated, kept for retro compatibility.
Definition at line 269 of file nbgl_layout.h.
Deprecated, kept for retro compatibility.
Definition at line 297 of file nbgl_layout.h.
Deprecated, kept for retro compatibility.
Definition at line 302 of file nbgl_layout.h.
| typedef void(* nbgl_layoutTouchCallback_t) (int token, uint8_t index) |
prototype of function to be called when an object is touched
| token | integer passed when registering callback |
| index | when the object touched is a list of radio buttons, gives the index of the activated button |
Definition at line 162 of file nbgl_layout.h.
| typedef const char *(* nbgl_menuListCallback_t) (uint8_t choiceIndex) |
prototype of menu list item retrieval callback
| choiceIndex | index of the menu list item to retrieve (from 0 (to nbChoices-1)) |
Definition at line 281 of file nbgl_layout.h.
The different styles for a button.
Definition at line 381 of file nbgl_layout.h.
The different styles for a pair of buttons.
Definition at line 342 of file nbgl_layout.h.
The different types of extended footer.
| Enumerator | |
|---|---|
| FOOTER_EMPTY | empty space, to have a better vertical centering of centered info |
| FOOTER_SIMPLE_TEXT | simple touchable text in bold |
| FOOTER_DOUBLE_TEXT | 2 touchable texts in bold, separated by a vertical line (only on Stax) |
| FOOTER_TEXT_AND_NAV | touchable text in bold on the left, navigation on the right (only on Flex) |
| FOOTER_NAV | navigation bar |
| FOOTER_SIMPLE_BUTTON | simple black or white button (see nbgl_layoutButtonStyle_t) |
| FOOTER_CHOICE_BUTTONS | double buttons (see nbgl_layoutChoiceButtonsStyle_t) |
| NB_FOOTER_TYPES | |
Definition at line 520 of file nbgl_layout.h.
The different types of extended header.
Definition at line 458 of file nbgl_layout.h.
The different types of keyboard contents.
| Enumerator | |
|---|---|
| KEYBOARD_WITH_SUGGESTIONS | text entry area + suggestion buttons |
| KEYBOARD_WITH_BUTTON | text entry area + confirmation button |
| NB_KEYBOARD_CONTENT_TYPES | |
Definition at line 407 of file nbgl_layout.h.
possible directions for Navigation arrows
| Enumerator | |
|---|---|
| HORIZONTAL_NAV | '<' and '>' are displayed, to navigate between pages and steps |
| VERTICAL_NAV | '\/' and '/\' are displayed, to navigate in a list (vertical scrolling) |
Definition at line 196 of file nbgl_layout.h.
possible styles for Navigation arrows (it's a bit field)
| Enumerator | |
|---|---|
| NO_ARROWS | |
| LEFT_ARROW | left arrow is used |
| RIGHT_ARROW | right arrow is used |
Definition at line 205 of file nbgl_layout.h.
The different types of area on top of footer.
Definition at line 572 of file nbgl_layout.h.
| int nbgl_layoutAddBottomButton | ( | nbgl_layout_t * | layout, |
| const nbgl_icon_details_t * | icon, | ||
| uint8_t | token, | ||
| bool | separationLine, | ||
| tune_index_e | tuneId | ||
| ) |
Creates a centered button at bottom of main container.
incompatible with navigation bar
| layout | the current layout |
| icon | icon inside the round button |
| token | used as parameter of userCallback when button is touched |
| separationLine | if set to true, adds a light gray separation line on top of the container |
| tuneId | if not NBGL_NO_TUNE, a tune will be played when button is pressed |
Definition at line 1312 of file nbgl_layout.c.
| int nbgl_layoutAddButton | ( | nbgl_layout_t * | layout, |
| const nbgl_layoutButton_t * | buttonInfo | ||
| ) |
Creates a rounded button in the main container.
| layout | the current layout |
| buttonInfo | structure giving the description of button (text, icon, layout) |
Definition at line 2333 of file nbgl_layout.c.
| 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 under it, and a possible text in gray under it.
| layout | the current layout |
| info | structure giving the description of buttons (texts, icons, layout) |
Definition at line 1706 of file nbgl_layout.c.
| int nbgl_layoutAddChoiceButtons | ( | nbgl_layout_t * | layout, |
| const nbgl_layoutChoiceButtons_t * | info | ||
| ) |
Creates two buttons to make a choice. Both buttons are mandatory. Both buttons are full width, one under the other.
| layout | the current layout |
| info | structure giving the description of buttons (texts, icons, layout) |
Definition at line 2009 of file nbgl_layout.c.
| DEPRECATED int nbgl_layoutAddConfirmationButton | ( | nbgl_layout_t * | layout, |
| bool | active, | ||
| const char * | text, | ||
| int | token, | ||
| tune_index_e | tuneId | ||
| ) |
Adds a black full width confirmation button on top of the previously added keyboard.
| layout | the current layout |
| active | if true, button is active, otherwise inactive (grayed-out) |
| text | text of the button |
| token | token of the button, used in onActionCallback |
| tuneId | tune to play when button is pressed |
Definition at line 813 of file nbgl_layout_keyboard.c.
| int nbgl_layoutAddContentCenter | ( | nbgl_layout_t * | layout, |
| const nbgl_contentCenter_t * | info | ||
| ) |
Creates an area on the center of the main panel, with a possible icon, and possible texts under it.
| layout | the current layout |
| info | structure giving the description of the Content Center |
Definition at line 1766 of file nbgl_layout.c.
| DEPRECATED int nbgl_layoutAddEnteredText | ( | nbgl_layout_t * | layout, |
| bool | numbered, | ||
| uint8_t | number, | ||
| const char * | text, | ||
| bool | grayedOut, | ||
| int | offsetY, | ||
| int | token | ||
| ) |
Adds a "text entry" area under the previously entered object. This area can be preceded (beginning of line) by an index, indicating for example the entered world. A vertical gray line is placed under the text. This text must be vertical placed in the screen with offsetY.
| layout | the current layout |
| numbered | if true, the "number" param is used as index |
| number | index of the text |
| text | string to display in the area |
| grayedOut | if true, the text is grayed out (unused) |
| offsetY | vertical offset from the top of the page |
| token | token provided in onActionCallback when the "cross" is touched |
Definition at line 687 of file nbgl_layout_keyboard.c.
| int nbgl_layoutAddExtendedFooter | ( | nbgl_layout_t * | layout, |
| const nbgl_layoutFooter_t * | footerDesc | ||
| ) |
Creates a touchable area at the footer of the screen, containing various controls, described in the given structure. This footer is not part of the main container.
| layout | the current layout |
| footerDesc | if not NBGL_NO_TUNE, a tune will be played when button is long pressed |
Definition at line 2851 of file nbgl_layout.c.
| int nbgl_layoutAddFooter | ( | nbgl_layout_t * | layout, |
| const char * | text, | ||
| uint8_t | token, | ||
| tune_index_e | tuneId | ||
| ) |
Creates a touchable text at the footer of the screen, separated with a thin line from the rest of the screen.
| layout | the current layout |
| text | text to used in the footer |
| token | token to use when the footer is touched |
| tuneId | if not NBGL_NO_TUNE, a tune will be played when button is long pressed |
Definition at line 2462 of file nbgl_layout.c.
| int nbgl_layoutAddHeader | ( | nbgl_layout_t * | layout, |
| const nbgl_layoutHeader_t * | headerDesc | ||
| ) |
Creates a touchable (or not) area at the header of the screen, containing various controls, described in the given structure. This header is not part of the main container.
| layout | the current layout |
| headerDesc | description of the header to add |
shift all centered objects
Definition at line 2515 of file nbgl_layout.c.
| DEPRECATED 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, as full circles The placeholder is "underligned" with a thin horizontal line of the expected full length.
| layout | the current layout |
| nbDigits | number of digits to be displayed |
Definition at line 226 of file nbgl_layout_keypad.c.
| int nbgl_layoutAddHorizontalButtons | ( | nbgl_layout_t * | layout, |
| const nbgl_layoutHorizontalButtons_t * | info | ||
| ) |
Creates two buttons to make a choice. Both buttons are mandatory The left one contains only an icon and is round, the other contains only a text.
| layout | the current layout |
| info | structure giving the description of buttons (text, icon, tokens) |
Definition at line 2032 of file nbgl_layout.c.
| int nbgl_layoutAddKeyboard | ( | nbgl_layout_t * | layout, |
| const nbgl_layoutKbd_t * | kbdInfo | ||
| ) |
Creates a keyboard on bottom of the screen, with the given configuration.
| layout | the current layout |
| kbdInfo | configuration of the keyboard to draw (including the callback when touched) |
Definition at line 540 of file nbgl_layout_keyboard.c.
| int nbgl_layoutAddKeyboardContent | ( | nbgl_layout_t * | layout, |
| nbgl_layoutKeyboardContent_t * | content | ||
| ) |
Adds an area containing a potential title, a text entry and either confirmation or suggestion buttons, on top of the keyboard.
| layout | the current layout |
| content | structure containing the info |
Definition at line 899 of file nbgl_layout_keyboard.c.
| int nbgl_layoutAddKeypad | ( | nbgl_layout_t * | layout, |
| keyboardCallback_t | callback, | ||
| bool | shuffled | ||
| ) |
Adds a keypad on bottom of the screen, with the associated callback.
| layout | the current layout |
| callback | function called when any of the key is touched |
| shuffled | if set to true, digits are shuffled in keypad |
Definition at line 87 of file nbgl_layout_keypad.c.
| int nbgl_layoutAddKeypadContent | ( | nbgl_layout_t * | layout, |
| const char * | title, | ||
| 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 entered digits as small discs. On Stax, the placeholder is "underligned" with a thin horizontal line of the expected full length.
| layout | the current layout |
| title | the text to use on top of the digits |
| hidden | if set to true, digits appear as discs, otherwise as visible digits (given in text param) |
| nbDigits | number of digits to be displayed (only used if hidden is true) |
| text | only used if hidden is false |
Definition at line 380 of file nbgl_layout_keypad.c.
| int nbgl_layoutAddLargeCaseText | ( | nbgl_layout_t * | layout, |
| const char * | text, | ||
| bool | grayedOut | ||
| ) |
Creates an area with given text in 32px font (in Black or Light Gray)
| layout | the current layout |
| text | text to be displayed (auto-wrap) |
| grayedOut | if true, use light-gray instead of black |
Definition at line 1488 of file nbgl_layout.c.
| int nbgl_layoutAddLeftContent | ( | nbgl_layout_t * | layout, |
| const nbgl_layoutLeftContent_t * | info | ||
| ) |
Creates an area with a title, and rows of icon + text, left aligned.
| layout | the current layout |
| info | structure giving the description of rows (number of rows, title, icons, texts) |
Definition at line 1788 of file nbgl_layout.c.
| int nbgl_layoutAddLongPressButton | ( | nbgl_layout_t * | layout, |
| const char * | text, | ||
| uint8_t | token, | ||
| tune_index_e | tuneId | ||
| ) |
Creates a long press button in the main container.
| layout | the current layout |
| text | text of the button button |
| token | token attached to actionCallback when long time of press is elapsed |
| tuneId | if not NBGL_NO_TUNE, a tune will be played when button is long pressed |
Definition at line 2434 of file nbgl_layout.c.
| int nbgl_layoutAddNavigationBar | ( | nbgl_layout_t * | layout, |
| const nbgl_layoutNavigationBar_t * | info | ||
| ) |
Creates a navigation bar on bottom of main container.
| layout | the current layout |
| info | structure giving the description of the navigation bar |
Definition at line 1286 of file nbgl_layout.c.
| int nbgl_layoutAddProgressBar | ( | nbgl_layout_t * | layout, |
| const char * | text, | ||
| const char * | subText, | ||
| uint8_t | percentage | ||
| ) |
Creates an area in main panel to display a progress bar, with a title text and a subtext if needed.
| layout | the current layout |
| text | text to draw under the progress bar |
| subText | text to draw under the text (can be NULL) |
| percentage | initial percentage position. |
Definition at line 2213 of file nbgl_layout.c.
| int nbgl_layoutAddProgressIndicator | ( | nbgl_layout_t * | layout, |
| uint8_t | activePage, | ||
| uint8_t | nbPages, | ||
| bool | withBack, | ||
| uint8_t | backToken, | ||
| tune_index_e | tuneId | ||
| ) |
Creates a kind of navigation bar with an optional <- arrow on the left. This widget is placed on top of the main container.
| layout | the current layout |
| activePage | current page [O,(nbPages-1)] |
| nbPages | number of pages |
| withBack | if true, the back arrow is drawn |
| backToken | token used with actionCallback is withBack is true |
| tuneId | if not NBGL_NO_TUNE, a tune will be played when back button is pressed |
Definition at line 3563 of file nbgl_layout.c.
| int nbgl_layoutAddQRCode | ( | nbgl_layout_t * | layout, |
| const nbgl_layoutQRCode_t * | info | ||
| ) |
Creates an area on the center of the main panel, with a QRCode, a possible text in black (bold) under it, and a possible text in black under it.
| layout | the current layout |
| info | structure giving the description of buttons (texts, icons, layout) |
Definition at line 1880 of file nbgl_layout.c.
| int nbgl_layoutAddRadioChoice | ( | nbgl_layout_t * | layout, |
| const nbgl_layoutRadioChoice_t * | choices | ||
| ) |
Creates a list of radio buttons (on the right)
| layout | the current layout |
| choices | structure giving the list of choices and the current selected one |
Definition at line 1610 of file nbgl_layout.c.
| int nbgl_layoutAddSeparationLine | ( | nbgl_layout_t * | layout | ) |
adds a separation line on bottom of the last added item
| layout | the current layout |
Definition at line 2314 of file nbgl_layout.c.
| int nbgl_layoutAddSpinner | ( | nbgl_layout_t * | layout, |
| const char * | text, | ||
| const char * | subText, | ||
| uint8_t | initPosition | ||
| ) |
Creates a centered (vertically & horizontally) spinner with a text under it.
| layout | the current layout |
| text | text to draw under the spinner |
| subText | text to draw under the text (can be NULL) |
| initPosition | if set to any value expect SPINNER_FIXED, it will be used as the init position of the spinner |
Definition at line 3594 of file nbgl_layout.c.
| int nbgl_layoutAddSplitFooter | ( | nbgl_layout_t * | layout, |
| const char * | leftText, | ||
| uint8_t | leftToken, | ||
| const char * | rightText, | ||
| uint8_t | rightToken, | ||
| tune_index_e | tuneId | ||
| ) |
Creates 2 touchable texts at the footer of the screen, separated with a thin line from the rest of the screen, and from each other.
| layout | the current layout |
| leftText | text to used in the left part of footer |
| leftToken | token to use when the left part of footer is touched |
| rightText | text to used in the right part of footer |
| rightToken | token to use when the right part of footer is touched |
| tuneId | if not NBGL_NO_TUNE, a tune will be played when button is long pressed |
Definition at line 2489 of file nbgl_layout.c.
| DEPRECATED int nbgl_layoutAddSuggestionButtons | ( | nbgl_layout_t * | layout, |
| uint8_t | nbUsedButtons, | ||
| const char * | buttonTexts[NB_MAX_SUGGESTION_BUTTONS], | ||
| int | firstButtonToken, | ||
| tune_index_e | tuneId | ||
| ) |
| int nbgl_layoutAddSwipe | ( | nbgl_layout_t * | layout, |
| uint16_t | swipesMask, | ||
| const char * | text, | ||
| uint8_t | token, | ||
| tune_index_e | tuneId | ||
| ) |
Creates a swipe interaction on the main container.
| layout | the current layout |
| swipesMask | the type of swipes to be handled by the container |
| text | the text in gray to display at bottom of the main container (can be NULL) |
| token | the token that will be used as argument of the callback |
| tuneId | if not NBGL_NO_TUNE, a tune will be played when button is pressed |
Definition at line 1174 of file nbgl_layout.c.
| int nbgl_layoutAddSwitch | ( | nbgl_layout_t * | layout, |
| const nbgl_layoutSwitch_t * | switchLayout | ||
| ) |
Creates a switch with the given text and its state.
| layout | the current layout |
| switchLayout | description of the parameters of the switch |
Definition at line 1377 of file nbgl_layout.c.
| int nbgl_layoutAddTagValueList | ( | nbgl_layout_t * | layout, |
| const nbgl_layoutTagValueList_t * | list | ||
| ) |
Creates a list of [tag,value] pairs.
| layout | the current layout |
| list | structure giving the list of [tag,value] pairs |
Definition at line 2053 of file nbgl_layout.c.
| int nbgl_layoutAddText | ( | nbgl_layout_t * | layout, |
| const char * | text, | ||
| const char * | subText | ||
| ) |
Creates an area with given text (in bold) and sub text (in regular)
| layout | the current layout |
| text | main text (in small bold font), optional |
| subText | description under main text (in small regular font), optional |
Definition at line 1415 of file nbgl_layout.c.
| int nbgl_layoutAddTextContent | ( | nbgl_layout_t * | layout, |
| const char * | title, | ||
| const char * | description, | ||
| const char * | info | ||
| ) |
Creates in the main container three text areas:
| layout | the current layout |
| title | main text (in large bold font) |
| description | description under main text (in small regular font) |
| info | description at bottom (in small gray) |
Definition at line 1536 of file nbgl_layout.c.
| int nbgl_layoutAddTextWithAlias | ( | nbgl_layout_t * | layout, |
| const char * | text, | ||
| const char * | subText, | ||
| uint8_t | token, | ||
| uint8_t | index | ||
| ) |
Creates an area with given text (in bold) and sub text (in regular), with a
icon on right of text to activate an action when touched, with the given token
| layout | the current layout |
| text | main text (in small bold font), optional |
| subText | description under main text (in small regular font), optional |
| token | token to use in callback when > icon is touched |
| index | index to use in callback when > icon is touched |
Definition at line 1450 of file nbgl_layout.c.
| int nbgl_layoutAddTopRightButton | ( | nbgl_layout_t * | layout, |
| const nbgl_icon_details_t * | icon, | ||
| uint8_t | token, | ||
| tune_index_e | tuneId | ||
| ) |
Creates a Top-right button in the top right corner of the top panel.
| layout | the current layout |
| icon | icon configuration |
| token | the token that will be used as argument of the callback |
| tuneId | if not NBGL_NO_TUNE, a tune will be played when button is pressed |
Definition at line 1241 of file nbgl_layout.c.
| int nbgl_layoutAddTouchableBar | ( | nbgl_layout_t * | layout, |
| const nbgl_layoutBar_t * | barLayout | ||
| ) |
Creates a touchable bar in main panel.
| layout | the current layout |
| barLayout | the properties of the bar |
Definition at line 1338 of file nbgl_layout.c.
| int nbgl_layoutAddUpFooter | ( | nbgl_layout_t * | layout, |
| const nbgl_layoutUpFooter_t * | upFooterDesc | ||
| ) |
Creates a touchable area on top of the footer of the screen, containing various controls, described in the given structure. This up-footer is not part of the main container.
| layout | the current layout |
| upFooterDesc | description of the up-footer |
Definition at line 3262 of file nbgl_layout.c.
| int nbgl_layoutDraw | ( | nbgl_layout_t * | layoutParam | ) |
Applies given layout. The screen will be redrawn.
| layoutParam | layout to redraw |
Definition at line 3777 of file nbgl_layout.c.
| nbgl_layout_t * nbgl_layoutGet | ( | const nbgl_layoutDescription_t * | description | ) |
returns a layout of the given type. The layout is reset
| description | description of layout |
Definition at line 1062 of file nbgl_layout.c.
| int nbgl_layoutInvertBackground | ( | nbgl_layout_t * | layout | ) |
Inverts the background color (black instead of white)
| layout | the current layout |
Definition at line 1209 of file nbgl_layout.c.
| bool nbgl_layoutKeyboardNeedsRefresh | ( | nbgl_layout_t * | layout, |
| uint8_t | index | ||
| ) |
function called to know whether the keyboard has been redrawn and needs a refresh
| layout | the current layout |
| index | index returned by nbgl_layoutAddKeyboard() (unused) |
Definition at line 646 of file nbgl_layout_keyboard.c.
| int nbgl_layoutRelease | ( | nbgl_layout_t * | layoutParam | ) |
Release the layout obtained with nbgl_layoutGet()
| layoutParam | layout to release |
Definition at line 3807 of file nbgl_layout.c.
| DEPRECATED int nbgl_layoutUpdateConfirmationButton | ( | nbgl_layout_t * | layout, |
| uint8_t | index, | ||
| bool | active, | ||
| const char * | text | ||
| ) |
Updates an existing black full width confirmation button on top of the previously added keyboard.
| layout | the current layout |
| index | returned value of nbgl_layoutAddConfirmationButton() |
| active | if true, button is active |
| text | text of the button = * |
Definition at line 854 of file nbgl_layout_keyboard.c.
| DEPRECATED int nbgl_layoutUpdateEnteredText | ( | nbgl_layout_t * | layout, |
| uint8_t | index, | ||
| bool | numbered, | ||
| uint8_t | number, | ||
| const char * | text, | ||
| bool | grayedOut | ||
| ) |
Updates an existing "text entry" area, created with nbgl_layoutAddEnteredText()
| layout | the current layout |
| index | index of the text (return value of nbgl_layoutAddEnteredText()) |
| numbered | if set to true, the text is preceded on the left by 'number.' |
| number | if numbered is true, number used to build 'number.' text |
| text | string to display in the area |
| grayedOut | if true, the text is grayed out (but not the potential number) |
Definition at line 755 of file nbgl_layout_keyboard.c.
| DEPRECATED int nbgl_layoutUpdateHiddenDigits | ( | nbgl_layout_t * | layout, |
| uint8_t | index, | ||
| uint8_t | nbActive | ||
| ) |
Updates an existing set of hidden digits, with the given configuration.
| layout | the current layout |
| index | index returned by nbgl_layoutAddHiddenDigits() |
| nbActive | number of "active" digits (represented by discs instead of circles) |
Definition at line 309 of file nbgl_layout_keypad.c.
| int nbgl_layoutUpdateKeyboard | ( | nbgl_layout_t * | layout, |
| uint8_t | index, | ||
| uint32_t | keyMask, | ||
| bool | updateCasing, | ||
| keyboardCase_t | casing | ||
| ) |
Updates an existing keyboard on bottom of the screen, with the given configuration.
| layout | the current layout |
| index | index returned by nbgl_layoutAddKeyboard() (unused) |
| keyMask | mask of keys to activate/deactivate on keyboard |
| updateCasing | if true, update keyboard casing with given value |
| casing | casing to use |
Definition at line 609 of file nbgl_layout_keyboard.c.
| int nbgl_layoutUpdateKeyboardContent | ( | nbgl_layout_t * | layout, |
| nbgl_layoutKeyboardContent_t * | content | ||
| ) |
Updates an area containing a potential title, a text entry and either confirmation or suggestion buttons, on top of the keyboard This area must have been built with nbgl_layoutAddKeyboardContent, and the type must not change.
| layout | the current layout |
| content | structure containing the updated info |
Definition at line 970 of file nbgl_layout_keyboard.c.
| int nbgl_layoutUpdateKeypad | ( | nbgl_layout_t * | layout, |
| uint8_t | index, | ||
| bool | enableValidate, | ||
| bool | enableBackspace, | ||
| bool | enableDigits | ||
| ) |
Updates an existing keypad on bottom of the screen, with the given configuration.
| layout | the current layout |
| index | index returned by nbgl_layoutAddKeypad() (unused, for compatibility) |
| enableValidate | if true, enable Validate key |
| enableBackspace | if true, enable Backspace key |
| enableDigits | if true, enable all digit keys |
Definition at line 149 of file nbgl_layout_keypad.c.
| 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.
| layout | the current layout |
| hidden | if set to true, digits appear as discs, otherwise as visible digits (given in text param) |
| nbActiveDigits | number of "active" digits (represented by discs instead of circles) (only used if hidden is true) |
| text | only used if hidden is false |
Definition at line 531 of file nbgl_layout_keypad.c.
| int nbgl_layoutUpdateKeypadValidation | ( | nbgl_layout_t * | layout, |
| bool | softValidation | ||
| ) |
Updates an existing keypad on bottom of the screen, with the given configuration, without redraw.
| layout | the current layout |
| softValidation | if true, the "check icon" is replaced by an arrow |
Definition at line 192 of file nbgl_layout_keypad.c.
| int nbgl_layoutUpdateSpinner | ( | nbgl_layout_t * | layout, |
| const char * | text, | ||
| const char * | subText, | ||
| uint8_t | position | ||
| ) |
Update an existing spinner (must be the only object of the layout)
| layout | the current layout |
| text | text to draw under the spinner |
| subText | text to draw under the text (can be NULL) |
| initPosition | position of the spinner (cannot be fixed) |
Definition at line 3701 of file nbgl_layout.c.