history.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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_HISTORY_H
  22. #define __OFONO_HISTORY_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. #include <ofono/types.h>
  27. enum ofono_disconnect_reason;
  28. struct ofono_call;
  29. enum ofono_history_sms_status {
  30. OFONO_HISTORY_SMS_STATUS_PENDING,
  31. OFONO_HISTORY_SMS_STATUS_SUBMITTED,
  32. OFONO_HISTORY_SMS_STATUS_SUBMIT_FAILED,
  33. OFONO_HISTORY_SMS_STATUS_SUBMIT_CANCELLED,
  34. OFONO_HISTORY_SMS_STATUS_DELIVERED,
  35. OFONO_HISTORY_SMS_STATUS_DELIVER_FAILED,
  36. };
  37. struct ofono_history_context {
  38. struct ofono_history_driver *driver;
  39. struct ofono_modem *modem;
  40. void *data;
  41. };
  42. struct ofono_history_driver {
  43. const char *name;
  44. int (*probe)(struct ofono_history_context *context);
  45. void (*remove)(struct ofono_history_context *context);
  46. void (*call_ended)(struct ofono_history_context *context,
  47. const struct ofono_call *call,
  48. time_t start, time_t end);
  49. void (*call_missed)(struct ofono_history_context *context,
  50. const struct ofono_call *call, time_t when);
  51. void (*sms_received)(struct ofono_history_context *context,
  52. const struct ofono_uuid *uuid, const char *from,
  53. const struct tm *remote, const struct tm *local,
  54. const char *text);
  55. void (*sms_send_pending)(struct ofono_history_context *context,
  56. const struct ofono_uuid *uuid,
  57. const char *to,
  58. time_t when, const char *text);
  59. void (*sms_send_status)(struct ofono_history_context *context,
  60. const struct ofono_uuid *uuid,
  61. time_t when,
  62. enum ofono_history_sms_status status);
  63. };
  64. int ofono_history_driver_register(const struct ofono_history_driver *driver);
  65. void ofono_history_driver_unregister(const struct ofono_history_driver *driver);
  66. #ifdef __cplusplus
  67. }
  68. #endif
  69. #endif /* __OFONO_HISTORY_H */