sim: Fix up various coding style violations
[platform/upstream/ofono.git] / include / history.h
1 /*
2  *
3  *  oFono - Open Telephony stack for Linux
4  *
5  *  Copyright (C) 2008-2011  Intel Corporation. All rights reserved.
6  *
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.
10  *
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.
15  *
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
19  *
20  */
21
22 #ifndef __OFONO_HISTORY_H
23 #define __OFONO_HISTORY_H
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 #include <ofono/types.h>
30
31 enum ofono_disconnect_reason;
32 struct ofono_call;
33
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,
41 };
42
43 struct ofono_history_context {
44         struct ofono_history_driver *driver;
45         struct ofono_modem *modem;
46         void *data;
47 };
48
49 struct ofono_history_driver {
50         const char *name;
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,
61                                 const char *text);
62         void (*sms_send_pending)(struct ofono_history_context *context,
63                                         const struct ofono_uuid *uuid,
64                                         const char *to,
65                                         time_t when, const char *text);
66         void (*sms_send_status)(struct ofono_history_context *context,
67                                         const struct ofono_uuid *uuid,
68                                         time_t when,
69                                         enum ofono_history_sms_status status);
70 };
71
72 int ofono_history_driver_register(const struct ofono_history_driver *driver);
73 void ofono_history_driver_unregister(const struct ofono_history_driver *driver);
74
75 #ifdef __cplusplus
76 }
77 #endif
78
79 #endif /* __OFONO_HISTORY_H */