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 _ACTION_DIALOG_H_ 00023 #define _ACTION_DIALOG_H_ 00024 00025 #include <glib-object.h> 00026 #include "action.h" 00027 00028 #define ALARMD_TYPE_ACTION_DIALOG (alarmd_action_dialog_get_type()) 00029 #define ALARMD_ACTION_DIALOG(object) (G_TYPE_CHECK_INSTANCE_CAST((object), ALARMD_TYPE_ACTION_DIALOG, AlarmdActionDialog)) 00030 #define ALARMD_ACTION_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), ALARMD_TYPE_ACTION_DIALOG, AlarmdActionDialogClass)) 00031 #define ALARMD_IS_ACTION_DIALOG(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), ALARMD_TYPE_ACTION_DIALOG)) 00032 #define ALARMD_IS_ACTION_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), ALARMD_TYPE_ACTION_DIALOG)) 00033 #define ALARMD_ACTION_DIALOG_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), ALARMD_TYPE_ACTION_DIALOG, AlarmdActionDialogClass)) 00034 00035 typedef struct _AlarmdActionDialog AlarmdActionDialog; 00036 struct _AlarmdActionDialog 00037 { 00038 AlarmdAction parent_instance; 00039 }; 00040 00041 typedef struct _AlarmdActionDialogClass AlarmdActionDialogClass; 00042 struct _AlarmdActionDialogClass 00043 { 00044 AlarmdActionClass parent_class; 00045 00046 void (*do_action)(AlarmdActionDialog *dialog); 00047 }; 00048 00049 /** 00050 * SECTION:actiondialog 00051 * @short_description: Base class for actions that show a dialog on events. 00052 * @see_also: #AlarmdActionDBus, #AlarmdActionExec. 00053 * 00054 * #AlarmdActionDialog is an action type that, upon firing, may show a dialog 00055 * if flagged so in #AlarmdActionDialog:flags. After the dialog has been 00056 * acknowledged, this action type does nothing, use #AlarmdActionExec or 00057 * #AlarmdActionDbus to do something afterwards. The charasteristics of the 00058 * dialog are determined by the properties #AlarmdActionDialog:title, 00059 * #AlarmdActionDialog:icon, #AlarmdActionDialog:message, 00060 * #AlarmdActionDialog:sound and #AlarmdActionDialog:flags. 00061 **/ 00062 00063 GType alarmd_action_dialog_get_type(void); 00064 00065 /** 00066 * alarmd_action_dialog_do_action: 00067 * @dialog: The action that should be done. 00068 * 00069 * Does the action of the #AlarmdActionDialog. 00070 **/ 00071 void alarmd_action_dialog_do_action(AlarmdActionDialog *dialog); 00072 00073 /** 00074 * alarmd_action_dialog_new: 00075 * 00076 * Creates new alarmd dialog action. 00077 * Returns: Newly created #AlarmdActionDialog. 00078 **/ 00079 AlarmdAction *alarmd_action_dialog_new(void); 00080 00081 #endif /* _ACTIONDIALOG_H_ */