Embedded SDK
Embedded SDK
nbgl_content.h
Go to the documentation of this file.
1 
7 #ifndef NBGL_CONTENT_H
8 #define NBGL_CONTENT_H
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 /*********************
15  * INCLUDES
16  *********************/
17 #include <stdint.h>
18 #include <stdbool.h>
19 
20 #include "nbgl_types.h"
21 #include "nbgl_obj.h"
22 #ifdef HAVE_PIEZO_SOUND
23 #include "os_io_seproxyhal.h"
24 #endif
25 
26 /**********************
27  * TYPEDEFS
28  **********************/
29 
34 typedef enum {
35 #ifdef HAVE_SE_TOUCH
41  NORMAL_INFO,
46 #else // HAVE_SE_TOUCH
47  REGULAR_INFO = 0,
48  BOLD_TEXT1_INFO
49 #endif // HAVE_SE_TOUCH
51 
57 typedef struct {
58  const char *text1;
59  const char *text2;
60 #ifdef HAVE_SE_TOUCH
61  const char *text3;
62 #endif // HAVE_SE_TOUCH
64  bool onTop;
66 #ifdef HAVE_SE_TOUCH
68 #endif // HAVE_SE_TOUCH
70 
81 typedef struct {
83  const char *title;
84  const char *smallTitle;
85  const char *description;
86  const char *subText;
88  bool padding;
90 
94 typedef struct {
95  const char *text;
97  const char *longPressText;
100 #ifdef HAVE_PIEZO_SOUND
101  tune_index_e
102  tuneId;
103 #endif
105 
109 typedef struct {
110  const char *text;
112  const char *buttonText;
115 #ifdef HAVE_PIEZO_SOUND
116  tune_index_e
117  tuneId;
118 #endif
120 
125 typedef enum {
131 
136 typedef struct {
137  const char *fullValue;
138  const char *explanation;
140  const char *title;
144 
148 typedef struct {
149  const char *item;
150  const char *value;
151 #ifdef SCREEN_SIZE_WALLET
152  union {
157  };
163 #endif
165 
171 typedef nbgl_contentTagValue_t *(*nbgl_contentTagValueCallback_t)(uint8_t pairIndex);
172 
180 typedef void (*nbgl_contentActionCallback_t)(int token, uint8_t index, int page);
181 
185 typedef struct {
187  *pairs;
198  bool wrapping;
202 
206 typedef struct {
209  const char *detailsButtonText;
212 #ifdef HAVE_PIEZO_SOUND
213  tune_index_e
214  tuneId;
215 #endif
217 
222 typedef struct {
225  const char *detailsButtonText;
228 #ifdef HAVE_PIEZO_SOUND
229  tune_index_e
230  tuneId;
231 #endif
232  const char
234  const char
240 
246 typedef struct {
247  const char *text;
248  const char
252 #ifdef HAVE_PIEZO_SOUND
253  tune_index_e tuneId;
254 #endif // HAVE_PIEZO_SOUND
256 
260 typedef struct nbgl_pageSwitchesList_s {
264 
268 typedef struct {
269  const char *const *infoTypes;
270  const char *const *infoContents;
280 
286 typedef struct {
287  union {
288  const char *const *names;
289 #if defined(HAVE_LANGUAGE_PACK)
290  UX_LOC_STRINGS_INDEX *nameIds;
291 #endif // HAVE_LANGUAGE_PACK
292  };
293  bool localized;
297 #ifdef HAVE_PIEZO_SOUND
298  tune_index_e
299  tuneId;
300 #endif // HAVE_PIEZO_SOUND
302 
306 typedef struct {
307  const char *const *barTexts;
308  const uint8_t *tokens;
310 #ifdef HAVE_PIEZO_SOUND
311  tune_index_e tuneId;
312 #endif // HAVE_PIEZO_SOUND
314 
319 typedef struct {
320  const char *text;
323 #ifdef HAVE_PIEZO_SOUND
324  tune_index_e tuneId;
325 #endif // HAVE_PIEZO_SOUND
327 
331 typedef struct {
335 
340 typedef enum {
351  BARS_LIST
353 
357 typedef union {
370 
374 typedef struct {
380 
381 #ifdef __cplusplus
382 } /* extern "C" */
383 #endif
384 
385 #endif /* NBGL_CONTENT_H */
struct nbgl_pageSwitchesList_s nbgl_contentSwitchesList_t
This structure contains data to build a SWITCHES_LIST content.
nbgl_contentCenteredInfoStyle_t
possible styles for Centered Info Area
Definition: nbgl_content.h:34
@ LARGE_CASE_BOLD_INFO
Definition: nbgl_content.h:37
@ NORMAL_INFO
Definition: nbgl_content.h:41
@ PLUGIN_INFO
Definition: nbgl_content.h:43
@ LARGE_CASE_GRAY_INFO
Definition: nbgl_content.h:39
@ LARGE_CASE_INFO
text in BLACK and large case (INTER 32px), subText in black in Inter24px
Definition: nbgl_content.h:36
nbgl_contentTagValue_t *(* nbgl_contentTagValueCallback_t)(uint8_t pairIndex)
prototype of tag/value pair retrieval callback
Definition: nbgl_content.h:171
nbgl_contentType_t
The different types of predefined contents.
Definition: nbgl_content.h:340
@ INFO_LONG_PRESS
a centered info and a long press button
Definition: nbgl_content.h:343
@ EXTENDED_CENTER
a centered content and a possible tip-box
Definition: nbgl_content.h:342
@ CHOICES_LIST
list of choices through radio buttons
Definition: nbgl_content.h:350
@ CENTERED_INFO
a centered info
Definition: nbgl_content.h:341
@ SWITCHES_LIST
list of switches with descriptions
Definition: nbgl_content.h:348
@ TAG_VALUE_DETAILS
a tag/value pair and a small button to get details.
Definition: nbgl_content.h:346
@ INFOS_LIST
list of infos with titles
Definition: nbgl_content.h:349
@ TAG_VALUE_CONFIRM
tag/value pairs and a black button/footer to confirm/cancel.
Definition: nbgl_content.h:347
@ TAG_VALUE_LIST
list of tag/value pairs
Definition: nbgl_content.h:345
@ BARS_LIST
list of touchable bars (with > on the right to go to sub-pages)
Definition: nbgl_content.h:351
@ INFO_BUTTON
a centered info and a simple black button
Definition: nbgl_content.h:344
nbgl_contentValueAliasType_t
possible types of value alias
Definition: nbgl_content.h:125
@ ENS_ALIAS
alias comes from ENS
Definition: nbgl_content.h:127
@ ADDRESS_BOOK_ALIAS
alias comes from Address Book
Definition: nbgl_content.h:128
@ QR_CODE_ALIAS
alias is an address to be displayed as a QR Code
Definition: nbgl_content.h:129
@ NO_ALIAS_TYPE
Definition: nbgl_content.h:126
void(* nbgl_contentActionCallback_t)(int token, uint8_t index, int page)
prototype of function to be called when an action on a content object occurs
Definition: nbgl_content.h:180
API to draw all basic graphic objects.
common types for Graphical Library
nbgl_state_t
to represent a boolean state.
Definition: nbgl_types.h:160
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
const uint8_t * tokens
array of tokens, one for each bar (nbBars items)
Definition: nbgl_content.h:308
const char *const * barTexts
array of texts for each bar (nbBars items, in black/bold)
Definition: nbgl_content.h:307
uint8_t nbBars
number of elements in barTexts and tokens array
Definition: nbgl_content.h:309
This structure contains info to build a centered (vertically and horizontally) area,...
Definition: nbgl_content.h:81
uint16_t iconHug
vertical margin to apply on top and bottom of the icon
Definition: nbgl_content.h:87
const nbgl_icon_details_t * icon
the icon (can be null)
Definition: nbgl_content.h:82
const char * title
title in black large (can be null)
Definition: nbgl_content.h:83
const char * description
description in black small regular case (can be null)
Definition: nbgl_content.h:85
const char * subText
sub-text in dark gray regular small case
Definition: nbgl_content.h:86
bool padding
if true, apply a padding of 40px at the bottom
Definition: nbgl_content.h:88
const char * smallTitle
sub-title in black small bold case (can be null)
Definition: nbgl_content.h:84
This structure contains info to build a centered (vertically and horizontally) area,...
Definition: nbgl_content.h:57
const char * text2
second text (can be null)
Definition: nbgl_content.h:59
const char * text1
first text (can be null)
Definition: nbgl_content.h:58
bool onTop
if set to true, align only horizontally
Definition: nbgl_content.h:64
nbgl_contentCenteredInfoStyle_t style
style to apply to this info
Definition: nbgl_content.h:65
int16_t offsetY
vertical shift to apply to this info (if >0, shift to bottom)
Definition: nbgl_content.h:67
const char * text3
third text (can be null)
Definition: nbgl_content.h:61
const nbgl_icon_details_t * icon
a buffer containing the 1BPP icon
Definition: nbgl_content.h:63
This structure contains data to build a EXTENDED_CENTER content.
Definition: nbgl_content.h:331
nbgl_contentTipBox_t tipBox
if text field is NULL, no tip-box
Definition: nbgl_content.h:333
nbgl_contentCenter_t contentCenter
centered content (icon + text(s))
Definition: nbgl_content.h:332
This structure contains data to build a centered info + simple black button content.
Definition: nbgl_content.h:109
const char * buttonText
text of the long press button
Definition: nbgl_content.h:112
const nbgl_icon_details_t * icon
a buffer containing the 1BPP icon
Definition: nbgl_content.h:111
const char * text
centered text in large case
Definition: nbgl_content.h:110
This structure contains data to build a INFOS_LIST content.
Definition: nbgl_content.h:268
uint8_t nbInfos
number of elements in infoTypes and infoContents array
Definition: nbgl_content.h:274
const char *const * infoContents
array of contents of infos (in black)
Definition: nbgl_content.h:270
const char *const * infoTypes
array of types of infos (in black/bold)
Definition: nbgl_content.h:269
const nbgl_contentValueExt_t * infoExtensions
Definition: nbgl_content.h:272
This structure contains data to build a centered info + long press button content.
Definition: nbgl_content.h:94
const char * longPressText
text of the long press button
Definition: nbgl_content.h:97
const nbgl_icon_details_t * icon
a buffer containing the 1BPP icon
Definition: nbgl_content.h:96
const char * text
centered text in large case
Definition: nbgl_content.h:95
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
uint8_t token
the token that will be used as argument of the callback
Definition: nbgl_content.h:296
bool localized
if set to true, use nameIds and not names
Definition: nbgl_content.h:293
uint8_t initChoice
index of the current choice
Definition: nbgl_content.h:295
const char *const * names
array of strings giving the choices (nbChoices)
Definition: nbgl_content.h:288
uint8_t nbChoices
number of choices
Definition: nbgl_content.h:294
This structure contains info to build a switch (on the right) with a description (on the left),...
Definition: nbgl_content.h:246
const char * text
main text for the switch
Definition: nbgl_content.h:247
uint8_t token
the token that will be used as argument of the callback
Definition: nbgl_content.h:251
nbgl_state_t initState
initial state of the switch
Definition: nbgl_content.h:250
const char * subText
description under main text (NULL terminated, single line, may be null)
Definition: nbgl_content.h:249
This structure contains [item,value] pair(s) and info about a potential "details" button,...
Definition: nbgl_content.h:222
const char * confirmationText
text of the confirmation button, if NULL "It matches" is used
Definition: nbgl_content.h:233
uint8_t confirmationToken
the token used as argument of the onActionCallback
Definition: nbgl_content.h:236
const char * cancelText
the text used for cancel action, if NULL "It doesn't matches" is used
Definition: nbgl_content.h:235
nbgl_contentTagValueList_t tagValueList
list of tag/value pairs
Definition: nbgl_content.h:223
const char * detailsButtonText
this text is used for "details" button (if NULL, no button)
Definition: nbgl_content.h:225
const nbgl_icon_details_t * detailsButtonIcon
icon to use in details button
Definition: nbgl_content.h:224
This structure contains a [item,value] pair and info about "details" button.
Definition: nbgl_content.h:206
const nbgl_icon_details_t * detailsButtonIcon
icon to use in details button
Definition: nbgl_content.h:208
const char * detailsButtonText
this text is used for "details" button
Definition: nbgl_content.h:209
nbgl_contentTagValueList_t tagValueList
list of tag/value pairs
Definition: nbgl_content.h:207
This structure contains a list of [tag,value] pairs.
Definition: nbgl_content.h:185
nbgl_contentActionCallback_t actionCallback
called when a valueIcon is touched on a given pair
Definition: nbgl_content.h:200
const nbgl_contentTagValue_t * pairs
array of [tag,value] pairs (nbPairs items). If NULL, callback is used instead
Definition: nbgl_content.h:187
bool wrapping
if set to true, value text will be wrapped on ' ' to avoid cutting words
Definition: nbgl_content.h:198
uint8_t startIndex
index of the first pair to get with callback
Definition: nbgl_content.h:191
nbgl_contentTagValueCallback_t callback
function to call to retrieve a given pair
Definition: nbgl_content.h:188
This structure contains a [tag,value] pair.
Definition: nbgl_content.h:148
const nbgl_contentValueExt_t * extension
if not NULL, gives additional info on value field
Definition: nbgl_content.h:156
const nbgl_icon_details_t * valueIcon
Definition: nbgl_content.h:153
int8_t centeredInfo
if set to 1, the tag will be displayed as a centered info
Definition: nbgl_content.h:160
const char * value
string giving the value name
Definition: nbgl_content.h:150
const char * item
string giving the tag name
Definition: nbgl_content.h:149
This structure contains data to build a tip-box, on top of a footer, on bottom of a content center.
Definition: nbgl_content.h:319
const char * text
text of the tip-box
Definition: nbgl_content.h:320
const nbgl_icon_details_t * icon
icon of the tip-box
Definition: nbgl_content.h:321
uint8_t token
token used when tip-box is tapped
Definition: nbgl_content.h:322
This structure contains additions to a tag/value pair, to be able to build a screen to display these ...
Definition: nbgl_content.h:136
const char * fullValue
full string of the value when used as an alias
Definition: nbgl_content.h:137
nbgl_contentValueAliasType_t aliasType
type of alias
Definition: nbgl_content.h:142
const char * explanation
Definition: nbgl_content.h:138
This structure contains data to build a content.
Definition: nbgl_content.h:374
nbgl_content_u content
Definition: nbgl_content.h:376
nbgl_contentActionCallback_t contentActionCallback
callback to be called when an action on an object occurs
Definition: nbgl_content.h:378
nbgl_contentType_t type
type of page content in the content union
Definition: nbgl_content.h:375
This structure contains data to build a SWITCHES_LIST content.
Definition: nbgl_content.h:260
uint8_t nbSwitches
number of elements in switches and tokens array
Definition: nbgl_content.h:262
const nbgl_contentSwitch_t * switches
array of switches (nbSwitches items)
Definition: nbgl_content.h:261
Union of the different type of contents.
Definition: nbgl_content.h:357
nbgl_contentInfoList_t infosList
INFOS_LIST type
Definition: nbgl_content.h:366
nbgl_contentInfoLongPress_t infoLongPress
INFO_LONG_PRESS type
Definition: nbgl_content.h:360
nbgl_contentTagValueDetails_t tagValueDetails
TAG_VALUE_DETAILS type
Definition: nbgl_content.h:363
nbgl_contentTagValueConfirm_t tagValueConfirm
TAG_VALUE_CONFIRM type
Definition: nbgl_content.h:364
nbgl_contentTagValueList_t tagValueList
TAG_VALUE_LIST type
Definition: nbgl_content.h:362
nbgl_contentCenteredInfo_t centeredInfo
CENTERED_INFO type
Definition: nbgl_content.h:358
nbgl_contentBarsList_t barsList
BARS_LIST type
Definition: nbgl_content.h:368
nbgl_contentExtendedCenter_t extendedCenter
EXTENDED_CENTER type
Definition: nbgl_content.h:359
nbgl_contentSwitchesList_t switchesList
SWITCHES_LIST type
Definition: nbgl_content.h:365
nbgl_contentInfoButton_t infoButton
INFO_BUTTON type
Definition: nbgl_content.h:361
nbgl_contentRadioChoice_t choicesList
CHOICES_LIST type
Definition: nbgl_content.h:367
signed short int16_t
Definition: usbd_conf.h:50
unsigned short uint16_t
Definition: usbd_conf.h:54
unsigned char uint8_t
Definition: usbd_conf.h:53
signed char int8_t
Definition: usbd_conf.h:49
BOLOS_UX_LOC_STRINGS UX_LOC_STRINGS_INDEX