CArcNotificationManager
- Module
- Arc
- Header
#include "Arc/Framework/CArcPopupSystems.h"- Namespace
Arcf
Properties
| Type | Name | Description |
|---|---|---|
static constexpr size_t | MaxVisible | Default 5. |
static constexpr size_t | kHistoryLimit | Default 100. |
static constexpr float | kAutoDismissSeconds | Default 5.0f. |
static constexpr float | kStackGap | Default 8.0f. |
static constexpr float | kMoreHeight | Default 24.0f. |
Public functions
| Returns | Name | Description |
|---|---|---|
CArcNotificationManager& | Get | |
void | Push | |
void | Push | |
void | Tick | |
void | Dismiss | |
void | DismissAll | |
bool | InvokeAction | What a click at a card's action buttons does: runs the callback and, unless it is a running progress card's Cancel, dismisses the card first. |
bool | IsRunningProgress | A card whose task is still running: a Progress callback answering [0, 1). |
const char* | ActionComponent | The export's component for a toast's first or second action: "button-secondary" then "button-ghost", except a restart toast's first, "button-restart" (Warning fill, OnAccent text). |
const std::vector<CArcActiveNotification>& | GetActive | |
size_t | GetActiveCount | |
const std::vector<FArcNotificationRecord>& | GetHistory | Every toast pushed this session, oldest first (the bell's history flyout), capped at kHistoryLimit. |
int32_t | GetUnreadCount | |
bool | HasUnreadError | The bell's badge turns Error while an error toast is unread. |
void | MarkAllRead | |
void | ClearHistory | |
float | DefaultLifetime | The timer a toast of this type starts with when the caller sets no duration: 5 s for info and success, none (negative) for the rest. |
void | Reset | Ordered shutdown hook — see CArcWidgetReflectorManager::Reset. |
FToastHotState& | GetHotState | |
void | SetHostArea | The area the stack uses in the host's main window. |
const FToastArea& | GetHostArea | |
FToastArea | AreaAboveChrome | The toast area of a window whose bottom carries statusBar (empty when it has none) and, above that in the same corner, cornerPanel (empty while hidden), under topChrome (the title bar and toolbar; empty when none). |
void | ArrangeStack | Lays the cards out bottom-up from the area's corner, oldest lowest, so a new card never moves the ones already up. |
size_t | GetHiddenCount | Cards folded into the "+N more" line by the last ArrangeStack, and that line's distance from the window bottom to its top. |
float | GetMoreOffset |
Function details
Get
static CArcNotificationManager& Get()Push
void Push(const CArcNotificationInfo& info)Push
void Push(const CText& title, ENotificationType type, const CText& body = CText::GetEmpty(), float lifetime = 0.0f)Tick
void Tick(float deltaTime)Dismiss
void Dismiss(size_t index)DismissAll
void DismissAll()InvokeAction
bool InvokeAction(size_t index, bool secondary)What a click at a card's action buttons does: runs the callback and, unless it is a running progress card's Cancel, dismisses the card first. secondary picks the second button. False when the card has no such button.
IsRunningProgress
static bool IsRunningProgress(const CArcNotificationInfo& info)A card whose task is still running: a Progress callback answering [0, 1). Such a card cannot be dismissed by clicking it; its secondary button is the Cancel.
ActionComponent
static const char* ActionComponent(ENotificationType type, bool first)The export's component for a toast's first or second action: "button-secondary" then "button-ghost", except a restart toast's first, "button-restart" (Warning fill, OnAccent text).
GetActive
const std::vector<CArcActiveNotification>& GetActive() constGetActiveCount
size_t GetActiveCount() constGetHistory
const std::vector<FArcNotificationRecord>& GetHistory() constEvery toast pushed this session, oldest first (the bell's history flyout), capped at kHistoryLimit.
GetUnreadCount
int32_t GetUnreadCount() constHasUnreadError
bool HasUnreadError() constThe bell's badge turns Error while an error toast is unread.
MarkAllRead
void MarkAllRead()ClearHistory
void ClearHistory()DefaultLifetime
static float DefaultLifetime(ENotificationType type)The timer a toast of this type starts with when the caller sets no duration: 5 s for info and success, none (negative) for the rest.
Reset
void Reset()Ordered shutdown hook — see CArcWidgetReflectorManager::Reset.
GetHotState
FToastHotState& GetHotState()SetHostArea
void SetHostArea(const FToastArea& area)The area the stack uses in the host's main window. A host with chrome along the bottom (the editor's status bar and its Background tasks list) sets it from that chrome's arranged rects through AreaAboveChrome, every frame, so the stack follows the chrome rather than a guess at it. Every other window — toasts follow focus — uses the default 16 px corner.
GetHostArea
const FToastArea& GetHostArea() constAreaAboveChrome
static FToastArea AreaAboveChrome(float windowHeight, const ArcRect& statusBar, const ArcRect& cornerPanel, const ArcRect& topChrome, float margin)The toast area of a window whose bottom carries statusBar (empty when it has none) and, above that in the same corner, cornerPanel (empty while hidden), under topChrome (the title bar and toolbar; empty when none). Rects are window-local; margin is the gap kept from each of them and from the right edge.
ArrangeStack
void ArrangeStack(const std::vector<float>& cardHeights, float windowHeight, const FToastArea& area, float deltaTime, bool snap)Lays the cards out bottom-up from the area's corner, oldest lowest, so a new card never moves the ones already up. cardHeights is one height per active card. What does not fit between the corner and area.Top (or past MaxVisible) folds, oldest first, into a "+N more" line at the bottom: the newest card is always shown. Each card's StackOffset eases toward its slot over deltaTime; snap places every card at once (a different window took the stack).
GetHiddenCount
size_t GetHiddenCount() constCards folded into the "+N more" line by the last ArrangeStack, and that line's distance from the window bottom to its top.
GetMoreOffset
float GetMoreOffset() const