upgrade to the version 1.8
[profile/ivi/ofono.git] / include / call-barring.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_BARRING_H
23 #define __OFONO_CALL_BARRING_H
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 #include <ofono/types.h>
30
31 struct ofono_call_barring;
32
33 typedef void (*ofono_call_barring_set_cb_t)(const struct ofono_error *error,
34                                                 void *data);
35 typedef void (*ofono_call_barring_query_cb_t)(const struct ofono_error *error,
36                                         int status, void *data);
37
38 struct ofono_call_barring_driver {
39         const char *name;
40         int (*probe)(struct ofono_call_barring *cb, unsigned int vendor,
41                         void *data);
42         void (*remove)(struct ofono_call_barring *cb);
43         void (*set)(struct ofono_call_barring *barr, const char *lock,
44                         int enable, const char *passwd, int cls,
45                         ofono_call_barring_set_cb_t cb, void *data);
46         void (*query)(struct ofono_call_barring *barr, const char *lock,
47                         int cls, ofono_call_barring_query_cb_t cb, void *data);
48         void (*set_passwd)(struct ofono_call_barring *barr, const char *lock,
49                         const char *old_passwd, const char *new_passwd,
50                         ofono_call_barring_set_cb_t cb, void *data);
51 };
52
53 int ofono_call_barring_driver_register(
54                                 const struct ofono_call_barring_driver *d);
55 void ofono_call_barring_driver_unregister(
56                                 const struct ofono_call_barring_driver *d);
57
58 struct ofono_call_barring *ofono_call_barring_create(struct ofono_modem *modem,
59                                                         unsigned int vendor,
60                                                         const char *driver,
61                                                         void *data);
62
63 void ofono_call_barring_register(struct ofono_call_barring *cb);
64 void ofono_call_barring_remove(struct ofono_call_barring *cb);
65
66 void ofono_call_barring_set_data(struct ofono_call_barring *cb, void *data);
67 void *ofono_call_barring_get_data(struct ofono_call_barring *cb);
68
69 #ifdef __cplusplus
70 }
71 #endif
72
73 #endif /* __OFONO_CALL_BARRING_H */