Aurore
A Switch-like interface for your app, on every screen
Loading...
Searching...
No Matches
ui::hooks::Hooks Struct Reference

#include <aurore/cadran/ui/hooks.hpp>

Public Attributes

std::function< bool(aurore::Activity *activity)> is_main
 The main screen.
 
std::function< void(aurore::Activity *main, int position, const std::string &row)> open_tab
 
std::function< void(aurore::Activity *main)> update_title
 
std::function< void(int position, const std::string &row)> push_main
 A new main screen, pushed, on tab position, the focus on row.
 
std::function< void()> refresh_shown
 
std::function< std::string()> shown_screen
 
std::function< std::string()> main_screen
 
std::function< bool(aurore::View *view)> is_tab
 
std::function< int(const std::string &screen)> tab_position
 
std::function< int()> settings_tab
 
std::function< std::vector< std::string >()> rail_icons
 
std::function< std::string()> version
 
std::function< std::string()> commit
 
std::function< bool()> is_release
 
std::function< bool()> read_only
 
std::function< void(NVGcontext *vg, float w, float h)> mark
 
std::function< bool(cadran::PillMode &mode)> pill
 
std::function< std::vector< std::pair< const char *, const char * > >()> screen_icons
 
std::function< std::string(const std::string &screen)> tab_title
 
std::function< bool(aurore::View *frame)> standalone_screen
 
std::function< std::string()> today
 
std::function< std::string()> themes_dir
 
std::function< bool()> save_prefs
 
std::function< void()> send_report
 Send a report, offered by a failure's dialog. Unset: not offered.
 
std::function< bool(const char *name)> env_flag
 

Detailed Description

What Cadran asks of the app, filled in once at start-up (get()). Each hook left empty does nothing.

Member Data Documentation

◆ commit

std::function<std::string()> ui::hooks::Hooks::commit

◆ env_flag

std::function<bool(const char* name)> ui::hooks::Hooks::env_flag

A flag of the app's environment, for its tests (name: "STILL_FOCUS", "CADRAN_NOGLOW", "FOCUS_LOG", "CUT_TEXT", "DOCKED", "BATTERY"). Unset: the process environment's AURORE_<name> ("1", "true" or "yes"), in a build with AURORE_DEV_TOOLS (not a release one, by default), never on the console.

◆ is_main

std::function<bool(aurore::Activity* activity)> ui::hooks::Hooks::is_main

The main screen.

activity is it

◆ is_release

std::function<bool()> ui::hooks::Hooks::is_release

◆ is_tab

std::function<bool(aurore::View* view)> ui::hooks::Hooks::is_tab

◆ main_screen

std::function<std::string()> ui::hooks::Hooks::main_screen

◆ mark

std::function<void(NVGcontext* vg, float w, float h)> ui::hooks::Hooks::mark

The app's logo, drawn in a w Ă— h box at (0, 0) (CadranIcon "mark": the header's, the about screen's). Unset: Aurore's.

◆ open_tab

std::function<void(aurore::Activity* main, int position, const std::string& row)> ui::hooks::Hooks::open_tab

◆ pill

std::function<bool(cadran::PillMode& mode)> ui::hooks::Hooks::pill

A mode of the app the main screen's pill says over every screen: fills mode in and returns true while it lasts (parental controls paused, unlocked…). Unset or false: the screen's own words, or read-only.

◆ push_main

std::function<void(int position, const std::string& row)> ui::hooks::Hooks::push_main

A new main screen, pushed, on tab position, the focus on row.

◆ rail_icons

std::function<std::vector<std::string>()> ui::hooks::Hooks::rail_icons

The rail's icons (cadran/view/cadran_icon), one per sidebar position, "" for a separator.

◆ read_only

std::function<bool()> ui::hooks::Hooks::read_only

◆ refresh_shown

std::function<void()> ui::hooks::Hooks::refresh_shown

The tabs: re-read the one shown, the name of the screen shown and of the main screen's tab ("tab/about"), and whether a view is a tab.

◆ save_prefs

std::function<bool()> ui::hooks::Hooks::save_prefs

Saves ui::prefs() (the language, theme, text size and effects chosen): false when it cannot be saved at all. Unset: the choice lasts until the app quits.

◆ screen_icons

std::function<std::vector<std::pair<const char*, const char*> >()> ui::hooks::Hooks::screen_icons

The icons of the lines of the app's own screens that Cadran dresses (a DetailCell's id, a CadranIcon's name), besides Aurore's.

◆ send_report

std::function<void()> ui::hooks::Hooks::send_report

Send a report, offered by a failure's dialog. Unset: not offered.

◆ settings_tab

std::function<int()> ui::hooks::Hooks::settings_tab

◆ shown_screen

std::function<std::string()> ui::hooks::Hooks::shown_screen

◆ standalone_screen

std::function<bool(aurore::View* frame)> ui::hooks::Hooks::standalone_screen

Whether frame (a screen's root view) is a screen of its own, not a step from the one under it: a child's screen, a lock screen. It gets no crumb and no version badge (cadran::is_standalone_screen). Unset: the screens holding a view with the id "cadran/standalone".

◆ tab_position

std::function<int(const std::string& screen)> ui::hooks::Hooks::tab_position

The sidebar position of the tab whose screen name is screen, -1 when there is none; and the position to fall back on.

◆ tab_title

std::function<std::string(const std::string& screen)> ui::hooks::Hooks::tab_title

The title of the main screen's tab screen ("tab/about"), for the crumb of a screen opened from it. Unset: none.

◆ themes_dir

std::function<std::string()> ui::hooks::Hooks::themes_dir

The folder of the user's own theme files (*.theme, docs/themes.md), listed by the theme picker after Aurore's presets: the app's, such as "sdmc:/config/<app>/themes". Unset: the presets only.

◆ today

std::function<std::string()> ui::hooks::Hooks::today

Today, "2026-10-08", by the app's own clock (the console's user clock). Unset: the system's local date.

◆ update_title

std::function<void(aurore::Activity* main)> ui::hooks::Hooks::update_title

◆ version

std::function<std::string()> ui::hooks::Hooks::version

The app: its version and commit (the header's badge), whether it is a release, and whether it writes nothing for now (a read-only mode: the header's pill says so).


The documentation for this struct was generated from the following file: