Copyable weak UI-affine semantic handle; the scene owns all queue, action and timer storage. Construction may allocate. A cold/closed handle returns CLOSED; a removed original center returns STALE_NODE and never retargets a replacement. Commands report once through the existing collector. Checked adoption preserves prior state while its owner and services remain live. Independent removal, host shutdown or the existing diagnostic STOP policy can cancel registrations; commands never revive stopped services. A later presentation failure retains admitted data and follows the existing STOP policy.
More...
#include <toast.hpp>
|
|
| NotificationCenter () |
| | Construct an unpublished observing handle on the UI thread; may allocate.
|
| std::expected< ToastPostReceipt, ManagedError > | post (const ToastMessage &message, std::source_location origin=std::source_location::current()) const |
| DialogCommandResult | show (const ToastMessage &message, std::source_location origin=std::source_location::current()) const |
| DialogCommandResult | show (const TextValue &text, std::source_location origin=std::source_location::current()) const |
| DialogCommandResult | show (std::string_view text, std::source_location origin=std::source_location::current()) const |
| DialogCommandResult | dismiss (ToastId id, std::source_location origin=std::source_location::current()) const |
| DialogCommandResult | dismissLatest (std::source_location origin=std::source_location::current()) const |
| DialogCommandResult | activate (ToastId id, std::source_location origin=std::source_location::current()) const |
| DialogCommandResult | activateLatest (std::source_location origin=std::source_location::current()) const |
| DialogCommandResult | clear (std::source_location origin=std::source_location::current()) const |
| DialogCommandResult | setVisible (bool visible, std::source_location origin=std::source_location::current()) const |
| DialogCommandResult | setReducedMotion (bool reduced, std::source_location origin=std::source_location::current()) const |
| std::expected< std::shared_ptr< const NotificationSnapshot >, ManagedError > | snapshot () const |
|
|
struct | detail::NotificationAccess |
Copyable weak UI-affine semantic handle; the scene owns all queue, action and timer storage. Construction may allocate. A cold/closed handle returns CLOSED; a removed original center returns STALE_NODE and never retargets a replacement. Commands report once through the existing collector. Checked adoption preserves prior state while its owner and services remain live. Independent removal, host shutdown or the existing diagnostic STOP policy can cancel registrations; commands never revive stopped services. A later presentation failure retains admitted data and follows the existing STOP policy.
◆ activate()
| DialogCommandResult portals::ui::NotificationCenter::activate |
( |
ToastId | id, |
|
|
std::source_location | origin = std::source_location::current() ) const |
- Parameters
-
| id | Original action identity. |
| origin | Public call site. |
- Returns
- Checked once-only admission; no automatic retry.
◆ activateLatest()
| DialogCommandResult portals::ui::NotificationCenter::activateLatest |
( |
std::source_location | origin = std::source_location::current() | ) |
const |
- Parameters
-
- Returns
- Success, including no eligible action.
◆ clear()
| DialogCommandResult portals::ui::NotificationCenter::clear |
( |
std::source_location | origin = std::source_location::current() | ) |
const |
- Parameters
-
- Returns
- Checked clear without semantic callbacks.
◆ dismiss()
| DialogCommandResult portals::ui::NotificationCenter::dismiss |
( |
ToastId | id, |
|
|
std::source_location | origin = std::source_location::current() ) const |
- Parameters
-
| id | Original identity; foreign centers return WRONG_SESSION. |
| origin | Public call site. |
- Returns
- Checked removal.
◆ dismissLatest()
| DialogCommandResult portals::ui::NotificationCenter::dismissLatest |
( |
std::source_location | origin = std::source_location::current() | ) |
const |
- Parameters
-
- Returns
- Success, including no eligible notification.
◆ post()
- Parameters
-
| message | Owning UI request borrowed only during this call; retained data and the callable are copied before adoption. |
| origin | Public call site. |
- Returns
- Exact checked receipt or full error; technical errors are reported once to a surviving collector. Pre-adoption allocation, text, style and timer failures preserve the old queue, identities and timer. Explicit policy drops are successful DROPPED receipts. Direct worker calls return WRONG_THREAD.
◆ setReducedMotion()
| DialogCommandResult portals::ui::NotificationCenter::setReducedMotion |
( |
bool | reduced, |
|
|
std::source_location | origin = std::source_location::current() ) const |
- Parameters
-
| reduced | Disable effects while retaining static content. |
| origin | Public call site. |
- Returns
- Checked change or equal no-op.
◆ setVisible()
| DialogCommandResult portals::ui::NotificationCenter::setVisible |
( |
bool | visible, |
|
|
std::source_location | origin = std::source_location::current() ) const |
- Parameters
-
| visible | Explicit center visibility; hide cancels timers immediately. |
| origin | Public call site. |
- Returns
- Checked change or equal no-op.
◆ show() [1/3]
| DialogCommandResult portals::ui::NotificationCenter::show |
( |
const TextValue & | text, |
|
|
std::source_location | origin = std::source_location::current() ) const |
- Parameters
-
| text | Owning expression. |
| origin | Public call site. |
- Returns
- Checked short result.
◆ show() [2/3]
| DialogCommandResult portals::ui::NotificationCenter::show |
( |
const ToastMessage & | message, |
|
|
std::source_location | origin = std::source_location::current() ) const |
- Parameters
-
| message | Owning request borrowed for synchronous adoption. |
| origin | Public call site. |
- Returns
- Checked short result, discarding the policy receipt; ignored DROPPED is intentionally silent.
◆ show() [3/3]
| DialogCommandResult portals::ui::NotificationCenter::show |
( |
std::string_view | text, |
|
|
std::source_location | origin = std::source_location::current() ) const |
- Parameters
-
| text | Bytes copied immediately. |
| origin | Public call site. |
- Returns
- Checked short result.
◆ snapshot()
- Returns
- Independent owning observation or exact error; never reports, lays out or mutates UI.
The documentation for this class was generated from the following file: