Embedded SDK
Embedded SDK
Classes | Macros | Enumerations | Functions
nbgl_layout.c File Reference

Implementation of predefined layouts management for Applications. More...

#include "app_config.h"
#include <string.h>
#include <stdlib.h>
#include "nbgl_debug.h"
#include "nbgl_front.h"
#include "nbgl_layout_internal.h"
#include "nbgl_obj.h"
#include "nbgl_draw.h"
#include "nbgl_screen.h"
#include "nbgl_touch.h"
#include "glyphs.h"
#include "os_pic.h"
#include "os_helpers.h"
#include "lcx_rng.h"
Include dependency graph for nbgl_layout.c:

Go to the source code of this file.

Classes

struct  listItem_t
 

Macros

#define INTERNAL_SPACE   16
 
#define INNER_MARGIN   12
 
#define NB_MAX_LAYOUTS   3
 
#define NB_MAX_CONTAINER_CHILDREN   20
 
#define TAG_VALUE_ICON_WIDTH   32
 
#define RADIO_CHOICE_HEIGHT   92
 
#define FOOTER_HEIGHT   80
 
#define BAR_INTERVALE   16
 
#define BACK_KEY_WIDTH   104
 
#define FOOTER_BUTTON_HEIGHT   136
 
#define UP_FOOTER_BUTTON_HEIGHT   136
 
#define ROUNDED_AND_FOOTER_FOOTER_HEIGHT   208
 
#define ACTION_AND_FOOTER_FOOTER_HEIGHT   232
 
#define SPINNER_REFRESH_PERIOD   400
 
#define HOLD_TO_APPROVE_STEP_PERCENT   (25)
 
#define HOLD_TO_APPROVE_STEP_DURATION_MS   (400)
 

Enumerations

enum  { PAGE_INDICATOR_INDEX = 0 , LEFT_HALF_INDEX , RIGHT_HALF_INDEX , FIRST_BUTTON_INDEX }
 
enum  listItemType_t { TOUCHABLE_BAR_ITEM , SWITCH_ITEM , NB_ITEM_TYPES }
 

Functions

const char * get_ux_loc_string (uint32_t index)
 
layoutObj_tlayoutAddCallbackObj (nbgl_layoutInternal_t *layout, nbgl_obj_t *obj, uint8_t token, tune_index_e tuneId)
 
void layoutAddObject (nbgl_layoutInternal_t *layout, nbgl_obj_t *obj)
 adds the given obj to the main container More...
 
nbgl_layout_tnbgl_layoutGet (const nbgl_layoutDescription_t *description)
 returns a layout of the given type. The layout is reset 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_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_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_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

icon on right of text to activate an action when touched, with the given token

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_layoutAddLargeCaseText (nbgl_layout_t *layout, const char *text, bool grayedOut)
 Creates an area with given text in 32px font (in Black or Light Gray) 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_layoutAddRadioChoice (nbgl_layout_t *layout, const nbgl_layoutRadioChoice_t *choices)
 Creates a list of radio buttons (on the right) 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_layoutAddLeftContent (nbgl_layout_t *layout, const nbgl_layoutLeftContent_t *info)
 Creates an area with a title, and rows of icon + text, left aligned. 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_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_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_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_layoutDraw (nbgl_layout_t *layoutParam)
 Applies given layout. The screen will be redrawn. More...
 
int nbgl_layoutRelease (nbgl_layout_t *layoutParam)
 Release the layout obtained with nbgl_layoutGet() More...
 

Detailed Description

Implementation of predefined layouts management for Applications.

Note
This file applies only to wallet size products (Stax, Flex...)

Definition in file nbgl_layout.c.

Macro Definition Documentation

◆ ACTION_AND_FOOTER_FOOTER_HEIGHT

#define ACTION_AND_FOOTER_FOOTER_HEIGHT   232

Definition at line 59 of file nbgl_layout.c.

◆ BACK_KEY_WIDTH

#define BACK_KEY_WIDTH   104

Definition at line 55 of file nbgl_layout.c.

◆ BAR_INTERVALE

#define BAR_INTERVALE   16

Definition at line 54 of file nbgl_layout.c.

◆ FOOTER_BUTTON_HEIGHT

#define FOOTER_BUTTON_HEIGHT   136

Definition at line 56 of file nbgl_layout.c.

◆ FOOTER_HEIGHT

#define FOOTER_HEIGHT   80

Definition at line 53 of file nbgl_layout.c.

◆ HOLD_TO_APPROVE_STEP_DURATION_MS

#define HOLD_TO_APPROVE_STEP_DURATION_MS   (400)

Definition at line 135 of file nbgl_layout.c.

