Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
nbgl_layout_internal.h File Reference

Internal functions/constants of NBGL layout layer. More...

#include "nbgl_layout.h"
#include "glyphs.h"
#include "os_pic.h"
Include dependency graph for nbgl_layout_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  layoutObj_t
struct  nbgl_layoutInternal_s
 Structure containing all information about the current layout. More...

Macros

#define INTERNAL_MARGIN   8
#define LAYOUT_OBJ_POOL_LEN   16
 Max number of complex objects with callback retrievable from pool.
#define KEYBOARD_FOOTER_TYPE   99
#define KEYPAD_FOOTER_TYPE   98

Typedefs

typedef struct nbgl_layoutInternal_s nbgl_layoutInternal_t
 Structure containing all information about the current layout.

Enumerations

enum  nbgl_swipe_usage_t { SWIPE_USAGE_NAVIGATION , SWIPE_USAGE_CUSTOM , SWIPE_USAGE_SUGGESTIONS , NB_SWIPE_USAGE }
enum  {
  HEADER_INDEX = 0 , MAIN_CONTAINER_INDEX , TOP_RIGHT_BUTTON_INDEX , FOOTER_INDEX ,
  UP_FOOTER_INDEX , LEFT_BORDER_INDEX , NB_MAX_SCREEN_CHILDREN
}

Functions

bool keyboardSwipeCallback (nbgl_layoutInternal_t *layoutInt, nbgl_obj_t *obj, nbgl_touchType_t eventType)
void layoutAddObject (nbgl_layoutInternal_t *layout, nbgl_obj_t *obj)
 adds the given obj to the main container
layoutObj_t * layoutAddCallbackObj (nbgl_layoutInternal_t *layout, nbgl_obj_t *obj, uint8_t token, tune_index_e tuneId)
void layoutUpdateCallbackObjToken (nbgl_layoutInternal_t *layout, nbgl_obj_t *obj, uint8_t token)
 Update the token associated with a specific object in a layout.
void layoutNavigationPopulate (nbgl_container_t *navContainer, const nbgl_layoutNavigationBar_t *navConfig, uint8_t layer)
 This function creates a full navigation bar "object", with buttons and returns it as a container.
bool layoutNavigationCallback (nbgl_obj_t *obj, nbgl_touchType_t eventType, uint8_t nbPages, uint8_t *activePage)
 function to be called when any of the controls in navigation bar is touched
static nbgl_font_id_e layoutGetTagValueFont (bool smallCaseForValue)
 returns the font used to display the values of a list of tag/value pairs
static const nbgl_icon_details_t * layoutGetTagValueIcon (const nbgl_contentTagValue_t *pair)
 returns the icon displayed on the right of the value of the given tag/value pair
static uint16_t layoutGetTagValueWidth (const nbgl_icon_details_t *icon)
 returns the width of the value of a tag/value pair. Shared by the layout and the use cases, so that the number of lines used to compute the number of pairs fitting in a page is always the one really displayed
static uint8_t layoutGetTagValueMaxLines (uint8_t listMaxLines, const nbgl_contentTagValue_t *pair, bool *forceEllipsis)
 returns the max number of lines of the value of the given tag/value pair, which is the smallest non-zero of the list one and the pair one

Detailed Description

Internal functions/constants of NBGL layout layer.

Definition in file nbgl_layout_internal.h.

Macro Definition Documentation

◆ INTERNAL_MARGIN

#define INTERNAL_MARGIN   8

Definition at line 26 of file nbgl_layout_internal.h.

◆ KEYBOARD_FOOTER_TYPE

#define KEYBOARD_FOOTER_TYPE   99

Definition at line 44 of file nbgl_layout_internal.h.

◆ KEYPAD_FOOTER_TYPE

#define KEYPAD_FOOTER_TYPE   98

Definition at line 45 of file nbgl_layout_internal.h.

◆ LAYOUT_OBJ_POOL_LEN

#define LAYOUT_OBJ_POOL_LEN   16

Max number of complex objects with callback retrievable from pool.

Definition at line 42 of file nbgl_layout_internal.h.

Typedef Documentation

◆ nbgl_layoutInternal_t

Structure containing all information about the current layout.

Note
It shall not be used externally

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
HEADER_INDEX 
MAIN_CONTAINER_INDEX 
TOP_RIGHT_BUTTON_INDEX 
FOOTER_INDEX 
UP_FOOTER_INDEX 
LEFT_BORDER_INDEX 
NB_MAX_SCREEN_CHILDREN 

