|
CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
|
#include <QRCodeView.h>
Public Member Functions | |
| void | init (const char *data, const char *title=nullptr, const char *subtitle=nullptr) |
| Initializes QR code content and layout state. | |
| void | setHint (const char *hint) |
| void | render (bool partial) override |
| Renders the complete QR code view. | |
| InputResult | onKey (char key) override |
| Handles key input by closing the QR view. | |
| const char * | getName () const override |
| const char * | getFooterHint () const override |
| Returns footer hint text. | |
| Public Member Functions inherited from cdc::ui::ViewBase | |
| virtual | ~ViewBase ()=default |
| void | onEnter (void *context) override |
| void | onExit () override |
| void | onResume () override |
| void | onPause () override |
| void | setLifecycleHooks (void(*onHide)(void *), void(*onShow)(void *), void *userData) override |
| bool | needsRender () const override |
| void | markDirty () override |
| void | clearDirty () override |
| void | setFooterHint (const char *hint) override |
| const char * | getFooterHint () const override |
| Public Member Functions inherited from cdc::ui::IView | |
| virtual | ~IView ()=default |
| virtual bool | prefersLightRefresh () const |
| virtual InputResult | onLongPress (char key) |
| virtual void | onTick (uint32_t nowMs) |
Additional Inherited Members | |
| Protected Member Functions inherited from cdc::ui::ViewBase | |
| void | setTitle (const char *title) |
| const char * | getTitle () const |
| Protected Attributes inherited from cdc::ui::ViewBase | |
| bool | dirty_ = true |
| const char * | title_ = nullptr |
| const char * | customFooter_ = nullptr |
| void(* | onHide_ )(void *) = nullptr |
| void(* | onShow_ )(void *) = nullptr |
| void * | lifecycleUserData_ = nullptr |
QRCodeView - Display QR codes with optional title/subtitle
Renders QR code on the left side of the display, maximizing size. Title and subtitle displayed on the right side.
Uses two-pass rendering:
Keys: Any = Back (close view)
Definition at line 21 of file QRCodeView.h.
|
overridevirtual |
Returns footer hint text.
Reimplemented from cdc::ui::IView.
Definition at line 118 of file QRCodeView.cpp.
References cdc::ui::tr().
|
inlineoverridevirtual |
| void cdc::ui::QRCodeView::init | ( | const char * | data, |
| const char * | title = nullptr, | ||
| const char * | subtitle = nullptr ) |
Initializes QR code content and layout state.
Initialize QR code view
| data | Data to encode in QR code |
| title | Optional title (displayed right of QR) |
| subtitle | Optional subtitle (displayed below title) |
| data | QR payload text. |
| title | Optional title text. |
| subtitle | Optional subtitle text. |
Definition at line 87 of file QRCodeView.cpp.
References cdc::ui::ViewBase::dirty_, LOG_D, and cdc::ui::TAG.
|
overridevirtual |
Handles key input by closing the QR view.
| key | Pressed key code. |
Implements cdc::ui::IView.
Definition at line 107 of file QRCodeView.cpp.
References cdc::ui::CONSUMED, and cdc::ui::REQUEST_POP.
|
overridevirtual |
Renders the complete QR code view.
| partial | Indicates partial/full redraw mode. |
Implements cdc::ui::IView.
Definition at line 304 of file QRCodeView.cpp.
References cdc::ui::ViewBase::dirty_, cdc::ui::display, cdc::hal::getDisplayInstance(), cdc::ui::render::printText(), and cdc::ui::tr().
|
inline |
Set hint text for footer
Definition at line 34 of file QRCodeView.h.