PhoshNotification

PhoshNotification — A notification

Functions

Properties

GStrv actions Read / Write
GIcon * app-icon Read / Write
GAppInfo * app-info Read / Write
gchar * app-name Read / Write
gchar * body Read / Write
gchar * category Read / Write
guint id Read / Write
GIcon * image Read / Write
gboolean resident Read / Write
gchar * summary Read / Write
GDateTime * timestamp Read / Write
gboolean transient Read / Write
PhoshNotificationUrgency urgency Read / Write

Signals

Types and Values

Object Hierarchy

    GEnum
    ├── PhoshNotificationReason
    ╰── PhoshNotificationUrgency
    GObject
    ╰── PhoshNotification

Description

Functions

phosh_notification_new ()

PhoshNotification *
phosh_notification_new (guint id,
                        const char *app_name,
                        GAppInfo *info,
                        const char *summary,
                        const char *body,
                        GIcon *icon,
                        GIcon *image,
                        PhoshNotificationUrgency urgency,
                        GStrv actions,
                        gboolean transient,
                        gboolean resident,
                        const char *category,
                        GDateTime *timestamp);

phosh_notification_set_id ()

void
phosh_notification_set_id (PhoshNotification *self,
                           guint id);

phosh_notification_get_id ()

guint
phosh_notification_get_id (PhoshNotification *self);

phosh_notification_set_summary ()

void
phosh_notification_set_summary (PhoshNotification *self,
                                const char *summary);

phosh_notification_get_summary ()

const char *
phosh_notification_get_summary (PhoshNotification *self);

phosh_notification_set_body ()

void
phosh_notification_set_body (PhoshNotification *self,
                             const char *body);

phosh_notification_get_body ()

const char *
phosh_notification_get_body (PhoshNotification *self);

phosh_notification_set_app_name ()

void
phosh_notification_set_app_name (PhoshNotification *self,
                                 const char *app_name);

phosh_notification_get_app_name ()

const char *
phosh_notification_get_app_name (PhoshNotification *self);

phosh_notification_get_timestamp ()

GDateTime *
phosh_notification_get_timestamp (PhoshNotification *self);

phosh_notification_set_timestamp ()

void
phosh_notification_set_timestamp (PhoshNotification *self,
                                  GDateTime *timestamp);

phosh_notification_set_app_icon ()

void
phosh_notification_set_app_icon (PhoshNotification *self,
                                 GIcon *icon);

phosh_notification_get_app_icon ()

GIcon *
phosh_notification_get_app_icon (PhoshNotification *self);

phosh_notification_set_app_info ()

void
phosh_notification_set_app_info (PhoshNotification *self,
                                 GAppInfo *info);

phosh_notification_get_app_info ()

GAppInfo *
phosh_notification_get_app_info (PhoshNotification *self);

phosh_notification_set_image ()

void
phosh_notification_set_image (PhoshNotification *self,
                              GIcon *icon);

phosh_notification_get_image ()

GIcon *
phosh_notification_get_image (PhoshNotification *self);

phosh_notification_set_urgency ()

void
phosh_notification_set_urgency (PhoshNotification *self,
                                PhoshNotificationUrgency urgency);

phosh_notification_get_urgency ()

PhoshNotificationUrgency
phosh_notification_get_urgency (PhoshNotification *self);

phosh_notification_set_actions ()

void
phosh_notification_set_actions (PhoshNotification *self,
                                GStrv actions);

phosh_notification_get_actions ()

const GStrv
phosh_notification_get_actions (PhoshNotification *self);

phosh_notification_set_transient ()

void
phosh_notification_set_transient (PhoshNotification *self,
                                  gboolean transient);

Set if self should go to the message tray

Parameters

self

the PhoshNotification

 

transient

if self is transient

 

phosh_notification_get_transient ()

gboolean
phosh_notification_get_transient (PhoshNotification *self);

Transient notifications don't go to the message tray

Parameters

self

the PhoshNotification

 

Returns

TRUE when transient, otherwise FALSE


phosh_notification_set_resident ()

void
phosh_notification_set_resident (PhoshNotification *self,
                                 gboolean resident);

Set whether of not invoking actions dismiss self

Parameters

self

the PhoshNotification

 

resident

is the notification resident

 

phosh_notification_get_resident ()

gboolean
phosh_notification_get_resident (PhoshNotification *self);

