Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Functions
nbgl_step.c File Reference

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

#include <string.h>
#include "nbgl_debug.h"
#include "nbgl_step.h"
#include "glyphs.h"
#include "os_pic.h"
#include "os_print.h"
Include dependency graph for nbgl_step.c:

Go to the source code of this file.

Classes

struct  TextContext_s
 
struct  MenuListContext_s
 
struct  StepContext_s
 

Macros

#define TMP_STRING_MAX_LEN   24
 Maximum number of layers for steps, cannot be greater than max number of layout layers.
 
#define NB_MAX_LAYERS   3
 

Typedefs

typedef struct TextContext_s TextContext_t
 
typedef struct MenuListContext_s MenuListContext_t
 
typedef struct StepContext_s StepContext_t
 

Enumerations

enum  StepStype_t { TEXT_STEP = 0 , CENTERED_INFO_STEP , MENU_LIST_STEP }
 

Functions

nbgl_step_t nbgl_stepDrawText (nbgl_stepPosition_t pos, nbgl_stepButtonCallback_t onActionCallback, nbgl_screenTickerConfiguration_t *ticker, const char *text, const char *subText, nbgl_contentCenteredInfoStyle_t style, bool modal)
 draws a text type step, that can be multi-pages, depending of the length of text and subText. The navigation arrows are displayed depending of the given position of this step in a flow, and depending of the page in case of multi-pages
 
nbgl_step_t nbgl_stepDrawCenteredInfo (nbgl_stepPosition_t pos, nbgl_stepButtonCallback_t onActionCallback, nbgl_screenTickerConfiguration_t *ticker, nbgl_layoutCenteredInfo_t *info, bool modal)
 draw a step with a centered info (icon + text). This is always a single page step
 
nbgl_step_t nbgl_stepDrawMenuList (nbgl_stepMenuListCallback_t onActionCallback, nbgl_screenTickerConfiguration_t *ticker, nbgl_layoutMenuList_t *list, bool modal)
 draw a step page with a menu list and navigation arrows to parse it. This step must be alone
 
uint8_t nbgl_stepGetMenuListCurrent (nbgl_step_t step)
 Get the index of the currently selected item in the menulist.
 
nbgl_step_t nbgl_stepDrawSwitch (nbgl_stepPosition_t pos, nbgl_stepButtonCallback_t onActionCallback, nbgl_screenTickerConfiguration_t *ticker, nbgl_layoutSwitch_t *switchInfo, bool modal)
 draw a step page with a switch and navigation arrows to navigate to other pages.
 
int nbgl_stepRelease (nbgl_step_t step)
 Release the step obtained with any of the nbgl_stepDrawXXX() functions.
 

Detailed Description

Implementation of predefined pages management for Applications.

Definition in file nbgl_step.c.

Macro Definition Documentation

◆ NB_MAX_LAYERS

#define NB_MAX_LAYERS   3

Definition at line 27 of file nbgl_step.c.

◆ TMP_STRING_MAX_LEN

#define TMP_STRING_MAX_LEN   24

Maximum number of layers for steps, cannot be greater than max number of layout layers.

Definition at line 26 of file nbgl_step.c.

Typedef Documentation

◆ MenuListContext_t

definition of context for a MENU_LIST_STEP step

◆ StepContext_t

typedef struct StepContext_s StepContext_t

◆ TextContext_t

typedef struct TextContext_s TextContext_t

definition of context for a TEXT_STEP or CENTERED_INFO_STEP step

Enumeration Type Documentation

◆ StepStype_t

type of step

Enumerator
TEXT_STEP 

for a simple text step

CENTERED_INFO_STEP 

for a centered info step

MENU_LIST_STEP 

for a menu list step

Definition at line 35 of file nbgl_step.c.

Function Documentation

◆ nbgl_stepDrawCenteredInfo()

nbgl_step_t nbgl_stepDrawCenteredInfo ( nbgl_stepPosition_t  pos,
nbgl_stepButtonCallback_t  onActionCallback,
nbgl_screenTickerConfiguration_t ticker,
nbgl_layoutCenteredInfo_t info,
bool  modal 
)

draw a step with a centered info (icon + text). This is always a single page step

Parameters
posposition of this step in the flow (first, last, single, not_first_nor_last)
onActionCallbackcommon callback for all actions on this page
tickerticker configuration, set to NULL to disable it
infoall information about the centered info to be displayed
modalif true, means this step shall be displayed on top of existing one
Returns
the step context (or NULL if error)

Definition at line 564 of file nbgl_step.c.

◆ nbgl_stepDrawMenuList()

nbgl_step_t nbgl_stepDrawMenuList ( nbgl_stepMenuListCallback_t  onActionCallback,
nbgl_screenTickerConfiguration_t ticker,
nbgl_layoutMenuList_t list,
bool  modal 
)

draw a step page with a menu list and navigation arrows to parse it. This step must be alone

Parameters
onActionCallbackcommon callback for all actions on this page
tickerticker configuration, set to NULL to disable it
listconfiguration of the menu list
modalif true, means this step shall be displayed on top of existing one
Returns
the step context (or NULL if error)

Definition at line 619 of file nbgl_step.c.

◆ nbgl_stepDrawSwitch()

nbgl_step_t nbgl_stepDrawSwitch ( nbgl_stepPosition_t  pos,
nbgl_stepButtonCallback_t  onActionCallback,
nbgl_screenTickerConfiguration_t ticker,
nbgl_layoutSwitch_t switchInfo,
bool  modal 
)

draw a step page with a switch and navigation arrows to navigate to other pages.

Note
Switch name must fit in one line, description on 2 lines max.
Parameters
posposition of this step in the flow (first, last, single, not_first_nor_last)
onActionCallbackcommon callback for all actions on this page
tickerticker configuration, set to NULL to disable it
switchInfoall information about the switch to be displayed
modalif true, means this step shall be displayed on top of existing one
Returns
the step context (or NULL if error)

Definition at line 675 of file nbgl_step.c.

◆ nbgl_stepDrawText()

nbgl_step_t nbgl_stepDrawText ( nbgl_stepPosition_t  pos,
nbgl_stepButtonCallback_t  onActionCallback,
nbgl_screenTickerConfiguration_t ticker,
const char *  text,
const char *  subText,
nbgl_contentCenteredInfoStyle_t  style,
bool  modal 
)

draws a text type step, that can be multi-pages, depending of the length of text and subText. The navigation arrows are displayed depending of the given position of this step in a flow, and depending of the page in case of multi-pages

Parameters
posposition of this step in the flow (first, last, single, not_first_nor_last)
onActionCallbackcommon callback for all actions on this page
tickerticker configuration, set to NULL to disable it
texttext to display (depending of style)
subTexttext to display under text (depending of style)
stylestyle to use for text and subText
modalif true, means this step shall be displayed on top of existing one
Returns
the step context (or NULL if error)

Definition at line 456 of file nbgl_step.c.

◆ nbgl_stepGetMenuListCurrent()

uint8_t nbgl_stepGetMenuListCurrent ( nbgl_step_t  step)

Get the index of the currently selected item in the menulist.

Parameters
stepstep from which to get the current menulist choice
Returns
current menulist choice

Definition at line 654 of file nbgl_step.c.

◆ nbgl_stepRelease()

int nbgl_stepRelease ( nbgl_step_t  step)

Release the step obtained with any of the nbgl_stepDrawXXX() functions.

Parameters
stepstep to release
Returns
>= 0 if OK

Definition at line 726 of file nbgl_step.c.