3 * oFono - Open Telephony stack for Linux
5 * Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #ifndef __OFONO_HISTORY_H
23 #define __OFONO_HISTORY_H
29 #include <ofono/types.h>
31 enum ofono_disconnect_reason;
34 enum ofono_history_sms_status {
35 OFONO_HISTORY_SMS_STATUS_PENDING,
36 OFONO_HISTORY_SMS_STATUS_SUBMITTED,
37 OFONO_HISTORY_SMS_STATUS_SUBMIT_FAILED,
38 OFONO_HISTORY_SMS_STATUS_SUBMIT_CANCELLED,
39 OFONO_HISTORY_SMS_STATUS_DELIVERED,
40 OFONO_HISTORY_SMS_STATUS_DELIVER_FAILED,
43 struct ofono_history_context {
44 struct ofono_history_driver *driver;
45 struct ofono_modem *modem;
49 struct ofono_history_driver {
51 int (*probe)(struct ofono_history_context *context);
52 void (*remove)(struct ofono_history_context *context);
53 void (*call_ended)(struct ofono_history_context *context,
54 const struct ofono_call *call,
55 time_t start, time_t end);
56 void (*call_missed)(struct ofono_history_context *context,
57 const struct ofono_call *call, time_t when);
58 void (*sms_received)(struct ofono_history_context *context,
59 const struct ofono_uuid *uuid, const char *from,
60 const struct tm *remote, const struct tm *local,
62 void (*sms_send_pending)(struct ofono_history_context *context,
63 const struct ofono_uuid *uuid,
65 time_t when, const char *text);
66 void (*sms_send_status)(struct ofono_history_context *context,
67 const struct ofono_uuid *uuid,
69 enum ofono_history_sms_status status);
72 int ofono_history_driver_register(const struct ofono_history_driver *driver);
73 void ofono_history_driver_unregister(const struct ofono_history_driver *driver);
79 #endif /* __OFONO_HISTORY_H */