◆ HOLD_TO_APPROVE_STEP_PERCENT

#define HOLD_TO_APPROVE_STEP_PERCENT   (25)

Definition at line 134 of file nbgl_layout.c.

◆ INNER_MARGIN

#define INNER_MARGIN   12

Definition at line 33 of file nbgl_layout.c.

◆ INTERNAL_SPACE

#define INTERNAL_SPACE   16

Definition at line 31 of file nbgl_layout.c.

◆ NB_MAX_CONTAINER_CHILDREN

#define NB_MAX_CONTAINER_CHILDREN   20

Definition at line 38 of file nbgl_layout.c.

◆ NB_MAX_LAYOUTS

#define NB_MAX_LAYOUTS   3

Definition at line 35 of file nbgl_layout.c.

◆ RADIO_CHOICE_HEIGHT

#define RADIO_CHOICE_HEIGHT   92

Definition at line 52 of file nbgl_layout.c.

◆ ROUNDED_AND_FOOTER_FOOTER_HEIGHT

#define ROUNDED_AND_FOOTER_FOOTER_HEIGHT   208

Definition at line 58 of file nbgl_layout.c.

◆ SPINNER_REFRESH_PERIOD

#define SPINNER_REFRESH_PERIOD   400

Definition at line 63 of file nbgl_layout.c.

◆ TAG_VALUE_ICON_WIDTH

#define TAG_VALUE_ICON_WIDTH   32

Definition at line 40 of file nbgl_layout.c.

◆ UP_FOOTER_BUTTON_HEIGHT

#define UP_FOOTER_BUTTON_HEIGHT   136

Definition at line 57 of file nbgl_layout.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
PAGE_INDICATOR_INDEX 
LEFT_HALF_INDEX 
RIGHT_HALF_INDEX 
FIRST_BUTTON_INDEX 

Definition at line 69 of file nbgl_layout.c.

◆ listItemType_t

Enumerator
TOUCHABLE_BAR_ITEM 
SWITCH_ITEM 
NB_ITEM_TYPES 

Definition at line 85 of file nbgl_layout.c.

Function Documentation

◆ get_ux_loc_string()

const char* get_ux_loc_string ( uint32_t  index)

◆ layoutAddCallbackObj()

layoutObj_t* layoutAddCallbackObj ( nbgl_layoutInternal_t layout,
nbgl_obj_t obj,
uint8_t  token,
tune_index_e  tuneId 
)

Definition at line 492 of file nbgl_layout.c.

◆ layoutAddObject()

void layoutAddObject ( nbgl_layoutInternal_t layout,
nbgl_obj_t obj 
)

adds the given obj to the main container

Parameters
layout
obj

Definition at line 519 of file nbgl_layout.c.

◆ nbgl_layoutAddBottomButton()

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

Parameters
layoutthe current layout
iconicon inside the round button
tokenused as parameter of userCallback when button is touched
separationLineif set to true, adds a light gray separation line on top of the container
tuneIdif not NBGL_NO_TUNE, a tune will be played when button is pressed
Returns
>= 0 if OK

Definition at line 1196 of file nbgl_layout.c.

◆ nbgl_layoutAddButton()

int nbgl_layoutAddButton ( nbgl_layout_t layout,
const nbgl_layoutButton_t buttonInfo 
)

Creates a rounded button in the main container.

Parameters
layoutthe current layout
buttonInfostructure giving the description of button (text, icon, layout)
Returns
>= 0 if OK

Definition at line 2203 of file nbgl_layout.c.

◆ nbgl_layoutAddCenteredInfo()

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.

Parameters
layoutthe current layout
infostructure giving the description of buttons (texts, icons, layout)
Returns
>= 0 if OK

Definition at line 1610 of file nbgl_layout.c.

◆ nbgl_layoutAddChoiceButtons()

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.

Parameters
layoutthe current layout
infostructure giving the description of buttons (texts, icons, layout)
Returns
>= 0 if OK

Definition at line 1916 of file nbgl_layout.c.

◆ nbgl_layoutAddContentCenter()

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.

Parameters
layoutthe current layout
infostructure giving the description of the Content Center
Returns
the size of the area if OK

Definition at line 1673 of file nbgl_layout.c.

◆ nbgl_layoutAddExtendedFooter()

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.

Parameters
layoutthe current layout
footerDescif not NBGL_NO_TUNE, a tune will be played when button is long pressed
Returns
height of the control if OK

Definition at line 2649 of file nbgl_layout.c.

◆ nbgl_layoutAddFooter()

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.

Parameters
layoutthe current layout
texttext to used in the footer
tokentoken to use when the footer is touched
tuneIdif not NBGL_NO_TUNE, a tune will be played when button is long pressed
Returns
height of the control if OK

