morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::ui::testing::detail::FakeBanner Class Referencefinal

A fake BannerWidget: properties tone, text, actionLabel, dismissible. More...

#include <recording_backend.hpp>

Inheritance diagram for morph::ui::testing::detail::FakeBanner:
morph::ui::testing::detail::FakeLeaf< BannerWidget > morph::ui::BannerWidget morph::ui::Widget

Public Member Functions

void setTone (Tone tone) override
 Sets what the message conveys.
void setText (std::string_view text) override
 Replaces the message.
void setActionLabel (std::string_view label) override
 Replaces the action button's caption.
void setOnAction (Action onAction) override
 Sets what activating the action button calls.
void setDismissible (bool dismissible) override
 Sets whether the user can dismiss the banner; called once, before the banner is shown.
void setOnDismiss (Action onDismiss) override
 Sets what a dismissal calls. A dismissal leaves the banner shown: the application hides it.
Public Member Functions inherited from morph::ui::testing::detail::FakeLeaf< BannerWidget >
 FakeLeaf (std::shared_ptr< RecordStore > store, std::string kind, ContainerWidget const *parent, PropList initial={})
 Records the new widget, appended to parent, and logs its creation.
 ~FakeLeaf () override
 Forgets the widget and logs its destruction; its remaining children become roots.
FakeLeaf & operator= (FakeLeaf const &)=delete
void setVisible (bool visible) override
 Records property visible.
void setEnabled (bool enabled) override
 Records property enabled.
void setLayout (LayoutHints const &hints) override
 Records property layout, as formatLayout gives it.
void setDragKey (std::optional< Key > const &key) override
 Records property dragKey and keeps the key for RecordingBackend::drag.
void setDropHandler (std::function< bool(Key const &)> accepts, std::function< void(Key)> onDrop) override
 Records property drop=handler and keeps both handlers for RecordingBackend::drag.
void setAccessibleName (std::string_view name) override
 Records property a11yName.
void setAccessibleRole (std::string_view role) override
 Records property a11yRole.
void setTestId (std::string_view testId) override
 Records property testId.
void setTooltip (std::string_view text) override
 Records property tooltip.
void setSurface (std::string_view surface) override
 Records property surface.
void setKeys (std::vector< std::string > const &chords, std::function< void(std::string)> onChord) override
 Records property keys, the chords joined by commas, and keeps the chords and the handler for RecordingBackend::press.
void focus () override
 Moves the backend's recorded focus here, and logs focus.
void setOnHover (std::function< void()> onHover) override
 Keeps the handler for RecordingBackend::hover.
Public Member Functions inherited from morph::ui::Widget
 Widget (Widget const &)=delete
Widget & operator= (Widget const &)=delete
 Widget (Widget &&)=delete
Widget & operator= (Widget &&)=delete

Additional Inherited Members

Protected Member Functions inherited from morph::ui::testing::detail::FakeLeaf< BannerWidget >
void set (std::string_view name, std::string value)
 Records a property set through a setter.
Callbacks & callbacks ()
 This widget's handlers.
RecordStore & store () const noexcept
 The store this widget records into.
std::shared_ptr< RecordStore > const & sharedStore () const noexcept
 The store, shared: what a part this widget makes (an overlay's footer) records into.
int id () const noexcept
 This widget's id.

Detailed Description

A fake BannerWidget: properties tone, text, actionLabel, dismissible.

Definition at line 1188 of file recording_backend.hpp.

Member Function Documentation

◆ setTone()

void morph::ui::testing::detail::FakeBanner::setTone ( Tone tone)
inlineoverridevirtual

Sets what the message conveys.

Parameters
toneThe tone, mapped to the backend's theme.

Implements morph::ui::BannerWidget.

Definition at line 1191 of file recording_backend.hpp.

◆ setText()

void morph::ui::testing::detail::FakeBanner::setText ( std::string_view text)
inlineoverridevirtual

Replaces the message.

Parameters
textThe message, UTF-8.

Implements morph::ui::BannerWidget.

Definition at line 1192 of file recording_backend.hpp.

◆ setActionLabel()

void morph::ui::testing::detail::FakeBanner::setActionLabel ( std::string_view label)
inlineoverridevirtual

Replaces the action button's caption.

Parameters
labelThe caption, UTF-8; empty shows no button.

Implements morph::ui::BannerWidget.

Definition at line 1193 of file recording_backend.hpp.

◆ setOnAction()

void morph::ui::testing::detail::FakeBanner::setOnAction ( Action onAction)
inlineoverridevirtual

Sets what activating the action button calls.

Parameters
onActionThe handler; empty does nothing.

Implements morph::ui::BannerWidget.

Definition at line 1194 of file recording_backend.hpp.

◆ setDismissible()

void morph::ui::testing::detail::FakeBanner::setDismissible ( bool dismissible)
inlineoverridevirtual

Sets whether the user can dismiss the banner; called once, before the banner is shown.

Parameters
dismissibleWhether to offer the dismissal.

Implements morph::ui::BannerWidget.

Definition at line 1195 of file recording_backend.hpp.

◆ setOnDismiss()

void morph::ui::testing::detail::FakeBanner::setOnDismiss ( Action onDismiss)
inlineoverridevirtual

Sets what a dismissal calls. A dismissal leaves the banner shown: the application hides it.

Parameters
onDismissThe handler; empty does nothing.

Implements morph::ui::BannerWidget.

Definition at line 1196 of file recording_backend.hpp.


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