Definition at line 65 of file nbgl_layout_internal.h.

◆ nbgl_swipe_usage_t

Enumerator
SWIPE_USAGE_NAVIGATION 
SWIPE_USAGE_CUSTOM 
SWIPE_USAGE_SUGGESTIONS 
NB_SWIPE_USAGE 

Definition at line 57 of file nbgl_layout_internal.h.

Function Documentation

◆ keyboardSwipeCallback()

bool keyboardSwipeCallback ( nbgl_layoutInternal_t * layoutInt,
nbgl_obj_t * obj,
nbgl_touchType_t eventType )

Definition at line 276 of file nbgl_layout_keyboard.c.

◆ layoutAddCallbackObj()

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

Definition at line 626 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 683 of file nbgl_layout.c.

◆ layoutGetTagValueFont()

nbgl_font_id_e layoutGetTagValueFont ( bool smallCaseForValue)
inlinestatic

returns the font used to display the values of a list of tag/value pairs

Parameters
smallCaseForValuesmallCaseForValue field of the list
Returns
the font of the values

Definition at line 145 of file nbgl_layout_internal.h.

◆ layoutGetTagValueIcon()

const nbgl_icon_details_t * layoutGetTagValueIcon ( const nbgl_contentTagValue_t * pair)
inlinestatic

returns the icon displayed on the right of the value of the given tag/value pair

Parameters
pairtag/value pair
Returns
the (>) icon for an alias, otherwise the icon of the pair (NULL if none)

Definition at line 156 of file nbgl_layout_internal.h.

◆ layoutGetTagValueMaxLines()

uint8_t layoutGetTagValueMaxLines ( uint8_t listMaxLines,
const nbgl_contentTagValue_t * pair,
bool * forceEllipsis )
inlinestatic

returns the max number of lines of the value of the given tag/value pair, which is the smallest non-zero of the list one and the pair one

Parameters
listMaxLinesmax number of lines for all values of the list (0 if not limited)
pairtag/value pair
forceEllipsis[out] if not NULL, set to true if the pair has a max number of lines, in which case the last line must end with "..." if the value doesn't fit, whichever limit cuts it
Returns
the max number of lines (0 if not limited)

Definition at line 196 of file nbgl_layout_internal.h.

◆ layoutGetTagValueWidth()

uint16_t layoutGetTagValueWidth ( const nbgl_icon_details_t * icon)
inlinestatic

returns the width of the value of a tag/value pair. Shared by the layout and the use cases, so that the number of lines used to compute the number of pairs fitting in a page is always the one really displayed

Parameters
iconicon on the right of the value, as returned by layoutGetTagValueIcon()
Returns
the width in pixels of the value

Definition at line 177 of file nbgl_layout_internal.h.

◆ layoutNavigationCallback()

bool layoutNavigationCallback ( nbgl_obj_t * obj,
nbgl_touchType_t eventType,
uint8_t nbPages,
uint8_t * activePage )

function to be called when any of the controls in navigation bar is touched

Parameters
objtouched object (button or container)
eventTypetype of touch (only TOUCHED or SWIPED is accepted)
nbPagesnumber of pages for navigation (if < 2, no navigation keys)
activePagecurrent active page
Returns
true if actually navigated (page change)

Definition at line 97 of file nbgl_layout_navigation.c.

◆ layoutNavigationPopulate()

void layoutNavigationPopulate ( nbgl_container_t * navContainer,
const nbgl_layoutNavigationBar_t * navConfig,
uint8_t layer )

This function creates a full navigation bar "object", with buttons and returns it as a container.

Parameters
navContainercontainer used for the objects of the navigation
navConfigconfiguration to create the navigation bar, at the bottom of the screen
layerlayer (screen) to create the navigation bar in

Definition at line 154 of file nbgl_layout_navigation.c.

◆ layoutUpdateCallbackObjToken()

void layoutUpdateCallbackObjToken ( nbgl_layoutInternal_t * layout,
nbgl_obj_t * obj,
uint8_t token )

Update the token associated with a specific object in a layout.

This function updates the token for a given object in the layout's callback object pool.

Parameters
[in]layoutThe layout object for which the token is to be updated.
[in]objThe object whose token needs to be updated.
[in]tokenThe new token to be set for the object.

Definition at line 655 of file nbgl_layout.c.