CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
AppUiInternal.h
Go to the documentation of this file.
1#pragma once
2
7
8#include "cdc_ui/ViewStack.h"
9#include "cdc_ui/I18n.h"
10#include "cdc_views/ListView.h"
11#include "cdc_views/ToastView.h"
12#include "cdc_views/InfoView.h"
16#include "cdc_core/EventBus.h"
17
18#include <cstdint>
19#include <goodisplay/gdey029T94.h>
20#include <Fonts/FreeMonoBold9pt7b.h>
21
22namespace cdc::ui {
23
24// ============================================================================
25// Shared Constants
26// ============================================================================
27
28static constexpr uint32_t TOAST_DURATION_SHORT_MS = 1000;
29static constexpr uint32_t TOAST_DURATION_MEDIUM_MS = 1500;
30static constexpr uint32_t TOAST_DURATION_LONG_MS = 2500;
31
32// ============================================================================
33// Shared Drawing Helpers
34// ============================================================================
35
39void drawSignalBars(Gdey029T94* gfx, int x, int y, int8_t rssi, bool inverted);
40
41// ============================================================================
42// Cross-file Menu Rebuild Functions
43// ============================================================================
44
45// Called by feature files when they need to trigger menu rebuilds
46void rebuildMainMenu();
47void rebuildToolsMenu();
48
50bool isBadgeLocked();
51
61void requestUnlockForTransfer(void (*onUnlocked)(void*), void* userData);
62
63// ============================================================================
64// Feature Sub-file Entry Points
65// ============================================================================
66
67// WiFi (WifiMenuUi.cpp)
68void showWifiMainMenu();
70
71// Bluetooth (BluetoothMenuUi.cpp)
74
75// Message transfer (MsgTransferUi.cpp)
77void msgTransferUiProcess(uint32_t nowMs);
78void showBeaconMenu(); // complete beacon flow (toggle, name, scan) under Tools
79void showMsgBeaconScan(); // read-only beacon scan, also reachable from the BT menu
80
81// Expert & Modules (ExpertMenuUi.cpp)
82void showExpertMenu();
83void showModulesView();
84void onModuleErrorEvent(const core::Event& evt);
85
86// Backup (BackupMenuUi.cpp)
87void showBackupMenu();
89
90// Duress / self-destruct PIN setup (AppUi.cpp, owns the PinChangeView instance)
92
102
103} // namespace cdc::ui
Internationalization with English fallbacks in code and overlay translations loaded at runtime from a...
Centralized key-code constants for cdc_views.
Definition IModule.h:8
void showMsgBeaconScan()
void showBeaconMenu()
void showDuressPinSetup()
Opens the duress / self-destruct PIN setup wizard.
Definition AppUi.cpp:403
void requestUnlockForTransfer(void(*onUnlocked)(void *), void *userData)
Wake the screen and start the PIN-unlock flow for a transfer accepted on the lock screen.
Definition AppUi.cpp:436
void prepareForBootloaderReset()
Puts the badge into a quiet pre-reset state.
Definition AppUi.cpp:1129
static constexpr uint32_t TOAST_DURATION_LONG_MS
void rebuildToolsMenu()
Rebuilds tools menu entries including dynamic module tools.
Definition AppUi.cpp:535
void msgTransferUiInit()
void rebuildMainMenu()
Rebuilds main menu entries including dynamically provided modules.
Definition AppUi.cpp:488
static constexpr uint32_t TOAST_DURATION_MEDIUM_MS
void showModulesView()
Shows module management list view.
void onModuleErrorEvent(const core::Event &evt)
Displays toast notification for module error events.
void showExpertMenu()
Shows expert menu and initial warning toast.
void registerBackupSerialCommand()
Registers the AUTH-gated BACKUP serial command.
void msgTransferUiProcess(uint32_t nowMs)
void showWifiMainMenu()
Shows top-level Wi-Fi menu and reloads stored configuration.
void drawSignalBars(Gdey029T94 *gfx, int x, int y, int8_t rssi, bool inverted)
Draws RSSI signal bars using the shared lock-screen visual style.
Definition AppUi.cpp:211
void showBluetoothMenu()
Shows top-level Bluetooth menu.
static constexpr uint32_t TOAST_DURATION_SHORT_MS
void rebuildBluetoothMenu()
Rebuilds Bluetooth menu entries and dynamic module items.
void rebuildWifiMainMenu()
Rebuilds top-level Wi-Fi menu items and dynamic module extensions.
bool isBadgeLocked()
Returns whether the badge is currently locked (showing lock screen with no menu above).
Definition AppUi.cpp:728
void showBackupMenu()
Shows the Backup submenu (Export / Import / Delete).