Top | ![]() |
![]() |
![]() |
![]() |
gchar * | body | Read / Write |
gboolean | has-progress | Read / Write |
GIcon * | icon | Read / Write |
gchar * | icon-name | Write |
gchar * | id | Read / Write |
gint | priority | Read / Write |
gdouble | progress | Read / Write |
gboolean | progress-is-imprecise | Read / Write |
gchar * | title | Read / Write |
gboolean | urgent | Read / Write |
IdeNotification *
ide_notification_new (void
);
Creates a new IdeNotification.
To "send" the notification, you should attach it to the IdeNotifications
object which can be found under the root IdeObject. To simplify this,
the ide_notification_attach()
function is provided to locate the
IdeNotifications object using any IdeObject you have access to.
IdeNotification *notif =
ide_notification_new()
;
setup_notification (notify);
ide_notification_attach (notif, IDE_OBJECT (some_object));
Since: 3.32
void ide_notification_attach (IdeNotification *self
,IdeObject *object
);
This function will locate the IdeNotifications object starting from
object
and attach self
as a child to that object.
Since: 3.32
gchar *
ide_notification_dup_id (IdeNotification *self
);
Copies the id of the notification and returns it to the caller after locking the object. A copy is used to avoid thread-races.
Since: 3.32
void ide_notification_set_id (IdeNotification *self
,const gchar *id
);
Sets the “id” property.
Since: 3.32
gchar *
ide_notification_dup_title (IdeNotification *self
);
Copies the current title and returns it to the caller after locking the object. A copy is used to avoid thread-races.
Since: 3.32
void ide_notification_set_title (IdeNotification *self
,const gchar *title
);
Sets the “title” property.
Since: 3.32
GIcon *
ide_notification_ref_icon (IdeNotification *self
);
Gets the icon for the notification, and returns a new reference to the GIcon.
Since: 3.32
void ide_notification_set_icon_name (IdeNotification *self
,const gchar *icon_name
);
gchar *
ide_notification_dup_body (IdeNotification *self
);
Copies the current body and returns it to the caller after locking the object. A copy is used to avoid thread-races.
Since: 3.32
void ide_notification_set_body (IdeNotification *self
,const gchar *body
);
Sets the “body” property.
Since: 3.32
gboolean
ide_notification_get_has_progress (IdeNotification *self
);
Gets if the notification supports progress updates.
Since: 3.32
void ide_notification_set_has_progress (IdeNotification *self
,gboolean has_progress
);
Set to TRUE
if the notification supports progress updates.
Since: 3.32
void ide_notification_set_priority (IdeNotification *self
,gint priority
);
gdouble
ide_notification_get_progress (IdeNotification *self
);
Gets the progress for the notification.
Since: 3.32
void ide_notification_set_progress (IdeNotification *self
,gdouble progress
);
Sets the progress for the notification.
Since: 3.32
gboolean
ide_notification_get_progress_is_imprecise
(IdeNotification *self
);
void ide_notification_set_progress_is_imprecise (IdeNotification *self
,gboolean progress_is_imprecise
);
void ide_notification_set_urgent (IdeNotification *self
,gboolean urgent
);
gboolean ide_notification_get_button (IdeNotification *self
,guint button
,gchar **label
,GIcon **icon
,gchar **action
,GVariant **target
);
Gets the button indexed by button
, and stores information about the
button into the various out parameters label
, icon
, action
, and target
.
Caller should check for the number of buttons using
ide_notification_get_n_buttons()
to determine the numerical range of
indexes to provide for button
.
To avoid racing with threads modifying notifications, the caller can
hold a recursive lock across the function calls using ide_object_lock()
and ide_object_unlock()
.
self |
||
label |
a location for the button label. |
[out][optional] |
icon |
a location for the button icon. |
[out][optional] |
action |
a location for the button action name. |
[out][optional] |
target |
a location for the button action target. |
[out][optional] |
Since: 3.32
void ide_notification_add_button (IdeNotification *self
,const gchar *label
,GIcon *icon
,const gchar *detailed_action
);
Adds a new button that may be displayed with the notification.
See also: ide_notification_add_button_with_target_value()
.
self |
||
label |
the label for the button |
|
icon |
an optional icon for the button. |
[nullable] |
detailed_action |
a detailed action name (See GAction) |
Since: 3.32
void ide_notification_add_button_with_target_value (IdeNotification *self
,const gchar *label
,GIcon *icon
,const gchar *action
,GVariant *target
);
Adds a new button, used the parsed GVariant format for the action target.
self |
||
label |
the label for the button |
|
icon |
an optional icon for the button. |
[nullable] |
action |
an action name (See GAction) |
|
target |
an optional GVariant for the action target. |
[nullable] |
Since: 3.32
gboolean ide_notification_get_default_action (IdeNotification *self
,gchar **action
,GVariant **target
);
void ide_notification_set_default_action (IdeNotification *self
,const gchar *detailed_action
);
void ide_notification_set_default_action_and_target_value (IdeNotification *self
,const gchar *action
,GVariant *target
);
void
ide_notification_withdraw (IdeNotification *self
);
Withdraws the notification by removing it from the IdeObject parent it belongs to.
Since: 3.32
void ide_notification_withdraw_in_seconds (IdeNotification *self
,gint seconds
);
Withdraws self
from it's IdeObject parent after seconds
have passed.
self |
||
seconds |
number of seconds to withdraw after, or less than zero for a sensible default. |
Since: 3.32
void ide_notification_file_progress_callback (goffset current_num_bytes
,goffset total_num_bytes
,gpointer user_data
);
This function is a GFileProgressCallback helper that will update the
“fraction” property. user_data
must be an IdeNotification.
Remember to make sure to unref the IdeNotification instance with
g_object_unref()
during the GDestroyNotify.
Since: 3.32
struct IdeNotificationClass { IdeObjectClass parent_class; /*< private */ gpointer _reserved[16]; };
“body”
property “body” gchar *
The "body" property is the main body of text for the notification. Not all notifications need this, but more complex notifications might.
Owner: IdeNotification
Flags: Read / Write
Default value: NULL
Since: 3.32
“has-progress”
property “has-progress” gboolean
The "has-progress" property denotes the notification will receive updates to the “progress” property.
Owner: IdeNotification
Flags: Read / Write
Default value: FALSE
Since: 3.32
“icon”
property “icon” GIcon *
The "icon" property is an optional icon that may be shown next to the notification title and body under certain senarios.
Owner: IdeNotification
Flags: Read / Write
Since: 3.32
“icon-name”
property “icon-name” gchar *
The "icon-name" property is a helper to make setting “icon” more convenient.
Owner: IdeNotification
Flags: Write
Default value: NULL
Since: 3.32
“id”
property “id” gchar *
The "id" property is an optional identifier that can be used to locate the notification later.
Owner: IdeNotification
Flags: Read / Write
Default value: NULL
Since: 3.32
“priority”
property “priority” gint
The "priority" property is used to sort the notification in order of importance when displaying to the user.
You may also use the “urgent” property to raise the importance of a message to the user.
Owner: IdeNotification
Flags: Read / Write
Default value: 0
Since: 3.32
“progress”
property “progress” gdouble
The "progress" property is a value between 0.0 and 1.0 describing the progress of the operation for which the notification represents.
This property is ignored if “has-progress” is unset.
Owner: IdeNotification
Flags: Read / Write
Allowed values: [0,1]
Default value: 0
Since: 3.32
“progress-is-imprecise”
property “progress-is-imprecise” gboolean
The "progress-is-imprecise" property indicates that the notification has progress, but it is imprecise.
The UI may show a bouncing progress bar if set.
Owner: IdeNotification
Flags: Read / Write
Default value: FALSE
Since: 3.32
“title”
property “title” gchar *
The "title" property is the main text to show the user. It may be displayed more prominently such as in the titlebar.
Owner: IdeNotification
Flags: Read / Write
Default value: NULL
Since: 3.32