Embedded SDK
Embedded SDK
nbgl_page.h
Go to the documentation of this file.
1 
7 #ifndef NBGL_PAGE_H
8 #define NBGL_PAGE_H
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 /*********************
15  * INCLUDES
16  *********************/
17 
18 #include "nbgl_layout.h"
19 #include "nbgl_obj.h"
20 #include "nbgl_types.h"
21 #include "nbgl_content.h"
22 
23 /*********************
24  * DEFINES
25  *********************/
26 
27 /**********************
28  * TYPEDEFS
29  **********************/
30 
35 typedef enum {
42 
47 
52 typedef struct nbgl_pageContent_s {
53  const char *title;
57  tune_index_e tuneId;
62  union {
74  };
76 
81 typedef void *nbgl_page_t;
82 
87 typedef enum {
91 
96 typedef struct nbgl_pageNavWithTap_s {
97  bool backButton;
103  const char *nextPageText;
105  const char *quitText;
107 
113  bool quitButton;
114  bool backButton;
115  bool
119  const char
122 
130  uint8_t
135  tune_index_e
137  const char *skipText;
140  union {
143  };
145 
151  const char *confirmationText;
152  const char *cancelText;
156  tune_index_e
158  bool modal;
160 
168  const char *address;
169  const char
171  const char
173  const char
178  tune_index_e
181 
192  const char *footerText;
194  const char *tapActionText;
196  bool isSwipeable;
199  const char
203  tune_index_e
206 
207 /**********************
208  * GLOBAL PROTOTYPES
209  **********************/
210 
212  const nbgl_screenTickerConfiguration_t *ticker,
213  const char *text,
214  int tapActionToken);
215 nbgl_page_t *nbgl_pageDrawSpinner(nbgl_layoutTouchCallback_t onActionCallback, const char *text);
217  const nbgl_screenTickerConfiguration_t *ticker,
218  const nbgl_pageInfoDescription_t *info);
222  const nbgl_pageNavigationInfo_t *nav,
223  nbgl_pageContent_t *content,
224  bool modal);
226  const nbgl_pageNavigationInfo_t *nav,
227  nbgl_pageContent_t *content);
229 
230 /**********************
231  * MACROS
232  **********************/
233 
234 #ifdef __cplusplus
235 } /* extern "C" */
236 #endif
237 
238 #endif /* NBGL_PAGE_H */
common content for Graphical Library
nbgl_contentType_t
The different types of predefined contents.
Definition: nbgl_content.h:340
API of the Advanced BOLOS Graphical Library, for predefined layouts.
void(* nbgl_layoutTouchCallback_t)(int token, uint8_t index)
prototype of function to be called when an object is touched
Definition: nbgl_layout.h:104
nbgl_layoutButtonStyle_t
The different styles for a button.
Definition: nbgl_layout.h:335
API to draw all basic graphic objects.
struct nbgl_pageNavWithButtons_s nbgl_pageNavWithButtons_t
Structure containing all information to create a navigation with buttons in bottom nav bar.
nbgl_page_t * nbgl_pageDrawGenericContent(nbgl_layoutTouchCallback_t onActionCallback, const nbgl_pageNavigationInfo_t *nav, nbgl_pageContent_t *content)
draw a generic content page, with the given content, and if nav parameter is not NULL,...
Definition: nbgl_page.c:625
struct nbgl_pageInfoDescription_s nbgl_pageInfoDescription_t
Structure containing all specific information when creating an information page.
nbgl_page_t * nbgl_pageDrawSpinner(nbgl_layoutTouchCallback_t onActionCallback, const char *text)
draw a spinner page with the given parameters. The spinner will "rotate" automatically every 800 ms
Definition: nbgl_page.c:307
nbgl_page_t * nbgl_pageDrawLedgerInfo(nbgl_layoutTouchCallback_t onActionCallback, const nbgl_screenTickerConfiguration_t *ticker, const char *text, int tapActionToken)
draw a page with a centered text in large case, with a round check icon
Definition: nbgl_page.c:264
void * nbgl_page_t
type shared externally
Definition: nbgl_page.h:81
nbgl_contentInfoLongPress_t nbgl_pageInfoLongPress_t
Deprecated, kept for retro compatibility.
Definition: nbgl_page.h:46
struct nbgl_pageNavWithTap_s nbgl_pageNavWithTap_t
Structure containing all information to create a navigation with "tap".
struct nbgl_pageContent_s nbgl_pageContent_t
This structure contains data to build a page in multi-pages mode (nbgl_pageDrawGenericContent)
nbgl_pageNavigationType_t
The different types of navigation in a multi-screens page.
Definition: nbgl_page.h:87
@ NAV_WITH_BUTTONS
move forward and backward with buttons in bottom nav bar
Definition: nbgl_page.h:89
@ NAV_WITH_TAP
move forward with "tap" and possibly backward with top left arrow
Definition: nbgl_page.h:88
struct nbgl_pageMultiScreensDescription_s nbgl_pageNavigationInfo_t
Structure containing all specific information when creating a multi-screens page.
nbgl_page_t * nbgl_pageDrawGenericContentExt(nbgl_layoutTouchCallback_t onActionCallback, const nbgl_pageNavigationInfo_t *nav, nbgl_pageContent_t *content, bool modal)
draw a generic content page, with the given content, and if nav parameter is not NULL,...
Definition: nbgl_page.c:496
nbgl_page_t * nbgl_pageDrawInfo(nbgl_layoutTouchCallback_t onActionCallback, const nbgl_screenTickerConfiguration_t *ticker, const nbgl_pageInfoDescription_t *info)
draw a page with a centered info (icon and/or texts) with a touchable footer, in a potential "tapable...
Definition: nbgl_page.c:337
struct nbgl_pageConfirmationDescription_s nbgl_pageConfirmationDescription_t
Structure containing all specific information when creating a confirmation page.
int nbgl_pageRelease(nbgl_page_t *)
Release the page obtained with any of the nbgl_pageDrawXXX() functions.
Definition: nbgl_page.c:638
nbgl_page_t * nbgl_pageDrawConfirmation(nbgl_layoutTouchCallback_t onActionCallback, const nbgl_pageConfirmationDescription_t *info)
draw a confirmation page, with a centered info (icon and/or text), a button to confirm and a footer t...
Definition: nbgl_page.c:455
struct nbgl_pageAddressConfirmationDescription_s nbgl_pageAddressConfirmationDescription_t
Structure containing all specific information when creating a address confirmation page....
nbgl_pageButtonStyle_t
The different types of top-right / bottom button.
Definition: nbgl_page.h:35
@ QUIT_APP_TEXT
A full width button with "Quit app" text (only for bottom button)
Definition: nbgl_page.h:40
@ INFO_ICON
info (i) icon in the button.
Definition: nbgl_page.h:39
@ QUIT_ICON
quit (X) icon in the button.
Definition: nbgl_page.h:38
@ NO_BUTTON_STYLE
no button.
Definition: nbgl_page.h:36
@ SETTINGS_ICON
settings (wheel) icon in the button.
Definition: nbgl_page.h:37
struct PACKED__ nbgl_screenTickerConfiguration_s nbgl_screenTickerConfiguration_t
struct to configure a screen layer
common types for Graphical Library
struct PACKED__ nbgl_icon_details_s nbgl_icon_details_t
Represents all information about an icon.
This structure contains data to build a BARS_LIST content.
Definition: nbgl_content.h:306
This structure contains info to build a centered (vertically and horizontally) area,...
Definition: nbgl_content.h:57
This structure contains data to build a EXTENDED_CENTER content.
Definition: nbgl_content.h:331
This structure contains data to build a centered info + simple black button content.
Definition: nbgl_content.h:109
This structure contains data to build a INFOS_LIST content.
Definition: nbgl_content.h:268
This structure contains data to build a centered info + long press button content.
Definition: nbgl_content.h:94
This structure contains a list of names to build a list of radio buttons (on the right part of screen...
Definition: nbgl_content.h:286
This structure contains [item,value] pair(s) and info about a potential "details" button,...
Definition: nbgl_content.h:222
This structure contains a [item,value] pair and info about "details" button.
Definition: nbgl_content.h:206
This structure contains a list of [tag,value] pairs.
Definition: nbgl_content.h:185
Structure containing all specific information when creating a address confirmation page....
Definition: nbgl_page.h:167
const char * confirmationText
text of the confirmation button, if NULL "It matches" is used
Definition: nbgl_page.h:172
tune_index_e tuneId
if not NBGL_NO_TUNE, a tune will be played when button is pressed
Definition: nbgl_page.h:179
uint8_t confirmationToken
the token used as argument of the onActionCallback
Definition: nbgl_page.h:175
const char * qrCodeButtonText
text to display in "QR code button", if NULL "Show as QR is used"
Definition: nbgl_page.h:170
const char * address
address to confirm
Definition: nbgl_page.h:168
const char * cancelText
the text used for cancel action, if NULL "It doesn't matches" is used
Definition: nbgl_page.h:174
Structure containing all specific information when creating a confirmation page.
Definition: nbgl_page.h:149
const char * cancelText
the text used for cancel action, if NULL a simple X button is used
Definition: nbgl_page.h:152
uint8_t confirmationToken
the token used as argument of the onActionCallback
Definition: nbgl_page.h:153
bool modal
if true, page is open as a modal
Definition: nbgl_page.h:158
const char * confirmationText
text of the confirmation button
Definition: nbgl_page.h:151
nbgl_layoutCenteredInfo_t centeredInfo
description of the centered info to be used
Definition: nbgl_page.h:150
tune_index_e tuneId
if not NBGL_NO_TUNE, a tune will be played when button is pressed
Definition: nbgl_page.h:157
This structure contains data to build a page in multi-pages mode (nbgl_pageDrawGenericContent)
Definition: nbgl_page.h:52
uint8_t titleToken
Definition: nbgl_page.h:55
nbgl_contentTagValueDetails_t tagValueDetails
TAG_VALUE_DETAILS type
Definition: nbgl_page.h:68
const char * title
text for the title of the page (if NULL, no title)
Definition: nbgl_page.h:53
uint8_t topRightToken
token used when top-right button (if not NULL) is touched
Definition: nbgl_page.h:58
nbgl_contentInfoLongPress_t infoLongPress
INFO_LONG_PRESS type
Definition: nbgl_page.h:65
nbgl_contentRadioChoice_t choicesList
CHOICES_LIST type
Definition: nbgl_page.h:72
nbgl_contentSwitchesList_t switchesList
SWITCHES_LIST type
Definition: nbgl_page.h:70
tune_index_e tuneId
if not NBGL_NO_TUNE, a tune will be played when title is touched
Definition: nbgl_page.h:57
nbgl_contentBarsList_t barsList
BARS_LIST type
Definition: nbgl_page.h:73
nbgl_contentInfoButton_t infoButton
INFO_BUTTON type
Definition: nbgl_page.h:66
nbgl_contentInfoList_t infosList
INFOS_LIST type
Definition: nbgl_page.h:71
nbgl_contentTagValueList_t tagValueList
TAG_VALUE_LIST type
Definition: nbgl_page.h:67
const nbgl_icon_details_t * topRightIcon
Definition: nbgl_page.h:59
nbgl_contentType_t type
type of page content in the following union
Definition: nbgl_page.h:61
nbgl_contentCenteredInfo_t centeredInfo
CENTERED_INFO type
Definition: nbgl_page.h:63
nbgl_contentTagValueConfirm_t tagValueConfirm
TAG_VALUE_CONFIRM type
Definition: nbgl_page.h:69
bool isTouchableTitle
if set to true, the title is preceded by <- arrow to go back
Definition: nbgl_page.h:54
nbgl_contentExtendedCenter_t extendedCenter
EXTENDED_CENTER type
Definition: nbgl_page.h:64
Structure containing all specific information when creating an information page.
Definition: nbgl_page.h:185
nbgl_layoutButtonStyle_t actionButtonStyle
style of "action" button
Definition: nbgl_page.h:202
const char * actionButtonText
if not NULL an "action" button is set under the centered info
Definition: nbgl_page.h:200
const char * tapActionText
Definition: nbgl_page.h:194
const char * footerText
if not NULL, add a touchable footer
Definition: nbgl_page.h:192
nbgl_pageButtonStyle_t topRightStyle
style to apply to the Top-Right button
Definition: nbgl_page.h:187
uint8_t topRightToken
the token that will be used as argument of the onActionCallback
Definition: nbgl_page.h:189
bool isSwipeable
if true, main area is swipeable
Definition: nbgl_page.h:196
tune_index_e tuneId
if not NBGL_NO_TUNE, a tune will be played when button/footer is pressed
Definition: nbgl_page.h:204
uint8_t footerToken
the token that will be used as argument of the onActionCallback
Definition: nbgl_page.h:193
const nbgl_icon_details_t * actionButtonIcon
potential icon of "action" button
Definition: nbgl_page.h:201
nbgl_pageButtonStyle_t bottomButtonStyle
style to apply to the Bottom button
Definition: nbgl_page.h:188
nbgl_layoutCenteredInfo_t centeredInfo
description of the centered info to be used
Definition: nbgl_page.h:186
Structure containing all specific information when creating a multi-screens page.
Definition: nbgl_page.h:127
uint8_t nbPages
the number of pages to display (if <2, no navigation bar)
Definition: nbgl_page.h:129
uint8_t quitToken
the token used as argument of the actionCallback when the footer is touched
Definition: nbgl_page.h:131
uint8_t skipToken
if skipText is NULL the token used when right part of footer is touched
Definition: nbgl_page.h:139
nbgl_pageNavigationType_t navType
Definition: nbgl_page.h:132
uint8_t activePage
the index of the page to display at start-up
Definition: nbgl_page.h:128
bool progressIndicator
if set to true, display a progress indicator on top of the page
Definition: nbgl_page.h:134
nbgl_pageNavWithButtons_t navWithButtons
structure used when navigation with buttons
Definition: nbgl_page.h:142
nbgl_pageNavWithTap_t navWithTap
structure used when navigation with "tap"
Definition: nbgl_page.h:141
tune_index_e tuneId
if not NBGL_NO_TUNE, a tune will be played when next or back is pressed
Definition: nbgl_page.h:136
Structure containing all information to create a navigation with buttons in bottom nav bar.
Definition: nbgl_page.h:112
bool visiblePageIndicator
if set to true, the page indicator will be visible in navigation
Definition: nbgl_page.h:116
bool quitButton
if set to true, a quit button (X) is displayed in the nav bar
Definition: nbgl_page.h:113
const char * quitText
the text displayed in footer (on the left), used to quit (only on Flex)
Definition: nbgl_page.h:120
bool backButton
if set to true, a back button (<-) is displayed in the nav bar
Definition: nbgl_page.h:114
Structure containing all information to create a navigation with "tap".
Definition: nbgl_page.h:96
const char * quitText
the text displayed in footer, used to quit
Definition: nbgl_page.h:105
const char * nextPageText
Definition: nbgl_page.h:103
This structure contains data to build a SWITCHES_LIST content.
Definition: nbgl_content.h:260
Structure containing all specific information when creating a NBGL step.
Definition: nbgl_flow.h:43
unsigned char uint8_t
Definition: usbd_conf.h:53