CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
VcardWizard.cpp File Reference
#include "mod_vcard/VcardWizard.h"
#include "mod_vcard/vcard_store.h"
#include "cdc_ui/I18n.h"
#include "cdc_ui/ViewStack.h"
#include "cdc_views/T9InputView.h"
#include "cdc_views/ToastView.h"
#include "cdc_log.h"
#include "esp_attr.h"
#include <cstdio>
#include <cstring>

Go to the source code of this file.

Classes

struct  cdc::mod_vcard::FieldRef
 Maps a step ID to the matching field inside vcard_data_t. More...
struct  cdc::mod_vcard::WizardState
 Holds the wizard's running state between callback firings. More...

Namespaces

namespace  cdc
namespace  cdc::mod_vcard

Enumerations

enum  cdc::mod_vcard::WizardStepId : uint8_t {
  cdc::mod_vcard::STEP_GIVEN = 0 , cdc::mod_vcard::STEP_FAMILY , cdc::mod_vcard::STEP_FORMATTED , cdc::mod_vcard::STEP_ORG ,
  cdc::mod_vcard::STEP_TITLE , cdc::mod_vcard::STEP_EMAIL , cdc::mod_vcard::STEP_TEL_CELL , cdc::mod_vcard::STEP_TEL_HOME ,
  cdc::mod_vcard::STEP_TEL_WORK , cdc::mod_vcard::STEP_URL , cdc::mod_vcard::STEP_TELEGRAM , cdc::mod_vcard::STEP_SIGNAL ,
  cdc::mod_vcard::STEP_MATRIX , cdc::mod_vcard::STEP_THREEMA , cdc::mod_vcard::STEP_SOCIAL , cdc::mod_vcard::STEP_NOTE ,
  cdc::mod_vcard::STEP_COUNT
}
 Step indices into the wizard's title offset table. Order must match s_steps[] below. More...
enum class  cdc::mod_vcard::WizardTarget : uint8_t { cdc::mod_vcard::OWN = 0 , cdc::mod_vcard::RECEIVED_NEW , cdc::mod_vcard::RECEIVED_EDIT }
 Save destination for the wizard's generated vCard. More...

Functions

static char * cdc::mod_vcard::fGiven (vcard_data_t *d)
static char * cdc::mod_vcard::fFamily (vcard_data_t *d)
static char * cdc::mod_vcard::fFn (vcard_data_t *d)
static char * cdc::mod_vcard::fOrg (vcard_data_t *d)
static char * cdc::mod_vcard::fTitle (vcard_data_t *d)
static char * cdc::mod_vcard::fEmail (vcard_data_t *d)
static char * cdc::mod_vcard::fCell (vcard_data_t *d)
static char * cdc::mod_vcard::fHome (vcard_data_t *d)
static char * cdc::mod_vcard::fWork (vcard_data_t *d)
static char * cdc::mod_vcard::fUrl (vcard_data_t *d)
static char * cdc::mod_vcard::fTele (vcard_data_t *d)
static char * cdc::mod_vcard::fSig (vcard_data_t *d)
static char * cdc::mod_vcard::fMatrix (vcard_data_t *d)
static char * cdc::mod_vcard::fThreema (vcard_data_t *d)
static char * cdc::mod_vcard::fSocial (vcard_data_t *d)
static char * cdc::mod_vcard::fNote (vcard_data_t *d)
static const char * cdc::mod_vcard::stepTitle (uint8_t step)
 Returns the localized title for a wizard step via the configured resolver.
static void cdc::mod_vcard::onStepSave (const char *text)
 Forward declaration of the single per-step save handler.
static void cdc::mod_vcard::pushCurrentStep ()
 Pushes the T9 input view for the current wizard step. Prefills the input with the current field value (which may have been seeded from a pre-existing vCard in edit mode, or auto-suggested for FN).
static void cdc::mod_vcard::wizardFinish ()
 Persists wizard data and returns to the anchor view on success.

Variables

static const char * TAG = "VCARD_WIZ"
static const FieldRef cdc::mod_vcard::k_steps [STEP_COUNT]
 Step descriptor table. Step order is fixed at compile time. The maximum input length for each step is clamped to the smaller of the struct field size and the T9 input view's text limit.
static WizardState cdc::mod_vcard::s_wizard = {}
static ui::T9InputView cdc::mod_vcard::s_t9Input
static VcardWizard::StringResolver cdc::mod_vcard::s_resolver = nullptr
static const uint16_t * cdc::mod_vcard::s_titleOffsets = nullptr
static uint16_t cdc::mod_vcard::s_savedOffset = 0
static uint16_t cdc::mod_vcard::s_failedOffset = 0

Variable Documentation

◆ TAG

const char* TAG = "VCARD_WIZ"
static

Definition at line 14 of file VcardWizard.cpp.