|
Embedded SDK
Embedded SDK
|
Implementation of predefined keyboard related layouts management. More...
#include <string.h>#include <stdlib.h>#include <stdio.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_io_seph_cmd.h"#include "os_io_seph_ux.h"#include "os_pic.h"#include "os_helpers.h"
Go to the source code of this file.
Macros | |
| #define | SUGGESTION_BUTTONS_SIDE_MARGIN BORDER_MARGIN |
| #define | LINE_THICKNESS 2 |
| #define | LINE_COLOR LIGHT_GRAY |
Enumerations | |
| enum | { PAGE_INDICATOR_INDEX = 0 , FIRST_BUTTON_INDEX , SECOND_BUTTON_INDEX , THIRD_BUTTON_INDEX , FOURTH_BUTTON_INDEX , NB_SUGGESTION_CHILDREN } |
| enum | { NUMBER_INDEX = 0 , TEXT_INDEX , DELETE_INDEX , LINE_INDEX } |
Functions | |
| bool | keyboardSwipeCallback (nbgl_obj_t *obj, nbgl_touchType_t eventType) |
| int | nbgl_layoutAddKeyboard (nbgl_layout_t *layout, const nbgl_layoutKbd_t *kbdInfo) |
| Creates a keyboard on bottom of the screen, with the given configuration. | |
| int | nbgl_layoutUpdateKeyboard (nbgl_layout_t *layout, uint8_t index, uint32_t keyMask, bool updateCasing, keyboardCase_t casing) |
| Updates an existing keyboard on bottom of the screen, with the given configuration. | |
| bool | nbgl_layoutKeyboardNeedsRefresh (nbgl_layout_t *layout, uint8_t index) |
| function called to know whether the keyboard has been redrawn and needs a refresh | |
| int | nbgl_layoutAddEnteredText (nbgl_layout_t *layout, bool numbered, uint8_t number, const char *text, bool grayedOut, int offsetY, int token) |
| Adds a "text entry" area under the previously entered object. This area can be preceded (beginning of line) by an index, indicating for example the entered world. A vertical gray line is placed under the text. This text must be vertical placed in the screen with offsetY. | |
| int | nbgl_layoutUpdateEnteredText (nbgl_layout_t *layout, uint8_t index, bool numbered, uint8_t number, const char *text, bool grayedOut) |
| Updates an existing "text entry" area, created with nbgl_layoutAddEnteredText() | |
| int | nbgl_layoutAddConfirmationButton (nbgl_layout_t *layout, bool active, const char *text, int token, tune_index_e tuneId) |
| Adds a black full width confirmation button on top of the previously added keyboard. | |
| int | nbgl_layoutUpdateConfirmationButton (nbgl_layout_t *layout, uint8_t index, bool active, const char *text) |
| Updates an existing black full width confirmation button on top of the previously added keyboard. | |
| int | nbgl_layoutAddKeyboardContent (nbgl_layout_t *layout, nbgl_layoutKeyboardContent_t *content) |
| Adds an area containing a potential title, a text entry and either confirmation or suggestion buttons, on top of the keyboard. | |
| int | nbgl_layoutUpdateKeyboardContent (nbgl_layout_t *layout, nbgl_layoutKeyboardContent_t *content) |
| Updates an area containing a potential title, a text entry and either confirmation or suggestion buttons, on top of the keyboard This area must have been built with nbgl_layoutAddKeyboardContent, and the type must not change. | |
Implementation of predefined keyboard related layouts management.
Definition in file nbgl_layout_keyboard.c.
| #define LINE_COLOR LIGHT_GRAY |
Definition at line 123 of file nbgl_layout_keyboard.c.
| #define LINE_THICKNESS 2 |
Definition at line 122 of file nbgl_layout_keyboard.c.
| #define SUGGESTION_BUTTONS_SIDE_MARGIN BORDER_MARGIN |
Definition at line 117 of file nbgl_layout_keyboard.c.
| anonymous enum |
| Enumerator | |
|---|---|
| PAGE_INDICATOR_INDEX | |
| FIRST_BUTTON_INDEX | |
| SECOND_BUTTON_INDEX | |
| THIRD_BUTTON_INDEX | |
| FOURTH_BUTTON_INDEX | |
| NB_SUGGESTION_CHILDREN | |
Definition at line 36 of file nbgl_layout_keyboard.c.
| anonymous enum |
| Enumerator | |
|---|---|
| NUMBER_INDEX | |
| TEXT_INDEX | |
| DELETE_INDEX | |
| LINE_INDEX | |
Definition at line 52 of file nbgl_layout_keyboard.c.
| bool keyboardSwipeCallback | ( | nbgl_obj_t * | obj, |
| nbgl_touchType_t | eventType | ||
| ) |
Definition at line 254 of file nbgl_layout_keyboard.c.
| int nbgl_layoutAddConfirmationButton | ( | nbgl_layout_t * | layout, |
| bool | active, | ||
| const char * | text, | ||
| int | token, | ||
| tune_index_e | tuneId | ||
| ) |
Adds a black full width confirmation button on top of the previously added keyboard.
| layout | the current layout |
| active | if true, button is active, otherwise inactive (grayed-out) |
| text | text of the button |
| token | token of the button, used in onActionCallback |
| tuneId | tune to play when button is pressed |
Definition at line 813 of file nbgl_layout_keyboard.c.
| int nbgl_layoutAddEnteredText | ( | nbgl_layout_t * | layout, |
| bool | numbered, | ||
| uint8_t | number, | ||
| const char * | text, | ||
| bool | grayedOut, | ||
| int | offsetY, | ||
| int | token | ||
| ) |
Adds a "text entry" area under the previously entered object. This area can be preceded (beginning of line) by an index, indicating for example the entered world. A vertical gray line is placed under the text. This text must be vertical placed in the screen with offsetY.
| layout | the current layout |
| numbered | if true, the "number" param is used as index |
| number | index of the text |
| text | string to display in the area |
| grayedOut | if true, the text is grayed out (unused) |
| offsetY | vertical offset from the top of the page |
| token | token provided in onActionCallback when the "cross" is touched |
Definition at line 687 of file nbgl_layout_keyboard.c.
| int nbgl_layoutAddKeyboard | ( | nbgl_layout_t * | layout, |
| const nbgl_layoutKbd_t * | kbdInfo | ||
| ) |
Creates a keyboard on bottom of the screen, with the given configuration.
| layout | the current layout |
| kbdInfo | configuration of the keyboard to draw (including the callback when touched) |
Definition at line 540 of file nbgl_layout_keyboard.c.
| int nbgl_layoutAddKeyboardContent | ( | nbgl_layout_t * | layout, |
| nbgl_layoutKeyboardContent_t * | content | ||
| ) |
Adds an area containing a potential title, a text entry and either confirmation or suggestion buttons, on top of the keyboard.
| layout | the current layout |
| content | structure containing the info |
Definition at line 899 of file nbgl_layout_keyboard.c.
| bool nbgl_layoutKeyboardNeedsRefresh | ( | nbgl_layout_t * | layout, |
| uint8_t | index | ||
| ) |
function called to know whether the keyboard has been redrawn and needs a refresh
| layout | the current layout |
| index | index returned by nbgl_layoutAddKeyboard() (unused) |
Definition at line 646 of file nbgl_layout_keyboard.c.
| int nbgl_layoutUpdateConfirmationButton | ( | nbgl_layout_t * | layout, |
| uint8_t | index, | ||
| bool | active, | ||
| const char * | text | ||
| ) |
Updates an existing black full width confirmation button on top of the previously added keyboard.
| layout | the current layout |
| index | returned value of nbgl_layoutAddConfirmationButton() |
| active | if true, button is active |
| text | text of the button = * |
Definition at line 854 of file nbgl_layout_keyboard.c.
| int nbgl_layoutUpdateEnteredText | ( | nbgl_layout_t * | layout, |
| uint8_t | index, | ||
| bool | numbered, | ||
| uint8_t | number, | ||
| const char * | text, | ||
| bool | grayedOut | ||
| ) |
Updates an existing "text entry" area, created with nbgl_layoutAddEnteredText()
| layout | the current layout |
| index | index of the text (return value of nbgl_layoutAddEnteredText()) |
| numbered | if set to true, the text is preceded on the left by 'number.' |
| number | if numbered is true, number used to build 'number.' text |
| text | string to display in the area |
| grayedOut | if true, the text is grayed out (but not the potential number) |
Definition at line 755 of file nbgl_layout_keyboard.c.
| int nbgl_layoutUpdateKeyboard | ( | nbgl_layout_t * | layout, |
| uint8_t | index, | ||
| uint32_t | keyMask, | ||
| bool | updateCasing, | ||
| keyboardCase_t | casing | ||
| ) |
Updates an existing keyboard on bottom of the screen, with the given configuration.
| layout | the current layout |
| index | index returned by nbgl_layoutAddKeyboard() (unused) |
| keyMask | mask of keys to activate/deactivate on keyboard |
| updateCasing | if true, update keyboard casing with given value |
| casing | casing to use |
Definition at line 609 of file nbgl_layout_keyboard.c.
| int nbgl_layoutUpdateKeyboardContent | ( | nbgl_layout_t * | layout, |
| nbgl_layoutKeyboardContent_t * | content | ||
| ) |
Updates an area containing a potential title, a text entry and either confirmation or suggestion buttons, on top of the keyboard This area must have been built with nbgl_layoutAddKeyboardContent, and the type must not change.
| layout | the current layout |
| content | structure containing the updated info |
Definition at line 970 of file nbgl_layout_keyboard.c.