When TRUE invoking an action _doesn't_ dismiss the notification

Parameters

self

the PhoshNotification

 

Returns

TRUE when resident, otherwise FALSE


phosh_notification_set_category ()

void
phosh_notification_set_category (PhoshNotification *self,
                                 const char *category);

Set the type of notification, such as "email.arrived"

Parameters

self

the PhoshNotification

 

category

the new category

 

phosh_notification_get_category ()

const char *
phosh_notification_get_category (PhoshNotification *self);

Get the category hint the notification was sent with

See https://people.gnome.org/~mccann/docs/notification-spec/notification-spec-latest.htmlcategories

Parameters

self

the PhoshNotification

 

Returns

the category or NULL


phosh_notification_activate ()

void
phosh_notification_activate (PhoshNotification *self,
                             const char *action);

phosh_notification_expires ()

void
phosh_notification_expires (PhoshNotification *self,
                            int timeout);

Set self to expire after timeout (from this call)

Note doesn't close the notification, for that call phosh_notification_close() is response to “expired”

Parameters

self

the PhoshNotification

 

timeout

delay (in milliseconds)

 

phosh_notification_close ()

void
phosh_notification_close (PhoshNotification *self,
                          PhoshNotificationReason reason);

Parameters

self

the PhoshNotification

 

reason

Why the notification is closing

 

Types and Values

enum PhoshNotificationUrgency

Members

PHOSH_NOTIFICATION_URGENCY_LOW

low urgency

 

PHOSH_NOTIFICATION_URGENCY_NORMAL

normal urgency

 

PHOSH_NOTIFICATION_URGENCY_CRITICAL

critical urgency

 

enum PhoshNotificationReason

Members

PHOSH_NOTIFICATION_REASON_EXPIRED

notification expired

 

PHOSH_NOTIFICATION_REASON_DISMISSED

notification was dismissed

 

PHOSH_NOTIFICATION_REASON_CLOSED

notification was closed

 

PHOSH_NOTIFICATION_REASON_UNDEFINED

undefined reason

 

PHOSH_NOTIFICATION_DEFAULT_ACTION

#define PHOSH_NOTIFICATION_DEFAULT_ACTION "default"

PHOSH_TYPE_NOTIFICATION

#define PHOSH_TYPE_NOTIFICATION (phosh_notification_get_type ())

PhoshNotification

typedef struct _PhoshNotification PhoshNotification;

Property Details

The “actions” property

  “actions”                  GStrv

Notification actions.

Flags: Read / Write


The “app-icon” property

  “app-icon”                 GIcon *

Application icon.

Flags: Read / Write


The “app-info” property

  “app-info”                 GAppInfo *

When non-NULL this overrides the values of “app-name” and “app-icon” with those from the GAppInfo

Flags: Read / Write


The “app-name” property

  “app-name”                 gchar *

The applications's name.

Flags: Read / Write

Default value: ""


The “body” property

  “body”                     gchar *

The notification's body.

Flags: Read / Write

Default value: ""


The “category” property

  “category”                 gchar *

The notification's category.

Flags: Read / Write

Default value: ""


The “id” property

  “id”                       guint

Notification ID.

Flags: Read / Write

Default value: 0


The “image” property

  “image”                    GIcon *

Notification image.

Flags: Read / Write


The “resident” property

  “resident”                 gboolean

The notification is resident.

Flags: Read / Write

Default value: FALSE


The “summary” property

  “summary”                  gchar *

The notification's summary.

Flags: Read / Write

Default value: ""


The “timestamp” property

  “timestamp”                GDateTime *

The time that notification came in.

Flags: Read / Write


The “transient” property

  “transient”                gboolean

The notification is transient.

Flags: Read / Write

Default value: FALSE


The “urgency” property

  “urgency”                  PhoshNotificationUrgency

Notification urgency.

Flags: Read / Write

Default value: PHOSH_NOTIFICATION_URGENCY_NORMAL

Signal Details

The “actioned” signal

void
user_function (PhoshNotification *phoshnotification,
               gchar             *arg1,
               gpointer           user_data)

Flags: Run Last


The “closed” signal

void
user_function (PhoshNotification      *phoshnotification,
               PhoshNotificationReason arg1,
               gpointer                user_data)

Flags: Run Last


The “expired” signal

void
user_function (PhoshNotification *phoshnotification,
               gpointer           user_data)

Flags: Run Last