CdosNotifyNotification

CdosNotifyNotification

Functions

Properties

gchar * app-name Read / Write
gchar * body Read / Write / Construct
gint closed-reason Read
gchar * icon-name Read / Write / Construct
gint id Read / Write / Construct
gchar * summary Read / Write / Construct

Signals

void closed Run First

Types and Values

Object Hierarchy

    GObject
    ╰── CdosNotifyNotification

Description

Functions

CdosNotifyActionCallback ()

void
(*CdosNotifyActionCallback) (CdosNotifyNotification *notification,
                             char *action,
                             gpointer user_data);

An action callback function.

Parameters

notification

The notification.

 

action

The action.

 

user_data

User data.

 

CDOS_NOTIFY_ACTION_CALLBACK()

#define CDOS_NOTIFY_ACTION_CALLBACK(func) ((CdosNotifyActionCallback)(func))

A convenience macro for casting a function to a CdosNotifyActionCallback. This is much like G_CALLBACK().

Parameters

func

The function to cast.

 

cdos_notify_notification_new ()

CdosNotifyNotification *
cdos_notify_notification_new (const char *summary,
                              const char *body,
                              const char *icon);

Creates a new CdosNotifyNotification. The summary text is required, but all other parameters are optional.

Parameters

summary

The required summary text.

 

body

The optional body text.

[allow-none]

icon

The optional icon theme icon name or filename.

[allow-none]

Returns

The new CdosNotifyNotification.


cdos_notify_notification_update ()

gboolean
cdos_notify_notification_update (CdosNotifyNotification *notification,
                                 const char *summary,
                                 const char *body,
                                 const char *icon);

Updates the notification text and icon. This won't send the update out and display it on the screen. For that, you will need to call cdos_notify_notification_show().

Parameters

notification

The notification to update.

 

summary

The new required summary text.

 

body

The optional body text.

[allow-none]

icon

The optional icon theme icon name or filename.

[allow-none]

Returns

TRUE, unless an invalid parameter was passed.


cdos_notify_notification_show ()

gboolean
cdos_notify_notification_show (CdosNotifyNotification *notification,
                               GError **error);

Tells the notification server to display the notification on the screen.

Parameters

notification

The notification.

 

error

The returned error information.

 

Returns

TRUE if successful. On error, this will return FALSE and set error .


cdos_notify_notification_set_timeout ()

void
cdos_notify_notification_set_timeout (CdosNotifyNotification *notification,
                                      gint timeout);

Sets the timeout of the notification. To set the default time, pass CDOS_NOTIFY_EXPIRES_DEFAULT as timeout . To set the notification to never expire, pass CDOS_NOTIFY_EXPIRES_NEVER.

Note that the timeout may be ignored by the server.

Parameters

notification

The notification.

 

timeout

The timeout in milliseconds.

 

cdos_notify_notification_set_category ()

void
cdos_notify_notification_set_category (CdosNotifyNotification *notification,
                                       const char *category);

Sets the category of this notification. This can be used by the notification server to filter or display the data in a certain way.

Parameters

notification

The notification.

 

category

The category.

 

cdos_notify_notification_set_urgency ()

void
cdos_notify_notification_set_urgency (CdosNotifyNotification *notification,
                                      CdosNotifyUrgency urgency);

Sets the urgency level of this notification.

See: CdosNotifyUrgency

Parameters

notification

The notification.

 

urgency

The urgency level.

 

cdos_notify_notification_set_image_from_pixbuf ()

void
cdos_notify_notification_set_image_from_pixbuf
                               (CdosNotifyNotification *notification,
                                GdkPixbuf *pixbuf);

Sets the image in the notification from a GdkPixbuf.

Parameters

notification

The notification.

 

pixbuf

The image.

 

cdos_notify_notification_set_icon_from_pixbuf ()

void
cdos_notify_notification_set_icon_from_pixbuf
                               (CdosNotifyNotification *notification,
                                GdkPixbuf *icon);

