WindowNotificationManager
struct · ferroui-controls · v0.5.0
struct WindowNotificationManager
An INotificationManager that displays notifications in a window.
Members
TYPEto_refposition_propertymax_items_propertyconstructnewwith_hostpositionset_positionmax_itemsset_max_itemsshowshow_contentshow_withcloseclose_contentclose_allas_managed_notification_manageras_notification_manager
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<WindowNotificationManager>
Returns a strong reference to this object.
position_property
fn position_property() -> &'static StyledProperty<NotificationPosition>
Defines the Position property.
max_items_property
fn max_items_property() -> &'static StyledProperty<i32>
Defines the MaxItems property.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
Creates a notification manager that is not hosted yet.
with_host
fn with_host(host: Option<&Ref<TopLevel>>) -> Ref<Self>
Creates a notification manager hosted by host: the top-level that
will host the control.
position
fn position(self: &Self) -> NotificationPosition
Defines which corner of the screen notifications can be displayed in.
set_position
fn set_position(self: &Self, value: NotificationPosition)
max_items
fn max_items(self: &Self) -> i32
Defines the maximum number of notifications visible at once.
set_max_items
fn set_max_items(self: &Self, value: i32)
show
fn show(self: &Self, content: Rc<dyn INotification>)
Shows a notification.
show_content
fn show_content(self: &Self, content: BoxedValue)
Shows a notification with the given content: a notification, or any other content, which is shown as information.
show_with
fn show_with(self: &Self, content: BoxedValue, type_: NotificationType, expiration: Option<Duration>, on_click: Option<Rc<dyn Fn() -> ()>>, on_close: Option<Rc<dyn Fn() -> ()>>, classes: Option<&[&str]>)
Shows a notification.
content: the content of the notification.type_: the type of the notification.expiration: the expiration time of the notification after which it will automatically close (five seconds whenNone). If the value is zero then the notification will remain open until the user closes it.on_click: an action to be run when the notification is clicked.on_close: an action to be run when the notification is closed.classes: style classes to apply.
close
fn close(self: &Self, notification: &Rc<dyn INotification>)
Closes a notification.
close_content
fn close_content(self: &Self, content: &BoxedValue)
Closes the notifications with the given content.
close_all
fn close_all(self: &Self)
Closes all notifications.
as_managed_notification_manager
fn as_managed_notification_manager(self: &Self) -> Rc<dyn IManagedNotificationManager>
The manager as the contract of managed notification managers.
as_notification_manager
fn as_notification_manager(self: &Self) -> Rc<dyn INotificationManager>
The manager as the contract of notification managers.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeTemplatedControlImplExtControlImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherDerefUpcast<T>Upcast<WindowNotificationManager>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleStyledElementImplLayoutableImplInteractiveImplInputElementImplControlImplFerroObjectImplVisualImplTemplatedControlImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.