call-forwarding: Conform to coding style item M4
[platform/upstream/ofono.git] / include / call-forwarding.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_CALL_FORWARDING_H
23 #define __OFONO_CALL_FORWARDING_H
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 #include <ofono/types.h>
30
31 struct ofono_call_forwarding;
32
33 /* 27.007 Section 7.11 Call Forwarding */
34 struct ofono_call_forwarding_condition {
35         int status;
36         int cls;
37         struct ofono_phone_number phone_number;
38         int time;
39 };
40
41 typedef void (*ofono_call_forwarding_set_cb_t)(const struct ofono_error *error,
42                                                 void *data);
43 typedef void (*ofono_call_forwarding_query_cb_t)(
44                         const struct ofono_error *error, int total,
45                         const struct ofono_call_forwarding_condition *list,
46                         void *data);
47
48 struct ofono_call_forwarding_driver {
49         const char *name;
50         int (*probe)(struct ofono_call_forwarding *cf, unsigned int vendor,
51                         void *data);
52         void (*remove)(struct ofono_call_forwarding *cf);
53         void (*activation)(struct ofono_call_forwarding *cf,
54                                 int type, int cls,
55                                 ofono_call_forwarding_set_cb_t cb, void *data);
56         void (*registration)(struct ofono_call_forwarding *cf,
57                                 int type, int cls,
58                                 const struct ofono_phone_number *number,
59                                 int time,
60                                 ofono_call_forwarding_set_cb_t cb, void *data);
61         void (*deactivation)(struct ofono_call_forwarding *cf,
62                                 int type, int cls,
63                                 ofono_call_forwarding_set_cb_t cb, void *data);
64         void (*erasure)(struct ofono_call_forwarding *cf, int type, int cls,
65                                 ofono_call_forwarding_set_cb_t cb, void *data);
66         void (*query)(struct ofono_call_forwarding *cf, int type, int cls,
67                                 ofono_call_forwarding_query_cb_t cb,
68                                 void *data);
69 };
70
71 int ofono_call_forwarding_driver_register(
72                                 const struct ofono_call_forwarding_driver *d);
73 void ofono_call_forwarding_driver_unregister(
74                                 const struct ofono_call_forwarding_driver *d);
75
76 struct ofono_call_forwarding *ofono_call_forwarding_create(
77                                                 struct ofono_modem *modem,
78                                                 unsigned int vendor,
79                                                 const char *driver, void *data);
80
81 void ofono_call_forwarding_register(struct ofono_call_forwarding *cf);
82 void ofono_call_forwarding_remove(struct ofono_call_forwarding *cf);
83
84 void ofono_call_forwarding_set_data(struct ofono_call_forwarding *cf,
85                                         void *data);
86 void *ofono_call_forwarding_get_data(struct ofono_call_forwarding *cf);
87
88 #ifdef __cplusplus
89 }
90 #endif
91
92 #endif /* __OFONO_CALL_FORWARDING_H */