cdos_notify_notification_set_icon_from_pixbuf is deprecated and should not be used in newly-written code.

use cdos_notify_notification_set_image_from_pixbuf() instead.

Sets the icon in the notification from a GdkPixbuf.

Parameters

notification

The notification.

 

icon

The icon.

 

cdos_notify_notification_set_hint_int32 ()

void
cdos_notify_notification_set_hint_int32
                               (CdosNotifyNotification *notification,
                                const char *key,
                                gint value);

cdos_notify_notification_set_hint_int32 has been deprecated since version 0.6. and should not be used in newly-written code.

Use cdos_notify_notification_set_hint() instead

Sets a hint with a 32-bit integer value.

Parameters

notification

The notification.

 

key

The hint.

 

value

The hint's value.

 

cdos_notify_notification_set_hint_uint32 ()

void
cdos_notify_notification_set_hint_uint32
                               (CdosNotifyNotification *notification,
                                const char *key,
                                guint value);

cdos_notify_notification_set_hint_uint32 has been deprecated since version 0.6. and should not be used in newly-written code.

Use cdos_notify_notification_set_hint() instead

Sets a hint with an unsigned 32-bit integer value.

Parameters

notification

The notification.

 

key

The hint.

 

value

The hint's value.

 

cdos_notify_notification_set_hint_double ()

void
cdos_notify_notification_set_hint_double
                               (CdosNotifyNotification *notification,
                                const char *key,
                                gdouble value);

cdos_notify_notification_set_hint_double has been deprecated since version 0.6. and should not be used in newly-written code.

Use cdos_notify_notification_set_hint() instead

Sets a hint with a double value.

Parameters

notification

The notification.

 

key

The hint.

 

value

The hint's value.

 

cdos_notify_notification_set_hint_string ()

void
cdos_notify_notification_set_hint_string
                               (CdosNotifyNotification *notification,
                                const char *key,
                                const char *value);

cdos_notify_notification_set_hint_string has been deprecated since version 0.6. and should not be used in newly-written code.

Use cdos_notify_notification_set_hint() instead

Sets a hint with a string value.

Parameters

notification

The notification.

 

key

The hint.

 

value

The hint's value.

 

cdos_notify_notification_set_hint_byte ()

void
cdos_notify_notification_set_hint_byte
                               (CdosNotifyNotification *notification,
                                const char *key,
                                guchar value);

cdos_notify_notification_set_hint_byte has been deprecated since version 0.6. and should not be used in newly-written code.

Use cdos_notify_notification_set_hint() instead

Sets a hint with a byte value.

Parameters

notification

The notification.

 

key

The hint.

 

value

The hint's value.

 

cdos_notify_notification_set_hint_byte_array ()

void
cdos_notify_notification_set_hint_byte_array
                               (CdosNotifyNotification *notification,
                                const char *key,
                                const guchar *value,
                                gsize len);

cdos_notify_notification_set_hint_byte_array has been deprecated since version 0.6. and should not be used in newly-written code.

Use cdos_notify_notification_set_hint() instead

Sets a hint with a byte array value. The length of value must be passed as len .

Parameters

notification

The notification.

 

key

The hint.

 

value

The hint's value.

[array length=len]

len

The length of the byte array.

 

cdos_notify_notification_set_hint ()

void
cdos_notify_notification_set_hint (CdosNotifyNotification *notification,
                                   const char *key,
                                   GVariant *value);

Sets a hint for key with value value . If value is NULL, a previously set hint for key is unset.

If value is floating, it is consumed.

Parameters

notification

a CdosNotifyNotification

 

key

the hint key

 

value

the hint value, or NULL to unset the hint.

[allow-none]

Since: 0.6


cdos_notify_notification_set_app_name ()

void
cdos_notify_notification_set_app_name (CdosNotifyNotification *notification,
                                       const char *app_name);

