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
52// ============================================================================
53// Feature Sub-file Entry Points
54// ============================================================================
55
56// WiFi (WifiMenuUi.cpp)
57void showWifiMainMenu();
59
60// Bluetooth (BluetoothMenuUi.cpp)
63
64// Message transfer (MsgTransferUi.cpp)
66void msgTransferUiProcess(uint32_t nowMs);
67void showBeaconMenu(); // complete beacon flow (toggle, name, scan) under Tools
68void showMsgBeaconScan(); // read-only beacon scan, also reachable from the BT menu
69
70// Expert & Modules (ExpertMenuUi.cpp)
71void showExpertMenu();
72void showModulesView();
73void onModuleErrorEvent(const core::Event& evt);
74
75// Backup (BackupMenuUi.cpp)
76void showBackupMenu();
78
79// Duress / self-destruct PIN setup (AppUi.cpp, owns the PinChangeView instance)
81
91
92} // 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:389
void prepareForBootloaderReset()
Puts the badge into a quiet pre-reset state.
Definition AppUi.cpp:1052
static constexpr uint32_t TOAST_DURATION_LONG_MS
void rebuildToolsMenu()
Rebuilds tools menu entries including dynamic module tools.
Definition AppUi.cpp:496
void msgTransferUiInit()
void rebuildMainMenu()
Rebuilds main menu entries including dynamically provided modules.
Definition AppUi.cpp:449
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:199
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:689
void showBackupMenu()
Shows the Backup submenu (Export / Import / Delete).