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 {
126  ENS_ALIAS = 0,
129 
134 typedef struct {
135  const char *fullValue;
136  const char *explanation;
140 
144 typedef struct {
145  const char *item;
146  const char *value;
147 #ifdef SCREEN_SIZE_WALLET
148  union {
153  };
159 #endif
161 
167 typedef nbgl_contentTagValue_t *(*nbgl_contentTagValueCallback_t)(uint8_t pairIndex);
168 
176 typedef void (*nbgl_contentActionCallback_t)(int token, uint8_t index, int page);
177 
181 typedef struct {
183  *pairs;
194  bool wrapping;
198 
202 typedef struct {
205  const char *detailsButtonText;
208 #ifdef HAVE_PIEZO_SOUND
209  tune_index_e
210  tuneId;
211 #endif
213 
218 typedef struct {
221  const char *detailsButtonText;
224 #ifdef HAVE_PIEZO_SOUND
225  tune_index_e
226  tuneId;
227 #endif
228  const char
230  const char
236 
242 typedef struct {
243  const char *text;
244  const char
248 #ifdef HAVE_PIEZO_SOUND
249  tune_index_e tuneId;
250 #endif // HAVE_PIEZO_SOUND
252 
256 typedef struct nbgl_pageSwitchesList_s {
260 
264 typedef struct {
265  const char *const *infoTypes;
266  const char *const *infoContents;
269 
275 typedef struct {
276  union {
277  const char *const *names;
278 #if defined(HAVE_LANGUAGE_PACK)
279  UX_LOC_STRINGS_INDEX *nameIds;
280 #endif // HAVE_LANGUAGE_PACK
281  };
282  bool localized;
286 #ifdef HAVE_PIEZO_SOUND
287  tune_index_e
288  tuneId;
289 #endif // HAVE_PIEZO_SOUND
291 
295 typedef struct {
296  const char *const *barTexts;
297  const uint8_t *tokens;
299 #ifdef HAVE_PIEZO_SOUND
300  tune_index_e tuneId;
301 #endif // HAVE_PIEZO_SOUND
303 
308 typedef struct {
309  const char *text;
312 #ifdef HAVE_PIEZO_SOUND
313  tune_index_e tuneId;
314 #endif // HAVE_PIEZO_SOUND
316 
320 typedef struct {
324 
329 typedef enum {
340  BARS_LIST
342 
346 typedef union {
359 
363 typedef struct {
369 
370 #ifdef __cplusplus
371 } /* extern "C" */
372 #endif
373 
374 #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:167
nbgl_contentType_t
The different types of predefined contents.
Definition: nbgl_content.h:329
@ INFO_LONG_PRESS
a centered info and a long press button
Definition: nbgl_content.h:332
@ EXTENDED_CENTER
a centered content and a possible tip-box
Definition: nbgl_content.h:331
@ CHOICES_LIST
list of choices through radio buttons
Definition: nbgl_content.h:339
@ CENTERED_INFO
a centered info
Definition: nbgl_content.h:330
@ SWITCHES_LIST
list of switches with descriptions
Definition: nbgl_content.h:337
@ TAG_VALUE_DETAILS
a tag/value pair and a small button to get details.
Definition: nbgl_content.h:335
@ INFOS_LIST
list of infos with titles
Definition: nbgl_content.h:338
@ TAG_VALUE_CONFIRM
tag/value pairs and a black button/footer to confirm/cancel.
Definition: nbgl_content.h:336
@ TAG_VALUE_LIST
list of tag/value pairs
Definition: nbgl_content.h:334
@ BARS_LIST
list of touchable bars (with > on the right to go to sub-pages)
Definition: nbgl_content.h:340
@ INFO_BUTTON
a centered info and a simple black button
Definition: nbgl_content.h:333
nbgl_contentValueAliasType_t
possible types of value alias
Definition: nbgl_content.h:125
@ ENS_ALIAS
alias comes from ENS
Definition: nbgl_content.h:126
@ ADDRESS_BOOK_ALIAS
alias comes from Address Book
Definition: nbgl_content.h:127
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:176
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:295
const uint8_t * tokens
array of tokens, one for each bar (nbBars items)
Definition: nbgl_content.h:297
const char *const * barTexts
array of texts for each bar (nbBars items, in black/bold)
Definition: nbgl_content.h:296
uint8_t nbBars
number of elements in barTexts and tokens array
Definition: nbgl_content.h:298
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:320
nbgl_contentTipBox_t tipBox
if text field is NULL, no tip-box
Definition: nbgl_content.h:322
nbgl_contentCenter_t contentCenter
centered content (icon + text(s))
Definition: nbgl_content.h:321
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:264
uint8_t nbInfos
number of elements in infoTypes and infoContents array
Definition: nbgl_content.h:267
const char *const * infoContents
array of contents of infos (in black)
Definition: nbgl_content.h:266
const char *const * infoTypes
array of types of infos (in black/bold)
Definition: nbgl_content.h:265
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:275
uint8_t token
the token that will be used as argument of the callback
Definition: nbgl_content.h:285
bool localized
if set to true, use nameIds and not names
Definition: nbgl_content.h:282
uint8_t initChoice
index of the current choice
Definition: nbgl_content.h:284
const char *const * names
array of strings giving the choices (nbChoices)
Definition: nbgl_content.h:277
uint8_t nbChoices
number of choices
Definition: nbgl_content.h:283
This structure contains info to build a switch (on the right) with a description (on the left),...
Definition: nbgl_content.h:242
const char * text
main text for the switch
Definition: nbgl_content.h:243
uint8_t token
the token that will be used as argument of the callback
Definition: nbgl_content.h:247
nbgl_state_t initState
initial state of the switch
Definition: nbgl_content.h:246
const char * subText
description under main text (NULL terminated, single line, may be null)
Definition: nbgl_content.h:245
This structure contains [item,value] pair(s) and info about a potential "details" button,...
Definition: nbgl_content.h:218
const char * confirmationText
text of the confirmation button, if NULL "It matches" is used
Definition: nbgl_content.h:229
uint8_t confirmationToken
the token used as argument of the onActionCallback
Definition: nbgl_content.h:232
const char * cancelText
the text used for cancel action, if NULL "It doesn't matches" is used
Definition: nbgl_content.h:231
nbgl_contentTagValueList_t tagValueList
list of tag/value pairs
Definition: nbgl_content.h:219
const char * detailsButtonText
this text is used for "details" button (if NULL, no button)
Definition: nbgl_content.h:221
const nbgl_icon_details_t * detailsButtonIcon
icon to use in details button
Definition: nbgl_content.h:220
This structure contains a [item,value] pair and info about "details" button.
Definition: nbgl_content.h:202
const nbgl_icon_details_t * detailsButtonIcon
icon to use in details button
Definition: nbgl_content.h:204
const char * detailsButtonText
this text is used for "details" button
Definition: nbgl_content.h:205
nbgl_contentTagValueList_t tagValueList
list of tag/value pairs
Definition: nbgl_content.h:203
This structure contains a list of [tag,value] pairs.
Definition: nbgl_content.h:181
nbgl_contentActionCallback_t actionCallback
called when a valueIcon is touched on a given pair
Definition: nbgl_content.h:196
const nbgl_contentTagValue_t * pairs
array of [tag,value] pairs (nbPairs items). If NULL, callback is used instead
Definition: nbgl_content.h:183
bool wrapping
if set to true, value text will be wrapped on ' ' to avoid cutting words
Definition: nbgl_content.h:194
uint8_t startIndex
index of the first pair to get with callback
Definition: nbgl_content.h:187
nbgl_contentTagValueCallback_t callback
function to call to retrieve a given pair
Definition: nbgl_content.h:184
This structure contains a [tag,value] pair.
Definition: nbgl_content.h:144
const nbgl_contentValueExt_t * extension
if not NULL, gives additional info on value field
Definition: nbgl_content.h:152
const nbgl_icon_details_t * valueIcon
Definition: nbgl_content.h:149
int8_t centeredInfo
if set to 1, the tag will be displayed as a centered info
Definition: nbgl_content.h:156
const char * value
string giving the value name
Definition: nbgl_content.h:146
const char * item
string giving the tag name
Definition: nbgl_content.h:145
This structure contains data to build a tip-box, on top of a footer, on bottom of a content center.
Definition: nbgl_content.h:308
const char * text
text of the tip-box
Definition: nbgl_content.h:309
const nbgl_icon_details_t * icon
icon of the tip-box
Definition: nbgl_content.h:310
uint8_t token
token used when tip-box is tapped
Definition: nbgl_content.h:311
This structure contains additions to a tag/value pair, to be able to build a screen to display these ...
Definition: nbgl_content.h:134
const char * fullValue
full string of the value when used as an alias
Definition: nbgl_content.h:135
nbgl_contentValueAliasType_t aliasType
type of alias
Definition: nbgl_content.h:138
const char * explanation
Definition: nbgl_content.h:136
This structure contains data to build a content.
Definition: nbgl_content.h:363
nbgl_content_u content
Definition: nbgl_content.h:365
nbgl_contentActionCallback_t contentActionCallback
callback to be called when an action on an object occurs
Definition: nbgl_content.h:367
nbgl_contentType_t type
type of page content in the content union
Definition: nbgl_content.h:364
This structure contains data to build a SWITCHES_LIST content.
Definition: nbgl_content.h:256
uint8_t nbSwitches
number of elements in switches and tokens array
Definition: nbgl_content.h:258
const nbgl_contentSwitch_t * switches
array of switches (nbSwitches items)
Definition: nbgl_content.h:257
Union of the different type of contents.
Definition: nbgl_content.h:346
nbgl_contentInfoList_t infosList
INFOS_LIST type
Definition: nbgl_content.h:355
nbgl_contentInfoLongPress_t infoLongPress
INFO_LONG_PRESS type
Definition: nbgl_content.h:349
nbgl_contentTagValueDetails_t tagValueDetails
TAG_VALUE_DETAILS type
Definition: nbgl_content.h:352
nbgl_contentTagValueConfirm_t tagValueConfirm
TAG_VALUE_CONFIRM type
Definition: nbgl_content.h:353
nbgl_contentTagValueList_t tagValueList
TAG_VALUE_LIST type
Definition: nbgl_content.h:351
nbgl_contentCenteredInfo_t centeredInfo
CENTERED_INFO type
Definition: nbgl_content.h:347
nbgl_contentBarsList_t barsList
BARS_LIST type
Definition: nbgl_content.h:357
nbgl_contentExtendedCenter_t extendedCenter
EXTENDED_CENTER type
Definition: nbgl_content.h:348
nbgl_contentSwitchesList_t switchesList
SWITCHES_LIST type
Definition: nbgl_content.h:354
nbgl_contentInfoButton_t infoButton
INFO_BUTTON type
Definition: nbgl_content.h:350
nbgl_contentRadioChoice_t choicesList
CHOICES_LIST type
Definition: nbgl_content.h:356
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