rpc-systemui

rpc-systemui — Helpers for communicating with systemui alarm plugin.

Synopsis




enum        SystemuiDialogReason;
void        (*SystemuiAlarmdDialogCallback) (gpointer user_data,
                                             SystemuiDialogReason reason);
void        systemui_alarm_dialog_queue_append
                                            (time_t alarm_time,
                                             const gchar *title,
                                             const gchar *message,
                                             const gchar *sound,
                                             const gchar *icon,
                                             gboolean can_snooze,
                                             SystemuiAlarmdDialogCallback cb,
                                             gpointer user_data);
void        systemui_alarm_dialog_queue_remove
                                            (time_t alarm_time,
                                             const gchar *title,
                                             const gchar *message,
                                             const gchar *sound,
                                             const gchar *icon,
                                             SystemuiAlarmdDialogCallback cb,
                                             gpointer user_data);
void        systemui_powerup_dialog_queue_append
                                            (SystemuiAlarmdDialogCallback cb,
                                             gpointer user_data);
void        systemui_powerup_dialog_queue_remove
                                            (SystemuiAlarmdDialogCallback cb,
                                             gpointer user_data);
void        update_mce_alarm_visibility     (void);
void        systemui_ack_all_dialogs        (void);
gboolean    systemui_is_acting_dead         (void);

Description

These functions maintain a queue of alarm dialog requests and passes them to systemui as previous ones are closed.

Details

enum SystemuiDialogReason

typedef enum {
	DIALOG_ACK,
	DIALOG_SNOOZE,
	DIALOG_POWEROFF,
	DIALOG_POWERUP,
	DIALOG_POWERDOWN
} SystemuiDialogReason;

An enumeration describing the possible acknowledge reasons for dialogs.

DIALOG_ACK An alarm dialog was acked normally.
DIALOG_SNOOZE An alarm dialog was snoozed.
DIALOG_POWEROFF An alarm dialog was acked due to shutdown.
DIALOG_POWERUP An powerup dialog was acked for power up.
DIALOG_POWERDOWN An powerup dialog was acked for power down.

SystemuiAlarmdDialogCallback ()

void        (*SystemuiAlarmdDialogCallback) (gpointer user_data,
                                             SystemuiDialogReason reason);

Defines the callbeck used for replies from systemui-alarm.

user_data : user data set when the callback was connected.
reason : The reason for calling the callback, will be one of SystemuiDialogReason.

systemui_alarm_dialog_queue_append ()

void        systemui_alarm_dialog_queue_append
                                            (time_t alarm_time,
                                             const gchar *title,
                                             const gchar *message,
                                             const gchar *sound,
                                             const gchar *icon,
                                             gboolean can_snooze,
                                             SystemuiAlarmdDialogCallback cb,
                                             gpointer user_data);

Adds a request for a dialog to the queue. After the dialog has been acknowledged, the request is removed from the queue, no need to remove it manually.

alarm_time : Time of the alarm that should be shown in the dialog.
title : Title of the dialog to be appended to the queue.
message : Message of the dialog to be appended to the queue.
sound : Sound for the dialog to be appended to the queue.
icon : Icon for the dialog to be appended to the queue.
can_snooze : TRUE if the dialog should have snooze button enabled.
cb : Callback called when the dialog is acknowledged.
user_data : user date to pass to the callback.

systemui_alarm_dialog_queue_remove ()

void        systemui_alarm_dialog_queue_remove
                                            (time_t alarm_time,
                                             const gchar *title,
                                             const gchar *message,
                                             const gchar *sound,
                                             const gchar *icon,
                                             SystemuiAlarmdDialogCallback cb,
                                             gpointer user_data);

Removes an alarm dialog request from the dialog queue.

alarm_time : As passed to systemui_alarm_dialog_queue_append.
title : As passed to systemui_alarm_dialog_queue_append.
message : As passed to systemui_alarm_dialog_queue_append.
sound : As passed to systemui_alarm_dialog_queue_append.
icon : As passed to systemui_alarm_dialog_queue_append.
cb : As passed to systemui_alarm_dialog_queue_append.
user_data : As passed to systemui_alarm_dialog_queue_append.

systemui_powerup_dialog_queue_append ()

void        systemui_powerup_dialog_queue_append
                                            (SystemuiAlarmdDialogCallback cb,
                                             gpointer user_data);

Appends a powerup dialog request to the dialog queue. After the dialog has been acknowledged, the request is removed from the queue, no need to remove it manually.

cb : Callback called when the dialog is acknowledged.
user_data : user date to pass to the callback.

systemui_powerup_dialog_queue_remove ()

void        systemui_powerup_dialog_queue_remove
                                            (SystemuiAlarmdDialogCallback cb,
                                             gpointer user_data);

Removes a powerup dialog request from the dialog queue.

cb : As passed to systemui_powerup_dialog_queue_append.
user_data : As passed to systemui_powerup_dialog_queue_append.

update_mce_alarm_visibility ()

void        update_mce_alarm_visibility     (void);

Sends message to mce telling the alarm dialog visibility status.


systemui_ack_all_dialogs ()

void        systemui_ack_all_dialogs        (void);

Clears the queue acknowledging all alarms and tells systemui to close the currently showing one.


systemui_is_acting_dead ()

gboolean    systemui_is_acting_dead         (void);

Queries system UI whether the acting dead mode is enabled or not.

Returns : TRUE if device is in acting dead, false otherwise.