Skip to content

Commit

Permalink
deprecate several use cases
Browse files Browse the repository at this point in the history
  • Loading branch information
tdejoigny-ledger committed Sep 27, 2024
1 parent 3d23aa7 commit 68537ec
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 67 deletions.
3 changes: 0 additions & 3 deletions lib_nbgl/doc/nbgl_use_case.dox
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ Some APIs have also been kept for backward compatibility, and for some rare case
- @ref nbgl_useCaseReviewStart() to draw the cover page of a review (initial page, without data)
- @ref nbgl_useCaseStaticReview() to draw the data pages of a regular review, when all info are available from the beginning (all pages but the cover one)
- @ref nbgl_useCaseRegularReview() to draw the data pages of a regular review (all pages but the cover one)
- for address verification:
- @ref nbgl_useCaseAddressConfirmation() to draw an address confirmation page, with a possibility to see it as QR Code
- @ref nbgl_useCaseAddressConfirmationExt() to draw an address confirmation page, with a possibility to see it as QR Code and some extra tag/value pairs

@subsection use_case_home_settings Home & Settings screen Use Case

Expand Down
3 changes: 0 additions & 3 deletions lib_nbgl/doc/nbgl_use_case_nanos.dox
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ A few APIs are available to draw typical Use-Cases, such as:
- for most used reviews:
- @ref nbgl_useCaseStaticReview() to draw the pages of a regular review, when all info are available from the beginning (see @subpage use_case_static_review)
- @ref nbgl_useCaseRegularReview() to draw the pages of a regular review (all pages but the cover one) (see @subpage use_case_regular_review)
- for address verification:
- @ref nbgl_useCaseAddressConfirmation() to draw an address confirmation page (see @subpage use_case_addr_confirm)
- @ref nbgl_useCaseAddressConfirmationExt() to draw an address confirmation page, with some extra tag/value pairs (see @subpage use_case_addr_confirm_ext)

@subsection use_case_home Home screen Use Case

Expand Down
88 changes: 27 additions & 61 deletions lib_nbgl/src/nbgl_use_case.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "os_pic.h"
#include "os_print.h"
#include "os_helpers.h"
#include "decorators.h"

/*********************
* DEFINES
Expand Down Expand Up @@ -2318,54 +2319,32 @@ uint8_t nbgl_useCaseGetNbPagesForTagValueList(const nbgl_contentTagValueList_t *
}

/**
* @brief draws the home page of an app (page on which we land when launching it from dashboard)
*
* @param appName app name
* @param appIcon app icon
* @param tagline text under app name (if NULL, it will be "This app enables signing transactions on
* the <appName> network.")
* @param withSettings if true, use a "settings" (wheel) icon in bottom button, otherwise a "info"
* (i)
* @param topRightCallback callback called when top-right button is touched
* @param quitCallback callback called when quit button is touched
* @deprecated
* See #nbgl_useCaseHomeAndSettings
*/
void nbgl_useCaseHome(const char *appName,
const nbgl_icon_details_t *appIcon,
const char *tagline,
bool withSettings,
nbgl_callback_t topRightCallback,
nbgl_callback_t quitCallback)
DEPRECATED void nbgl_useCaseHome(const char *appName,
const nbgl_icon_details_t *appIcon,
const char *tagline,
bool withSettings,
nbgl_callback_t topRightCallback,
nbgl_callback_t quitCallback)
{
nbgl_useCaseHomeExt(
appName, appIcon, tagline, withSettings, NULL, NULL, topRightCallback, quitCallback);
}

/**
* @brief draws the extended version of home page of an app (page on which we land when launching it
* from dashboard)
* @note it enables to use an action button (black on Stax, white on Flex)
*
* @param appName app name
* @param appIcon app icon
* @param tagline text under app name (if NULL, it will be "This app enables signing transactions on
* the <appName> network.")
* @param withSettings if true, use a "settings" (wheel) icon in bottom button, otherwise a "info"
* (i)
* @param actionButtonText if not NULL, text used for an action button (on top of "Quit
* App" button/footer)
* @param actionCallback callback called when action button is touched (if actionButtonText is not
* NULL)
* @param topRightCallback callback called when top-right button is touched
* @param quitCallback callback called when quit button is touched
* @deprecated
* See #nbgl_useCaseHomeAndSettings
*/
void nbgl_useCaseHomeExt(const char *appName,
const nbgl_icon_details_t *appIcon,
const char *tagline,
bool withSettings,
const char *actionButtonText,
nbgl_callback_t actionCallback,
nbgl_callback_t topRightCallback,
nbgl_callback_t quitCallback)
DEPRECATED void nbgl_useCaseHomeExt(const char *appName,
const nbgl_icon_details_t *appIcon,
const char *tagline,
bool withSettings,
const char *actionButtonText,
nbgl_callback_t actionCallback,
nbgl_callback_t topRightCallback,
nbgl_callback_t quitCallback)
{
nbgl_homeAction_t homeAction = {.callback = actionCallback,
.icon = NULL,
Expand Down Expand Up @@ -3292,34 +3271,21 @@ void nbgl_useCaseReviewStreamingFinish(const char *finishTitle,
}

/**
* @brief draws an address confirmation page. This page contains the given address in a tag/value
* layout, with a button to open a modal to see address as a QR Code, and at the bottom a button to
* confirm and a footer to cancel
*
* @param address address to confirm (NULL terminated string)
* @param callback callback called when button or footer is touched (if true, button, if false
* footer)
* @deprecated
* See #nbgl_useCaseAddressReview
*/
void nbgl_useCaseAddressConfirmation(const char *address, nbgl_choiceCallback_t callback)
DEPRECATED void nbgl_useCaseAddressConfirmation(const char *address, nbgl_choiceCallback_t callback)
{
nbgl_useCaseAddressConfirmationExt(address, callback, NULL);
}

/**
* @brief draws an extended address verification page. This page contains the given address in a
* tag/value layout, with a button to open a modal to see address as a QR Code. A "tap to continue"
* enables to open a second review page to display the other given tag/value pairs, with a button to
* confirm and a footer to cancel
*
* @param address address to confirm (NULL terminated string)
* @param callback callback called when button or footer is touched (if true, button, if false
* footer)
* @param tagValueList list of tag/value pairs (must fit in a single page, and be persistent because
* no copy)
* @deprecated
* See #nbgl_useCaseAddressReview
*/
void nbgl_useCaseAddressConfirmationExt(const char *address,
nbgl_choiceCallback_t callback,
const nbgl_contentTagValueList_t *tagValueList)
DEPRECATED void nbgl_useCaseAddressConfirmationExt(const char *address,
nbgl_choiceCallback_t callback,
const nbgl_contentTagValueList_t *tagValueList)
{
reset_callbacks();
memset(&genericContext, 0, sizeof(genericContext));
Expand Down

0 comments on commit 68537ec

Please sign in to comment.