Struct gio::Notification[][src]

pub struct Notification(_);
Expand description

Notification is a mechanism for creating a notification to be shown to the user – typically as a pop-up notification presented by the desktop environment shell.

The key difference between Notification and other similar APIs is that, if supported by the desktop environment, notifications sent with Notification will persist after the application has exited, and even across system reboots.

Since the user may click on a notification while the application is not running, applications using Notification should be able to be started as a D-Bus service, using Application.

User interaction with a notification (either the default action, or buttons) must be associated with actions on the application (ie: “app.” actions). It is not possible to route user interaction through the notification itself, because the object will not exist if the application is autostarted as a result of a notification being clicked.

A notification can be sent with ApplicationExt::send_notification().

Implements

glib::ObjectExt

Implementations

Creates a new Notification with title as its title.

After populating notification with more details, it can be sent to the desktop shell with ApplicationExt::send_notification(). Changing any properties after this call will not have any effect until resending notification.

title

the title of the notification

Returns

a new Notification instance

Adds a button to self that activates the action in detailed_action when clicked. That action must be an application-wide action (starting with “app.”). If detailed_action contains a target, the action will be activated with that target as its parameter.

See Action::parse_detailed_name() for a description of the format for detailed_action.

label

label of the button

detailed_action

a detailed action name

Adds a button to self that activates action when clicked. action must be an application-wide action (it must start with “app.”).

If target is non-None, action will be activated with target as its parameter.

label

label of the button

action

an action name

target

a glib::Variant to use as action’s parameter, or None

Sets the body of self to body.

body

the new body for self, or None

Sets the default action of self to detailed_action. This action is activated when the notification is clicked on.

The action in detailed_action must be an application-wide action (it must start with “app.”). If detailed_action contains a target, the given action will be activated with that target as its parameter. See Action::parse_detailed_name() for a description of the format for detailed_action.

When no default action is set, the application that the notification was sent on is activated.

detailed_action

a detailed action name

Sets the default action of self to action. This action is activated when the notification is clicked on. It must be an application-wide action (start with “app.”).

If target is non-None, action will be activated with target as its parameter.

When no default action is set, the application that the notification was sent on is activated.

action

an action name

target

a glib::Variant to use as action’s parameter, or None

Sets the icon of self to icon.

icon

the icon to be shown in self, as a Icon

Sets the priority of self to priority. See NotificationPriority for possible values.

priority

a NotificationPriority

Sets the title of self to title.

title

the new title for self

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Returns the type identifier of Self.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Upcasts an object to a superclass or interface T. Read more

Upcasts an object to a reference of its superclass or interface T. Read more

Tries to downcast to a subclass or interface implementor T. Read more

Tries to downcast to a reference of its subclass or interface implementor T. Read more

Tries to cast to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while downcast and upcast will do many checks at compile-time already. Read more

Tries to cast to reference to an object of type T. This handles upcasting, downcasting and casting between interface and interface implementors. All checks are performed at runtime, while downcast and upcast will do many checks at compile-time already. Read more

Casts to T unconditionally. Read more

Casts to &T unconditionally. Read more

Performs the conversion.

Performs the conversion.

Returns true if the object is an instance of (can be cast to) T.

Safety Read more

Safety Read more

Safety Read more

Safety Read more

Safety Read more

Safety Read more

Same as connect but takes a SignalId instead of a signal name.

Same as connect_local but takes a SignalId instead of a signal name.

Same as connect_unsafe but takes a SignalId instead of a signal name.

Emit signal by signal id.

Emit signal with details by signal id.

Emit signal by it’s name.

Same as emit but takes Value for the arguments.

Same as emit_by_name but takes Value for the arguments.

Same as emit_with_details but takes Value for the arguments.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Returns a SendValue clone of self.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.