phonebook.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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_PHONEBOOK_H
  22. #define __OFONO_PHONEBOOK_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. #include <ofono/types.h>
  27. struct ofono_phonebook;
  28. typedef void (*ofono_phonebook_cb_t)(const struct ofono_error *error,
  29. void *data);
  30. /* Export entries reports results through ofono_phonebook_entry, if an error
  31. * occurs, ofono_phonebook_entry should not be called
  32. */
  33. struct ofono_phonebook_driver {
  34. const char *name;
  35. int (*probe)(struct ofono_phonebook *pb, unsigned int vendor,
  36. void *data);
  37. void (*remove)(struct ofono_phonebook *pb);
  38. void (*export_entries)(struct ofono_phonebook *pb, const char *storage,
  39. ofono_phonebook_cb_t cb, void *data);
  40. };
  41. void ofono_phonebook_entry(struct ofono_phonebook *pb, int index,
  42. const char *number, int type,
  43. const char *text, int hidden,
  44. const char *group,
  45. const char *adnumber, int adtype,
  46. const char *secondtext, const char *email,
  47. const char *sip_uri, const char *tel_uri);
  48. int ofono_phonebook_driver_register(const struct ofono_phonebook_driver *d);
  49. void ofono_phonebook_driver_unregister(const struct ofono_phonebook_driver *d);
  50. struct ofono_phonebook *ofono_phonebook_create(struct ofono_modem *modem,
  51. unsigned int vendor,
  52. const char *driver,
  53. void *data);
  54. void ofono_phonebook_register(struct ofono_phonebook *pb);
  55. void ofono_phonebook_remove(struct ofono_phonebook *pb);
  56. void ofono_phonebook_set_data(struct ofono_phonebook *pb, void *data);
  57. void *ofono_phonebook_get_data(struct ofono_phonebook *pb);
  58. #ifdef __cplusplus
  59. }
  60. #endif
  61. #endif /* __OFONO_PHONEBOOK_H */