CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
VcardWizard.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4
5#include "cdc_ui/IView.h"
6
7namespace cdc::mod_vcard {
8
16public:
23 using StringResolver = const char* (*)(uint16_t offset);
24
33 static void configure(StringResolver resolver, const uint16_t* titleOffsets,
34 uint16_t savedOffset, uint16_t failedOffset);
35
40 using DoneCallback = void (*)();
41
46 static void start(ui::IView* returnAnchor);
47
53 static void edit(ui::IView* returnAnchor);
54
60 static void startReceived(ui::IView* returnAnchor, DoneCallback onDone);
61
68 static void editReceived(ui::IView* returnAnchor, uint16_t slot, DoneCallback onDone);
69};
70
71} // namespace cdc::mod_vcard
Wizard for creating or editing the device owner's vCard via the GUI.
Definition VcardWizard.h:15
static void start(ui::IView *returnAnchor)
Starts the wizard with an empty struct.
static void editReceived(ui::IView *returnAnchor, uint16_t slot, DoneCallback onDone)
Starts the wizard prefilled with a stored contact for editing.
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...
static void startReceived(ui::IView *returnAnchor, DoneCallback onDone)
Starts the wizard to create a new stored contact (received list).
void(*)() DoneCallback
Callback fired after a successful save, before returning to the anchor view. Lets the caller refresh ...
Definition VcardWizard.h:40
static void edit(ui::IView *returnAnchor)
Starts the wizard prefilled with the currently stored own vCard. Falls back to start() when no vCard ...
const char *(*)(uint16_t offset) StringResolver
Resolves a localized step title.
Definition VcardWizard.h:23