Definition at line 2333 of file nbgl_layout.c.

◆ nbgl_layoutAddHeader()

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.

Parameters
layoutthe current layout
headerDescdescription of the header to add
Returns
height of the control if OK

Definition at line 2386 of file nbgl_layout.c.

◆ nbgl_layoutAddHorizontalButtons()

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.

Parameters
layoutthe current layout
infostructure giving the description of buttons (text, icon, tokens)
Returns
>= 0 if OK

Definition at line 1939 of file nbgl_layout.c.

◆ nbgl_layoutAddLargeCaseText()

int nbgl_layoutAddLargeCaseText ( nbgl_layout_t layout,
const char *  text,
bool  grayedOut 
)

Creates an area with given text in 32px font (in Black or Light Gray)

Parameters
layoutthe current layout
texttext to be displayed (auto-wrap)
grayedOutif true, use light-gray instead of black
Returns
>= 0 if OK

Definition at line 1377 of file nbgl_layout.c.

◆ nbgl_layoutAddLeftContent()

int nbgl_layoutAddLeftContent ( nbgl_layout_t layout,
const nbgl_layoutLeftContent_t info 
)

Creates an area with a title, and rows of icon + text, left aligned.

Parameters
layoutthe current layout
infostructure giving the description of rows (number of rows, title, icons, texts)
Returns
>= 0 if OK

Definition at line 1695 of file nbgl_layout.c.

◆ nbgl_layoutAddLongPressButton()

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.

Parameters
layoutthe current layout
texttext of the button button
tokentoken attached to actionCallback when long time of press is elapsed
tuneIdif not NBGL_NO_TUNE, a tune will be played when button is long pressed
Returns
>= 0 if OK

Definition at line 2305 of file nbgl_layout.c.

◆ nbgl_layoutAddNavigationBar()

int nbgl_layoutAddNavigationBar ( nbgl_layout_t layout,
const nbgl_layoutNavigationBar_t info 
)

Creates a navigation bar on bottom of main container.

Parameters
layoutthe current layout
infostructure giving the description of the navigation bar
Returns
the height of the control if OK

Definition at line 1170 of file nbgl_layout.c.

◆ nbgl_layoutAddProgressBar()

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.

Parameters
layoutthe current layout
barLayoutstructure giving the description of progress bar
Returns
>= 0 if OK

Definition at line 2112 of file nbgl_layout.c.

◆ nbgl_layoutAddProgressIndicator()

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.

Deprecated:
Parameters
layoutthe current layout
activePagecurrent page [O,(nbPages-1)]
nbPagesnumber of pages
withBackif true, the back arrow is drawn
backTokentoken used with actionCallback is withBack is true
tuneIdif not NBGL_NO_TUNE, a tune will be played when back button is pressed
Returns
the height of the control if OK

Definition at line 3343 of file nbgl_layout.c.

◆ nbgl_layoutAddQRCode()

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.

Parameters
layoutthe current layout
infostructure giving the description of buttons (texts, icons, layout)
Returns
height of the control if OK

Definition at line 1789 of file nbgl_layout.c.

◆ nbgl_layoutAddRadioChoice()

int nbgl_layoutAddRadioChoice ( nbgl_layout_t layout,
const nbgl_layoutRadioChoice_t choices 
)

Creates a list of radio buttons (on the right)

Parameters
layoutthe current layout
choicesstructure giving the list of choices and the current selected one
Returns
>= 0 if OK

Definition at line 1513 of file nbgl_layout.c.

◆ nbgl_layoutAddSeparationLine()

int nbgl_layoutAddSeparationLine ( nbgl_layout_t layout)

adds a separation line on bottom of the last added item

Parameters
layoutthe current layout
Returns
>= 0 if OK

Definition at line 2183 of file nbgl_layout.c.

◆ nbgl_layoutAddSpinner()

int nbgl_layoutAddSpinner ( nbgl_layout_t layout,
const char *  text,
bool  fixed 
)

Creates a centered (vertically & horizontally) spinner with a text under it.

Parameters
layoutthe current layout
texttext to draw under the spinner
fixedif set to true, the spinner won't spin and be entirely black
Returns
>= 0 if OK

Definition at line 3372 of file nbgl_layout.c.

◆ nbgl_layoutAddSplitFooter()

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.

Parameters
layoutthe current layout
leftTexttext to used in the left part of footer
leftTokentoken to use when the left part of footer is touched
rightTexttext to used in the right part of footer
rightTokentoken to use when the right part of footer is touched
tuneIdif not NBGL_NO_TUNE, a tune will be played when button is long pressed
Returns
height of the control if OK

