/* diversity-sms.c - DiversitySms * * Copyright 2008 OpenMoko, Inc. * Authored by Chia-I Wu * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include enum { STATUS_CHANGED, LAST_SIGNAL }; static guint sms_signals[LAST_SIGNAL] = { 0 }; static void diversity_sms_class_init(gpointer g_iface); GType diversity_sms_get_type(void) { static GType sms_type = 0; if (!sms_type) { sms_type = g_type_register_static_simple(G_TYPE_INTERFACE, "DiversitySms", sizeof(DiversitySmsIface), (GClassInitFunc) diversity_sms_class_init, 0, NULL, 0); g_type_interface_add_prerequisite(sms_type, G_TYPE_OBJECT); } return sms_type; } static void diversity_sms_class_init(gpointer g_iface) { GType iface_type = G_TYPE_FROM_INTERFACE(g_iface); sms_signals[STATUS_CHANGED] = g_signal_new("status-changed", iface_type, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(DiversitySmsIface, status_changed), NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); } DiversitySmsStatus diversity_sms_get_status(DiversitySms *sms) { return DIVERSITY_SMS_GET_IFACE(sms)->get_status(sms); } gboolean diversity_sms_send(DiversitySms *sms, const gchar *number, const gchar *message, gboolean ask_ds, GError **error) { return DIVERSITY_SMS_GET_IFACE(sms)->send(sms, number, message, ask_ds, error); }