|
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_layoutTextContent_t |
| This structure contains info for Text content, to be set with nbgl_layoutAddTextContent(). 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_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_layoutButton_t |
| This structure contains info to build a single button. 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 | NB_MAX_SUGGESTION_BUTTONS 8 |
| #define | AVAILABLE_WIDTH (SCREEN_WIDTH - 2 * 7) |
| #define | NB_MAX_LINES 4 |
| #define | SPINNER_FIXED 0xFF |
| position to use for a "fixed" spinner | |
| #define | NB_MAX_DESCRIPTIONS 3 |
| max number of descriptions in nbgl_layoutTextContent_t | |
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. | |
Enumerations | |
| enum | nbgl_layoutNavDirection_t { HORIZONTAL_NAV , VERTICAL_NAV } |
| possible directions for Navigation arrows More... | |
| enum | nbgl_layoutNavIndication_t { NO_ARROWS = 0 , LEFT_ARROW , RIGHT_ARROW } |
| possible styles for Navigation arrows (it's a bit field) More... | |
| enum | nbgl_layoutKeyboardContentType_t { KEYBOARD_WITH_SUGGESTIONS , KEYBOARD_WITH_BUTTON , NB_KEYBOARD_CONTENT_TYPES } |
| The different types of keyboard contents. More... | |
| enum | nbgl_layoutButtonStyle_t { WHITE_BACKGROUND = 0 } |
| The different styles for a button. More... | |
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) |
| int | nbgl_layoutAddLeftContent (nbgl_layout_t *layout, const nbgl_layoutLeftContent_t *info) |
| 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. | |
| 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 the progress. | |
| int | nbgl_layoutAddNavigation (nbgl_layout_t *layout, nbgl_layoutNavigation_t *info) |
| Creates navigation arrows on side(s) of the screen. | |
| 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 be handled by the caller. | |
| 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_layoutAddSwitch (nbgl_layout_t *layout, const nbgl_layoutSwitch_t *switchLayout) |
| Creates an area in main panel to display a switch. | |
| 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_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 characters is 8, even if there are 9 placeholders (_) If longer than 8 chars, the first ones are replaced by a '..' The 9th placeholder is never filled. | |
| 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 characters is 8, even if there are 9 placeholders (_) If longer than 8 chars, the first ones are replaced by a '..' The 9th placeholder is never filled. | |
| int | nbgl_layoutUpdateEnteredText (nbgl_layout_t *layout, uint8_t index, const char *text) |
| Updates an existing "text entry" area, created with nbgl_layoutAddEnteredText() | |
| 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. | |
| 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_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. | |
| 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, 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. | |
| 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 * 7) |
Definition at line 143 of file nbgl_layout.h.
| #define NB_MAX_DESCRIPTIONS 3 |
max number of descriptions in nbgl_layoutTextContent_t
Definition at line 151 of file nbgl_layout.h.
| #define NB_MAX_LINES 4 |
Definition at line 145 of file nbgl_layout.h.
| #define NB_MAX_SUGGESTION_BUTTONS 8 |
Definition at line 141 of file nbgl_layout.h.
| #define NBGL_INVALID_TOKEN 0xFF |
Definition at line 30 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 149 of file nbgl_layout.h.
| typedef void* nbgl_layout_t |
type shared externally
Definition at line 161 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 176 of file nbgl_layout.h.
Deprecated, kept for retro compatibility.
Definition at line 328 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 294 of file nbgl_layout.h.
Deprecated, kept for retro compatibility.
Definition at line 289 of file nbgl_layout.h.
Deprecated, kept for retro compatibility.
Definition at line 317 of file nbgl_layout.h.
Deprecated, kept for retro compatibility.
Definition at line 322 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 169 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 301 of file nbgl_layout.h.
The different styles for a button.
| Enumerator | |
|---|---|
| WHITE_BACKGROUND | rounded bordered button, with text/icon in black, on white background |
Definition at line 632 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 345 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 203 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 212 of file nbgl_layout.h.
| 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.
| layout | the current layout |
| buttonInfo | structure giving the description of button |
Definition at line 652 of file nbgl_layout_nanos.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 457 of file nbgl_layout_nanos.c.
| int nbgl_layoutAddContentCenter | ( | nbgl_layout_t * | layout, |
| const nbgl_contentCenter_t * | info | ||
| ) |
| 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 characters is 8, even if there are 9 placeholders (_) If longer than 8 chars, the first ones are replaced by a '..' The 9th placeholder is never filled.
| layout | the current layout |
| text | string to display in the area |
| lettersOnly | if true, display 8 chars placeholders, otherwise 9 |
Definition at line 197 of file nbgl_layout_keyboard_nanos.c.
| 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 characters is 8, even if there are 9 placeholders (_) If longer than 8 chars, the first ones are replaced by a '..' The 9th placeholder is never filled.
| layout | the current layout |
| text | string to display in the area |
| lettersOnly | if true, display 8 chars placeholders, otherwise 9 |
| obfuscated | if true, entered text is obfuscated |
Definition at line 151 of file nbgl_layout_keyboard_nanos.c.
| 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.
| layout | the current layout |
| nbDigits | number of digits to be displayed |
Definition at line 161 of file nbgl_layout_keypad_nanos.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 51 of file nbgl_layout_keyboard_nanos.c.
| 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.
| layout | the current layout |
| callback | function called when any of the key is touched |
| text | text to use as title for the keypad |
| shuffled | if set to true, digits are shuffled in keypad |
Definition at line 59 of file nbgl_layout_keypad_nanos.c.
| 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 entered digits as small discs.
| layout | the current layout |
| 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 196 of file nbgl_layout_keypad_nanos.c.
| int nbgl_layoutAddLeftContent | ( | nbgl_layout_t * | layout, |
| const nbgl_layoutLeftContent_t * | info | ||
| ) |
| 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 be handled by the caller.
| layout | the current layout |
| list | structure giving the list of choices and the current selected one |
Definition at line 403 of file nbgl_layout_nanos.c.
| int nbgl_layoutAddNavigation | ( | nbgl_layout_t * | layout, |
| nbgl_layoutNavigation_t * | info | ||
| ) |
Creates navigation arrows on side(s) of the screen.
| layout | the current layout |
| info | structure giving the description of the navigation |
Definition at line 186 of file nbgl_layout_nanos.c.
| 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 the progress.
| layout | the current layout |
| barLayout | structure giving the description of progress bar |
Definition at line 587 of file nbgl_layout_nanos.c.
| int nbgl_layoutAddSwitch | ( | nbgl_layout_t * | layout, |
| const nbgl_layoutSwitch_t * | switchLayout | ||
| ) |
Creates an area in main panel to display a switch.
| layout | the current layout |
| switchLayout | structure giving the description of switch |
Definition at line 683 of file nbgl_layout_nanos.c.
| 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.
| layout | the current layout |
| text | main text, must be single line if subText |
| subText | description under main text (NULL terminated, in regular, 3 lines max, may be null) |
| style | if REGULAR_INFO, use regular font for text, otherwise use bold font for text |
Definition at line 225 of file nbgl_layout_nanos.c.
| int nbgl_layoutDraw | ( | nbgl_layout_t * | layoutParam | ) |
Applies given layout. The screen will be redrawn.
| layoutParam | layout to redraw |
Definition at line 760 of file nbgl_layout_nanos.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 134 of file nbgl_layout_nanos.c.
| int nbgl_layoutRelease | ( | nbgl_layout_t * | layoutParam | ) |
Release the layout obtained with nbgl_layoutGet()
| layoutParam | layout to release |
Definition at line 779 of file nbgl_layout_nanos.c.
| int nbgl_layoutUpdateEnteredText | ( | nbgl_layout_t * | layout, |
| uint8_t | index, | ||
| const char * | text | ||
| ) |
Updates an existing "text entry" area, created with nbgl_layoutAddEnteredText()
| layout | the current layout |
| index | index of the text (return value of nbgl_layoutAddEnteredText()) |
| text | string to display in the area |
Definition at line 211 of file nbgl_layout_keyboard_nanos.c.
| 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 174 of file nbgl_layout_keypad_nanos.c.
| 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.
| layout | the current layout |
| index | index returned by nbgl_layoutAddKeyboard() |
| keyMask | mask of keys to activate/deactivate on keyboard |
Definition at line 98 of file nbgl_layout_keyboard_nanos.c.
| 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.
| layout | the current layout |
| index | index returned by nbgl_layoutAddKeypad() |
| enableValidate | if true, enable Validate key |
| enableBackspace | if true, enable Backspace key |
Definition at line 112 of file nbgl_layout_keypad_nanos.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 277 of file nbgl_layout_keypad_nanos.c.