Definition at line 2360 of file nbgl_layout.c.

◆ nbgl_layoutAddSubHeaderText()

int nbgl_layoutAddSubHeaderText ( nbgl_layout_t layout,
const char *  text 
)

Creates an area with given text in small regular font, under the header.

Parameters
layoutthe current layout
textmain text in small regular font
Returns
height of the control if OK

Definition at line 1335 of file nbgl_layout.c.

◆ nbgl_layoutAddSwipe()

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.

Parameters
layoutthe current layout
swipesMaskthe type of swipes to be handled by the container
textthe text in gray to display at bottom of the main container (can be NULL)
tokenthe token that will be used as argument of the callback
tuneIdif not NBGL_NO_TUNE, a tune will be played when button is pressed
Returns
>= 0 if OK

Definition at line 1084 of file nbgl_layout.c.

◆ nbgl_layoutAddSwitch()

int nbgl_layoutAddSwitch ( nbgl_layout_t layout,
const nbgl_layoutSwitch_t switchLayout 
)

Creates a switch with the given text and its state.

Parameters
layoutthe current layout
switchLayoutdescription of the parameters of the switch
Returns
height of the control if OK

Definition at line 1261 of file nbgl_layout.c.

◆ nbgl_layoutAddTagValueList()

int nbgl_layoutAddTagValueList ( nbgl_layout_t layout,
const nbgl_layoutTagValueList_t list 
)

Creates a list of [tag,value] pairs.

Parameters
layoutthe current layout
liststructure giving the list of [tag,value] pairs
Returns
>= 0 if OK

Definition at line 1960 of file nbgl_layout.c.

◆ nbgl_layoutAddText()

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)

Parameters
layoutthe current layout
textmain text (in small bold font), optional
subTextdescription under main text (in small regular font), optional
Returns
height of the control if OK

Definition at line 1301 of file nbgl_layout.c.

◆ nbgl_layoutAddTextContent()

int nbgl_layoutAddTextContent ( nbgl_layout_t layout,
const char *  title,
const char *  description,
const char *  info 
)

Creates in the main container three text areas:

  • a first one in black large case, with title param
  • a second one under it, in black small case, with description param
  • a last one at the bottom of the container, in gray, with info param
Parameters
layoutthe current layout
titlemain text (in large bold font)
descriptiondescription under main text (in small regular font)
infodescription at bottom (in small gray)
Returns
height of the control if OK

Definition at line 1431 of file nbgl_layout.c.

◆ nbgl_layoutAddTextWithAlias()

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

Parameters
layoutthe current layout
textmain text (in small bold font), optional
subTextdescription under main text (in small regular font), optional
tokentoken to use in callback when > icon is touched
indexindex to use in callback when > icon is touched
Returns
height of the control if OK

Definition at line 1318 of file nbgl_layout.c.

◆ nbgl_layoutAddTopRightButton()

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.

Parameters
layoutthe current layout
iconicon configuration
tokenthe token that will be used as argument of the callback
tuneIdif not NBGL_NO_TUNE, a tune will be played when button is pressed
Returns
>= 0 if OK

Definition at line 1125 of file nbgl_layout.c.

◆ nbgl_layoutAddTouchableBar()

int nbgl_layoutAddTouchableBar ( nbgl_layout_t layout,
const nbgl_layoutBar_t barLayout 
)

Creates a touchable bar in main panel.

Parameters
layoutthe current layout
barLayoutthe properties of the bar
Returns
the height of the bar if OK

Definition at line 1222 of file nbgl_layout.c.

◆ nbgl_layoutAddUpFooter()

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.

Parameters
layoutthe current layout
upFooterDescdescription of the up-footer
Returns
height of the control if OK

Definition at line 3043 of file nbgl_layout.c.

◆ nbgl_layoutDraw()

int nbgl_layoutDraw ( nbgl_layout_t layoutParam)

Applies given layout. The screen will be redrawn.

Parameters
layoutParamlayout to redraw
Returns
a pointer to the corresponding layout

Definition at line 3437 of file nbgl_layout.c.

◆ nbgl_layoutGet()

nbgl_layout_t* nbgl_layoutGet ( const nbgl_layoutDescription_t description)

returns a layout of the given type. The layout is reset

Parameters
descriptiondescription of layout
Returns
a pointer to the corresponding layout

Definition at line 995 of file nbgl_layout.c.

◆ nbgl_layoutRelease()

int nbgl_layoutRelease ( nbgl_layout_t layoutParam)

Release the layout obtained with nbgl_layoutGet()

Parameters
layoutParamlayout to release
Returns
>= 0 if OK

Definition at line 3468 of file nbgl_layout.c.