## PhoshNotifyManager

PhoshNotifyManager — Manages notifications

## Functions

PhoshNotifyManager * | phosh_notify_manager_get_default ()
PhoshNotificationList * | phosh_notify_manager_get_list ()
gboolean | phosh_notify_manager_get_show_banners ()
guint | phosh_notify_manager_get_notification_id ()
void | phosh_notify_manager_add_notification ()
gboolean | phosh_notify_manager_close_notification_by_id ()
void | phosh_notify_manager_close_all_notifications ()
gboolean | phosh_notify_manager_get_show_notification_banner ()

## Signals

void | new-notification | Run Last

## Types and Values

#define | NOTIFICATIONS_SCHEMA_ID
#define | NOTIFICATIONS_KEY_SHOW_BANNERS
#define | NOTIFICATIONS_KEY_APP_CHILDREN
#define | NOTIFICATIONS_APP_SCHEMA_ID
#define | NOTIFICATIONS_APP_PREFIX
#define | NOTIFICATIONS_APP_KEY_SHOW_BANNERS
#define | NOTIFICATIONS_APP_KEY_APP_ID
#define | PHOSH_TYPE_NOTIFY_MANAGER
| PhoshNotifyManager

## Object Hierarchy

        GObject
        ╰── GDBusInterfaceSkeleton
            ╰── PhoshNotifyDBusNotificationsSkeleton
                ╰── PhoshNotifyManager

## Implemented Interfaces

PhoshNotifyManager implements GDBusInterface and PhoshNotifyDBusNotifications.

## Description

PhoshNotifyManager manages notifications sent from the shell iself and via the org.freedesktop.Notification DBus interface. See https://developer.gnome.org/notification-spec/

It maintains a list of notifications via a PhoshNotificationList.

## Functions

### phosh_notify_manager_get_default ()

    PhoshNotifyManager *
    phosh_notify_manager_get_default (void);

### phosh_notify_manager_get_list ()

    PhoshNotificationList *
    phosh_notify_manager_get_list (PhoshNotifyManager *self);

Get the PhoshNotificationList of current notifications

#### Parameters

self | the PhoshNotifyManager |

#### Returns

the PhoshNotificationList

### phosh_notify_manager_get_show_banners ()

    gboolean
    phosh_notify_manager_get_show_banners (PhoshNotifyManager *self);

Are notififcation banners enabled

#### Parameters

self | the PhoshNotifyManager |

#### Returns

`TRUE` if banners should be shown, otherwise `FALSE`

### phosh_notify_manager_get_notification_id ()

    guint
    phosh_notify_manager_get_notification_id
                                   (PhoshNotifyManager *self);

Get a notification id

#### Parameters

self | the PhoshNotifyManager |

#### Returns

a notification id that can be used to create new notifications.

### phosh_notify_manager_add_notification ()

    void
    phosh_notify_manager_add_notification (PhoshNotifyManager *self,
                                           const gchar *source_id,
                                           int expire_timeout,
                                           PhoshNotification *notification);

Adds `notification` to the current list of notifications.

#### Parameters

self | the PhoshNotifyManager |
source_id | The notification source's app_id |
expire_timeout | When the notification should expire |
notification | The notification |

### phosh_notify_manager_close_notification_by_id ()

    gboolean
    phosh_notify_manager_close_notification_by_id
                                   (PhoshNotifyManager *self,
                                    int id,
                                    PhoshNotificationReason reason);

### phosh_notify_manager_close_all_notifications ()

    void
    phosh_notify_manager_close_all_notifications
                                   (PhoshNotifyManager *self,
                                    PhoshNotificationReason reaseon);

### phosh_notify_manager_get_show_notification_banner ()

    gboolean
    phosh_notify_manager_get_show_notification_banner
                                   (PhoshNotifyManager *self,
                                    PhoshNotification *notification);

## Types and Values

### NOTIFICATIONS_SCHEMA_ID

    #define NOTIFICATIONS_SCHEMA_ID "org.gnome.desktop.notifications"

### NOTIFICATIONS_KEY_SHOW_BANNERS

    #define NOTIFICATIONS_KEY_SHOW_BANNERS "show-banners"

### NOTIFICATIONS_KEY_APP_CHILDREN

    #define NOTIFICATIONS_KEY_APP_CHILDREN "application-children"

### NOTIFICATIONS_APP_SCHEMA_ID

    #define NOTIFICATIONS_APP_SCHEMA_ID NOTIFICATIONS_SCHEMA_ID ".application"

### NOTIFICATIONS_APP_PREFIX

    #define NOTIFICATIONS_APP_PREFIX "/org/gnome/desktop/notifications/application"

### NOTIFICATIONS_APP_KEY_SHOW_BANNERS

    #define NOTIFICATIONS_APP_KEY_SHOW_BANNERS "show-banners"

### NOTIFICATIONS_APP_KEY_APP_ID

    #define NOTIFICATIONS_APP_KEY_APP_ID "application-id"

### PHOSH_TYPE_NOTIFY_MANAGER

    #define PHOSH_TYPE_NOTIFY_MANAGER             (phosh_notify_manager_get_type ())

### PhoshNotifyManager

    typedef struct _PhoshNotifyManager PhoshNotifyManager;

## Signal Details

### The `“new-notification”` signal

    void
    user_function (PhoshNotifyManager *self,
                   PhoshNotification  *notification,
                   gpointer            user_data)

Emitted when a new notification is received and a banner should (possibly) be shown

#### Parameters

self | the PhoshNotifyManager |
notification | the new PhoshNotification |
user_data | user data set when the signal handler was connected. |

Flags: Run Last