call-forwarding.h 2.9 KB

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