|
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 | StringResolver = const char* (*)(uint16_t offset) |
| Resolves a localized step title. | |
| 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 (StringResolver resolver, const uint16_t *titleOffsets, uint16_t savedOffset, uint16_t failedOffset) |
| Configures the wizard with i18n callbacks. 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 40 of file VcardWizard.h.
| using cdc::mod_vcard::VcardWizard::StringResolver = const char* (*)(uint16_t offset) |
Resolves a localized step title.
| baseId | The base i18n string ID of the owning module. |
| offset | Per-module string offset within the registered range. |
Definition at line 23 of file VcardWizard.h.
|
static |
Configures the wizard with i18n callbacks. Must be called before start() or edit() so step titles can be looked up.
| resolver | Function returning a translated title for a string offset. |
| titleOffsets | Pointer to an array of 16 offsets for the wizard steps. |
| savedOffset | Offset of the "saved" toast message. |
| failedOffset | Offset of the generic "failed" toast message. |
Definition at line 242 of file VcardWizard.cpp.
References cdc::mod_vcard::s_failedOffset, cdc::mod_vcard::s_resolver, cdc::mod_vcard::s_savedOffset, and cdc::mod_vcard::s_titleOffsets.
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 258 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 282 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 250 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 272 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().