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_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. More... | |
#define | NBGL_INVALID_TOKEN 0xFF |
#define | EXIT_PAGE 0xFF |
#define | NB_MAX_SUGGESTION_BUTTONS 8 |
#define | NB_MAX_VISIBLE_SUGGESTION_BUTTONS 2 |
#define | TOUCHABLE_HEADER_BAR_HEIGHT 96 |
#define | TOUCHABLE_MAIN_BAR_HEIGHT 100 |
#define | TOUCHABLE_BAR_HEIGHT 92 |
#define | SMALL_FOOTER_HEIGHT 96 |
#define | SIMPLE_FOOTER_HEIGHT 96 |
#define | SMALL_CENTERING_HEADER 40 |
#define | MEDIUM_CENTERING_HEADER 64 |
#define | LONG_PRESS_BUTTON_HEIGHT 152 |
#define | AVAILABLE_WIDTH (SCREEN_WIDTH - 2 * BORDER_MARGIN) |
#define | NB_MAX_LINES NB_MAX_LINES_IN_DETAILS |
#define | PRE_TEXT_MARGIN 28 |
#define | TEXT_SUBTEXT_MARGIN 14 |
#define | POST_SUBTEXT_MARGIN 26 |
#define | BOTH_ROUNDED_STYLE SOFT_ACTION_AND_FOOTER_STYLE |
Typedefs | |
typedef void * | nbgl_layout_t |
type shared externally More... | |
typedef void(* | nbgl_layoutTouchCallback_t) (int token, uint8_t index) |
prototype of function to be called when an object is touched More... | |
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 More... | |
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. More... | |
typedef nbgl_contentSwitch_t | nbgl_layoutSwitch_t |
Deprecated, kept for retro compatibility. More... | |
typedef nbgl_contentRadioChoice_t | nbgl_layoutRadioChoice_t |
Deprecated, kept for retro compatibility. More... | |
typedef const char *(* | nbgl_menuListCallback_t) (uint8_t choiceIndex) |
prototype of menu list item retrieval callback More... | |
typedef nbgl_contentTagValue_t | nbgl_layoutTagValue_t |
Deprecated, kept for retro compatibility. More... | |
typedef nbgl_contentTagValueList_t | nbgl_layoutTagValueList_t |
Deprecated, kept for retro compatibility. More... | |
typedef nbgl_contentCenteredInfo_t | nbgl_layoutCenteredInfo_t |
Deprecated, kept for retro compatibility. More... | |
Functions | |
nbgl_layout_t * | nbgl_layoutGet (const nbgl_layoutDescription_t *description) |
returns a layout of the given type. The layout is reset More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
int | nbgl_layoutAddTouchableBar (nbgl_layout_t *layout, const nbgl_layoutBar_t *barLayout) |
Creates a touchable bar in main panel. More... | |
int | nbgl_layoutAddSwitch (nbgl_layout_t *layout, const nbgl_layoutSwitch_t *switchLayout) |
Creates a switch with the given text and its state. More... | |
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) More... | |
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 More... | |
int | nbgl_layoutAddSubHeaderText (nbgl_layout_t *layout, const char *text) |
Creates an area with given text in small regular font, under the header. More... | |
int | nbgl_layoutAddRadioChoice (nbgl_layout_t *layout, const nbgl_layoutRadioChoice_t *choices) |
Creates a list of radio buttons (on the right) More... | |
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. More... | |
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. More... | |
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. More... | |
int | nbgl_layoutAddTagValueList (nbgl_layout_t *layout, const nbgl_layoutTagValueList_t *list) |
Creates a list of [tag,value] pairs. More... | |
int | nbgl_layoutAddLargeCaseText (nbgl_layout_t *layout, const char *text) |
Creates an area with given text in 32px font (in Black) More... | |
int | nbgl_layoutAddTextContent (nbgl_layout_t *layout, const char *title, const char *description, const char *info) |
Creates in the main container three text areas: More... | |
int | nbgl_layoutAddSeparationLine (nbgl_layout_t *layout) |
adds a separation line on bottom of the last added item More... | |
int | nbgl_layoutAddButton (nbgl_layout_t *layout, const nbgl_layoutButton_t *buttonInfo) |
Creates a rounded button in the main container. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
int | nbgl_layoutAddNavigationBar (nbgl_layout_t *layout, const nbgl_layoutNavigationBar_t *info) |
Creates a navigation bar on bottom of main container. More... | |
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. More... | |
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. More... | |
int | nbgl_layoutAddSpinner (nbgl_layout_t *layout, const char *text, bool fixed) |
Creates a centered (vertically & horizontally) spinner with a text under it. More... | |
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. More... | |
int | nbgl_layoutAddKeyboard (nbgl_layout_t *layout, const nbgl_layoutKbd_t *kbdInfo) |
Creates a keyboard on bottom of the screen, with the given configuration. More... | |
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. More... | |
bool | nbgl_layoutKeyboardNeedsRefresh (nbgl_layout_t *layout, uint8_t index) |
function called to know whether the keyboard has been redrawn and needs a refresh More... | |
DEPRECATED int | nbgl_layoutAddSuggestionButtons (nbgl_layout_t *layout, uint8_t nbUsedButtons, const char *buttonTexts[NB_MAX_SUGGESTION_BUTTONS], int firstButtonToken, tune_index_e tuneId) |
Adds up to 4 black suggestion buttons under the previously added object. More... | |
DEPRECATED int | nbgl_layoutUpdateSuggestionButtons (nbgl_layout_t *layout, uint8_t index, uint8_t nbUsedButtons, const char *buttonTexts[NB_MAX_SUGGESTION_BUTTONS]) |
Updates the number and/or the text suggestion buttons created with nbgl_layoutAddSuggestionButtons() More... | |
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. More... | |
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() More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
int | nbgl_layoutAddKeypad (nbgl_layout_t *layout, keyboardCallback_t callback, bool shuffled) |
Adds a keypad on bottom of the screen, with the associated callback. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
int | nbgl_layoutDraw (nbgl_layout_t *layout) |
Applies given layout. The screen will be redrawn. More... | |
int | nbgl_layoutRelease (nbgl_layout_t *layout) |
Release the layout obtained with nbgl_layoutGet() More... | |
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 66 of file nbgl_layout.h.
#define BOTH_ROUNDED_STYLE SOFT_ACTION_AND_FOOTER_STYLE |
Definition at line 286 of file nbgl_layout.h.
#define EXIT_PAGE 0xFF |
Definition at line 38 of file nbgl_layout.h.
#define LONG_PRESS_BUTTON_HEIGHT 152 |
Definition at line 63 of file nbgl_layout.h.
#define MEDIUM_CENTERING_HEADER 64 |
Definition at line 62 of file nbgl_layout.h.
#define NB_MAX_LINES NB_MAX_LINES_IN_DETAILS |
Definition at line 68 of file nbgl_layout.h.
#define NB_MAX_SUGGESTION_BUTTONS 8 |
Definition at line 53 of file nbgl_layout.h.
#define NB_MAX_VISIBLE_SUGGESTION_BUTTONS 2 |
Definition at line 55 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 37 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 32 of file nbgl_layout.h.
#define NBGL_NO_TUNE NB_TUNES |
Definition at line 29 of file nbgl_layout.h.
#define POST_SUBTEXT_MARGIN 26 |
Definition at line 77 of file nbgl_layout.h.
#define PRE_TEXT_MARGIN 28 |
Definition at line 75 of file nbgl_layout.h.
#define SIMPLE_FOOTER_HEIGHT 96 |
Definition at line 60 of file nbgl_layout.h.
#define SMALL_CENTERING_HEADER 40 |
Definition at line 61 of file nbgl_layout.h.
#define SMALL_FOOTER_HEIGHT 96 |
Definition at line 59 of file nbgl_layout.h.
#define TEXT_SUBTEXT_MARGIN 14 |
Definition at line 76 of file nbgl_layout.h.
#define TOUCHABLE_BAR_HEIGHT 92 |
Definition at line 58 of file nbgl_layout.h.
#define TOUCHABLE_HEADER_BAR_HEIGHT 96 |
Definition at line 56 of file nbgl_layout.h.
#define TOUCHABLE_MAIN_BAR_HEIGHT 100 |
Definition at line 57 of file nbgl_layout.h.
typedef void* nbgl_layout_t |
type shared externally
Definition at line 96 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 111 of file nbgl_layout.h.
Deprecated, kept for retro compatibility.
Definition at line 256 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 222 of file nbgl_layout.h.
Deprecated, kept for retro compatibility.
Definition at line 217 of file nbgl_layout.h.
Deprecated, kept for retro compatibility.
Definition at line 245 of file nbgl_layout.h.
Deprecated, kept for retro compatibility.
Definition at line 250 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 104 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 229 of file nbgl_layout.h.
The different styles for a button.
Definition at line 324 of file nbgl_layout.h.
The different styles for a pair of buttons.
Definition at line 279 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 463 of file nbgl_layout.h.
The different types of extended header.
Definition at line 405 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 352 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 140 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 149 of file nbgl_layout.h.
The different types of area on top of footer.
Definition at line 515 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 1196 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 2103 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 1602 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 1816 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 879 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 1665 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 (but not the potential number) |
offsetY | vertical offset from the top of the page |
token | token provided in onActionCallback when this area is touched |
Definition at line 753 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 2549 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 2233 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 |
Definition at line 2286 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 179 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 1839 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 474 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 965 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 71 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 337 of file nbgl_layout_keypad.c.
int nbgl_layoutAddLargeCaseText | ( | nbgl_layout_t * | layout, |
const char * | text | ||
) |
Creates an area with given text in 32px font (in Black)
layout | the current layout |
text | text to be displayed (auto-wrap) |
Definition at line 1376 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 2205 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 1170 of file nbgl_layout.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 2012 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 3243 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 1689 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 1505 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 2083 of file nbgl_layout.c.
int nbgl_layoutAddSpinner | ( | nbgl_layout_t * | layout, |
const char * | text, | ||
bool | fixed | ||
) |
Creates a centered (vertically & horizontally) spinner with a text under it.
layout | the current layout |
text | text to draw under the spinner |
fixed | if set to true, the spinner won't spin and be entirely black |
Definition at line 3272 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 2260 of file nbgl_layout.c.
int nbgl_layoutAddSubHeaderText | ( | nbgl_layout_t * | layout, |
const char * | text | ||
) |
Creates an area with given text in small regular font, under the header.
layout | the current layout |
text | main text in small regular font |
Definition at line 1335 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 | ||
) |
Adds up to 4 black suggestion buttons under the previously added object.
layout | the current layout |
nbUsedButtons | the number of actually used buttons |
buttonTexts | array of 4 strings for buttons (last ones can be NULL) |
firstButtonToken | first token used for buttons, provided in onActionCallback (the next 3 values will be used for other buttons) |
tuneId | tune to play when any button is pressed |
Definition at line 616 of file nbgl_layout_keyboard.c.
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 1084 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 1261 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 1860 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 1301 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 1423 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 1318 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 1125 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 1222 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 2943 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 3337 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 995 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 580 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 3368 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 920 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 821 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 266 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 543 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 1039 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 132 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 484 of file nbgl_layout_keypad.c.
DEPRECATED int nbgl_layoutUpdateSuggestionButtons | ( | nbgl_layout_t * | layout, |
uint8_t | index, | ||
uint8_t | nbUsedButtons, | ||
const char * | buttonTexts[NB_MAX_SUGGESTION_BUTTONS] | ||
) |
Updates the number and/or the text suggestion buttons created with nbgl_layoutAddSuggestionButtons()
layout | the current layout |
index | index returned by nbgl_layoutAddSuggestionButtons() (unused) |
nbUsedButtons | the number of actually used buttons |
buttonTexts | array of 4 strings for buttons (last ones can be NULL) |
Definition at line 669 of file nbgl_layout_keyboard.c.