4 * Copyright(C) 2007,2008 Ixonos Plc
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Boston, MA 02111.
31 #include "dbus_sms_object.h"
32 #include "dbus_sms_glue.h"
33 #include "dbus_marshal.h"
34 #include "sms_interface.h"
38 G_DEFINE_TYPE(DBusSmsObject
, dbus_sms_object
, G_TYPE_OBJECT
)
43 dbus_sms_object_class_init(DBusSmsObjectClass
*klass
)
45 /** Register our signals so that they can be emitted */
47 klass
->message_sent
= g_signal_new ("message_sent",
48 G_OBJECT_CLASS_TYPE (klass
),
49 G_SIGNAL_RUN_LAST
| G_SIGNAL_DETAILED
,
50 0, NULL
, NULL
, gsmd_smartphone_marshaller_VOID__BOOLEAN_STRING
,
51 G_TYPE_NONE
, 2, G_TYPE_BOOLEAN
,G_TYPE_STRING
);
53 klass
->incoming_message
= g_signal_new ("incoming_message",
54 G_OBJECT_CLASS_TYPE (klass
),
55 G_SIGNAL_RUN_LAST
| G_SIGNAL_DETAILED
,
56 0, NULL
, NULL
, g_cclosure_marshal_VOID__INT
,
57 G_TYPE_NONE
, 1, G_TYPE_INT
);
61 static void dbus_sms_object_init(DBusSmsObject
*gsm
)
63 dbus_g_object_type_install_info (DBUS_SMS_TYPE_OBJECT
,
64 &dbus_glib_smartphone_sms_object_info
);
67 void dbus_sms_object_finalize(GObject
*obj
)
69 //G_OBJECT_CLASS (parent_class)->finalize (obj);
70 //DBusSmsObject *gsm = (DBusSmsObject *) obj;
75 void gsmd_dbus_sms_uninitialize(DBusSmsObject
*obj
)
82 /*********************Signal functions***********************/
83 void smartphone_sms_message_sent ( SMSIPCInterface
*sms_ipc
,
87 DBusSmsObject
*obj
= (DBusSmsObject
*)sms_ipc
->priv
;
89 DBUS_SMS_OBJECT_GET_CLASS(obj
)->message_sent
,
93 void smartphone_sms_incoming_message (SMSIPCInterface
*sms_ipc
,
96 DBusSmsObject
*obj
= (DBusSmsObject
*)sms_ipc
->priv
;
98 DBUS_SMS_OBJECT_GET_CLASS(obj
)->incoming_message
,
103 /*************************Methods**********************************************/
105 gboolean
smartphone_sms_get_service_bearer(DBusSmsObject
*obj
,
106 DBusGMethodInvocation
*method_context
)
112 gboolean
smartphone_sms_set_service_bearer(DBusSmsObject
*obj
,
114 DBusGMethodInvocation
*method_context
)
120 gboolean
smartphone_sms_send_message(DBusSmsObject
*obj
,
121 const gchar
*message
,
123 const gboolean want_report
,
124 DBusGMethodInvocation
*method_context
)
126 obj
->sms
->send_message( obj
->sms
,
135 /*************************Method replies***************************************/
138 void smartphone_sms_send_message_reply(SMSIPCInterface
*sms_ipc
,
142 dbus_g_method_return((DBusGMethodInvocation
*) ipc_data
);
146 /*****************Method errors***************************************/
149 void smartphone_sms_send_message_error( SMSIPCInterface
*sms_ipc
,
154 dbus_g_method_return_error((DBusGMethodInvocation
*) ipc_data
,
159 DBusSmsObject
*gsmd_dbus_sms_initialize (SMSIPCInterface
*sms_ipc
,
162 DBusSmsObject
*obj
= g_object_new (DBUS_SMS_TYPE_OBJECT
, NULL
);
167 sms_ipc
->incoming_message
= &smartphone_sms_incoming_message
;
168 sms_ipc
->message_sent
= &smartphone_sms_message_sent
;
174 sms_ipc
->send_message_reply
= &smartphone_sms_send_message_reply
;
177 sms_ipc
->send_message_error
= &smartphone_sms_send_message_error
;