Sets the application name for the notification. If this function is not called or if app_name is NULL, the application name will be set from the value used in cdos_notify_init() or overridden with cdos_notify_set_app_name().

Parameters

notification

a CdosNotifyNotification

 

app_name

the localised application name

 

Since: 0.7.3


cdos_notify_notification_clear_hints ()

void
cdos_notify_notification_clear_hints (CdosNotifyNotification *notification);

Clears all hints from the notification.

Parameters

notification

The notification.

 

cdos_notify_notification_add_action ()

void
cdos_notify_notification_add_action (CdosNotifyNotification *notification,
                                     const char *action,
                                     const char *label,
                                     CdosNotifyActionCallback callback,
                                     gpointer user_data,
                                     GFreeFunc free_func);

Adds an action to a notification. When the action is invoked, the specified callback function will be called, along with the value passed to user_data .

Parameters

notification

The notification.

 

action

The action ID.

 

label

The human-readable action label.

 

callback

The action's callback function.

 

user_data

Optional custom data to pass to callback .

 

free_func

An optional function to free user_data when the notification is destroyed.

[type GLib.DestroyNotify]

cdos_notify_notification_clear_actions ()

void
cdos_notify_notification_clear_actions
                               (CdosNotifyNotification *notification);

Clears all actions from the notification.

Parameters

notification

The notification.

 

cdos_notify_notification_close ()

gboolean
cdos_notify_notification_close (CdosNotifyNotification *notification,
                                GError **error);

Synchronously tells the notification server to hide the notification on the screen.

Parameters

notification

The notification.

 

error

The returned error information.

 

Returns

TRUE on success, or FALSE on error with error filled in


cdos_notify_notification_get_closed_reason ()

gint
cdos_notify_notification_get_closed_reason
                               (const CdosNotifyNotification *notification);

Returns the closed reason code for the notification. This is valid only after the "closed" signal is emitted.

Parameters

notification

The notification.

 

Returns

The closed reason code.

Types and Values

CDOS_NOTIFY_EXPIRES_DEFAULT

#define CDOS_NOTIFY_EXPIRES_DEFAULT -1

The default expiration time on a notification.


CDOS_NOTIFY_EXPIRES_NEVER

#define CDOS_NOTIFY_EXPIRES_NEVER    0

The notification never expires. It stays open until closed by the calling API or the user.


CDOS_NOTIFY_TYPE_NOTIFICATION

#define CDOS_NOTIFY_TYPE_NOTIFICATION         (cdos_notify_notification_get_type ())

enum CdosNotifyUrgency

The urgency level of the notification.

Members

CDOS_NOTIFY_URGENCY_LOW

Low urgency. Used for unimportant notifications.

 

CDOS_NOTIFY_URGENCY_NORMAL

Normal urgency. Used for most standard notifications.

 

CDOS_NOTIFY_URGENCY_CRITICAL

Critical urgency. Used for very important notifications.

 

Property Details

The “app-name” property

  “app-name”                 gchar *

The application name to use for this notification.

Flags: Read / Write

Default value: NULL


The “body” property

  “body”                     gchar *

The message body text.

Flags: Read / Write / Construct

Default value: NULL


The “closed-reason” property

  “closed-reason”            gint

The reason code for why the notification was closed.

Flags: Read

Allowed values: >= -1

Default value: -1


The “icon-name” property

  “icon-name”                gchar *

The icon filename or icon theme-compliant name.

Flags: Read / Write / Construct

Default value: NULL


The “id” property

  “id”                       gint

The notification ID.

Flags: Read / Write / Construct

Allowed values: >= 0

Default value: 0


The “summary” property

  “summary”                  gchar *

The summary text.

Flags: Read / Write / Construct

Default value: NULL

Signal Details

The “closed” signal

void
user_function (CdosNotifyNotification *cdosnotifynotification,
               gpointer                user_data)

Flags: Run First