|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
Wizard for creating or editing the device owner's vCard via the GUI. More...
#include <VcardWizard.h>
Public Types | |
| using | DoneCallback = void (*)() |
| Callback fired after a successful save, before returning to the anchor view. Lets the caller refresh a list it owns. | |
Static Public Member Functions | |
| static void | configure (const char *const *titleKeys, const char *savedKey, const char *failedKey) |
| Configures the wizard with i18n keys. Must be called before start() or edit() so step titles can be looked up. | |
| static void | start (ui::IView *returnAnchor) |
| Starts the wizard with an empty struct. | |
| static void | edit (ui::IView *returnAnchor) |
| Starts the wizard prefilled with the currently stored own vCard. Falls back to start() when no vCard is present. | |
| static void | startReceived (ui::IView *returnAnchor, DoneCallback onDone) |
| Starts the wizard to create a new stored contact (received list). | |
| static void | editReceived (ui::IView *returnAnchor, uint16_t slot, DoneCallback onDone) |
| Starts the wizard prefilled with a stored contact for editing. | |
Wizard for creating or editing the device owner's vCard via the GUI.
The wizard is a sequence of T9 input steps. On completion it generates a vCard 4.0 string and persists it through vcard_store_set_own().
Definition at line 15 of file VcardWizard.h.
| using cdc::mod_vcard::VcardWizard::DoneCallback = void (*)() |
Callback fired after a successful save, before returning to the anchor view. Lets the caller refresh a list it owns.
Definition at line 31 of file VcardWizard.h.
|
static |
Configures the wizard with i18n keys. Must be called before start() or edit() so step titles can be looked up.
| titleKeys | Pointer to an array of 16 i18n keys for the wizard steps. |
| savedKey | i18n key of the "saved" toast message. |
| failedKey | i18n key of the generic "failed" toast message. |
Definition at line 238 of file VcardWizard.cpp.
References cdc::mod_vcard::s_failedKey, cdc::mod_vcard::s_savedKey, and cdc::mod_vcard::s_titleKeys.
Referenced by cdc::mod_vcard::VcardModule::init().
|
static |
Starts the wizard prefilled with the currently stored own vCard. Falls back to start() when no vCard is present.
| returnAnchor | View to pop back to once the wizard finishes. |
Definition at line 253 of file VcardWizard.cpp.
References cdc::mod_vcard::pushCurrentStep(), cdc::mod_vcard::s_wizard, VCARD_MAX_LEN, vcard_parse_to_struct(), and vcard_store_get_own().
Referenced by cdc::mod_vcard::onMainMenuSelect().
|
static |
Starts the wizard prefilled with a stored contact for editing.
| returnAnchor | View to pop back to once the wizard finishes. |
| slot | Slot index of the stored contact to edit. |
| onDone | Optional callback fired after a successful save. |
Definition at line 277 of file VcardWizard.cpp.
References cdc::mod_vcard::pushCurrentStep(), cdc::mod_vcard::RECEIVED_EDIT, cdc::mod_vcard::s_wizard, VCARD_MAX_LEN, vcard_parse_to_struct(), and vcard_store_get().
Referenced by cdc::mod_vcard::ctxReceivedEdit().
|
static |
Starts the wizard with an empty struct.
| returnAnchor | View to pop back to once the wizard finishes. |
Definition at line 245 of file VcardWizard.cpp.
References cdc::mod_vcard::pushCurrentStep(), and cdc::mod_vcard::s_wizard.
Referenced by cdc::mod_vcard::onMainMenuSelect().
|
static |
Starts the wizard to create a new stored contact (received list).
| returnAnchor | View to pop back to once the wizard finishes. |
| onDone | Optional callback fired after a successful save. |
Definition at line 267 of file VcardWizard.cpp.
References cdc::mod_vcard::pushCurrentStep(), cdc::mod_vcard::RECEIVED_NEW, and cdc::mod_vcard::s_wizard.
Referenced by cdc::mod_vcard::ctxReceivedAdd().