00001 /** 00002 * This file is part of alarmd 00003 * 00004 * Contact Person: David Weinehall <david.weinehall@nokia.com> 00005 * 00006 * Copyright (C) 2006 Nokia Corporation 00007 * alarmd and libalarm are free software; you can redistribute them 00008 * and/or modify them under the terms of the GNU Lesser General Public 00009 * License version 2.1 as published by the Free Software Foundation. 00010 * 00011 * alarmd and libalarm are distributed in the hope that they will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with this software; if not, write to the Free 00018 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 00019 * 02110-1301 USA 00020 */ 00021 00022 #ifndef _RPC_SYSTEMUI_H_ 00023 #define _RPC_SYSTEMUI_H_ 00024 00025 #include <time.h> 00026 #include <glib/gtypes.h> 00027 00028 /** 00029 * SECTION:rpc-systemui 00030 * @short_description: Helpers for communicating with systemui alarm plugin. 00031 * 00032 * These functions maintain a queue of alarm dialog requests and passes them 00033 * to systemui as previous ones are closed. 00034 **/ 00035 00036 /** 00037 * SystemuiAlarmdDialogCallback: 00038 * @user_data: user data set when the callback was connected. 00039 * @snoozed: TRUE if the snooze/cancel was pressed. 00040 * 00041 * Defines the callbeck used for replies from systemui-alarm. 00042 **/ 00043 typedef void (*SystemuiAlarmdDialogCallback)(gpointer user_data, gboolean snoozed); 00044 00045 /** 00046 * systemui_alarm_dialog_queue_append: 00047 * @title: Title of the dialog to be appended to the queue. 00048 * @message: Message of the dialog to be appended to the queue. 00049 * @sound: Sound for the dialog to be appended to the queue. 00050 * @icon: Icon for the dialog to be appended to the queue. 00051 * @can_snooze: TRUE if the dialog should have snooze button enabled. 00052 * @cb: Callback called when the dialog is acknowledged. 00053 * @user_data: user date to pass to the callback. 00054 * 00055 * Adds a request for a dialog to the queue. After the dialog has been 00056 * acknowledged, the request is removed from the queue, no need to remove 00057 * it manually. 00058 **/ 00059 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); 00060 00061 /** 00062 * systemui_alarm_dialog_queue_remove: 00063 * @title: As passed to #systemui_alarm_dialog_queue_append. 00064 * @message: As passed to #systemui_alarm_dialog_queue_append. 00065 * @sound: As passed to #systemui_alarm_dialog_queue_append. 00066 * @icon: As passed to #systemui_alarm_dialog_queue_append. 00067 * @cb: As passed to #systemui_alarm_dialog_queue_append. 00068 * @user_data: As passed to #systemui_alarm_dialog_queue_append. 00069 * 00070 * Removes an alarm dialog request from the dialog queue. 00071 **/ 00072 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); 00073 00074 /** 00075 * systemui_powerup_dialog_queue_append: 00076 * @cb: Callback called when the dialog is acknowledged. 00077 * @user_data: user date to pass to the callback. 00078 * 00079 * Appends a powerup dialog request to the dialog queue. After the dialog has 00080 * been acknowledged, the request is removed from the queue, no need to remove 00081 * it manually. 00082 **/ 00083 void systemui_powerup_dialog_queue_append(SystemuiAlarmdDialogCallback cb, gpointer user_data); 00084 00085 /** 00086 * systemui_powerup_dialog_queue_remove: 00087 * @cb: As passed to #systemui_powerup_dialog_queue_append. 00088 * @user_data: As passed to #systemui_powerup_dialog_queue_append. 00089 * 00090 * Removes a powerup dialog request from the dialog queue. 00091 **/ 00092 void systemui_powerup_dialog_queue_remove(SystemuiAlarmdDialogCallback cb, gpointer user_data); 00093 00094 /** 00095 * update_mce_alarm_visibility: 00096 * 00097 * Sends message to mce telling the alarm dialog visibility status. 00098 **/ 00099 void update_mce_alarm_visibility(void); 00100 00101 /** 00102 * systemui_ack_all_dialogs: 00103 * 00104 * Clears the queue acknowledging all alarms and tells systemui to close the 00105 * currently showing one. 00106 **/ 00107 void systemui_ack_all_dialogs(void); 00108 00109 /** 00110 * systemui_is_acting_dead: 00111 * 00112 * Queries system UI whether the acting dead mode is enabled or not. 00113 * Returns: TRUE if device is in acting dead, false otherwise. 00114 **/ 00115 gboolean systemui_is_acting_dead(void); 00116 00117 #endif /* _RPC_SYSTEMUI_H_ */