call-volume.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. *
  3. * oFono - Open Source Telephony
  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_VOLUME_H
  22. #define __OFONO_CALL_VOLUME_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. #include <ofono/types.h>
  27. #include <ofono/dbus.h>
  28. struct ofono_call_volume;
  29. typedef void (*ofono_call_volume_cb_t)(const struct ofono_error *error,
  30. void *data);
  31. struct ofono_call_volume_driver {
  32. const char *name;
  33. int (*probe)(struct ofono_call_volume *cv, unsigned int vendor,
  34. void *data);
  35. void (*remove)(struct ofono_call_volume *cv);
  36. void (*speaker_volume)(struct ofono_call_volume *cv,
  37. unsigned char percent,
  38. ofono_call_volume_cb_t cb, void *data);
  39. void (*microphone_volume)(struct ofono_call_volume *cv,
  40. unsigned char percent,
  41. ofono_call_volume_cb_t cb, void *data);
  42. void (*mute)(struct ofono_call_volume *cv, int muted,
  43. ofono_call_volume_cb_t cb, void *data);
  44. };
  45. void ofono_call_volume_set_speaker_volume(struct ofono_call_volume *cv,
  46. unsigned char percent);
  47. void ofono_call_volume_set_microphone_volume(struct ofono_call_volume *cv,
  48. unsigned char percent);
  49. void ofono_call_volume_set_muted(struct ofono_call_volume *cv, int muted);
  50. int ofono_call_volume_driver_register(const struct ofono_call_volume_driver *d);
  51. void ofono_call_volume_driver_unregister(
  52. const struct ofono_call_volume_driver *d);
  53. struct ofono_call_volume *ofono_call_volume_create(struct ofono_modem *modem,
  54. unsigned int vendor, const char *driver, void *data);
  55. void ofono_call_volume_register(struct ofono_call_volume *cv);
  56. void ofono_call_volume_remove(struct ofono_call_volume *cv);
  57. void ofono_call_volume_set_data(struct ofono_call_volume *cv, void *data);
  58. void *ofono_call_volume_get_data(struct ofono_call_volume *cv);
  59. #ifdef __cplusplus
  60. }
  61. #endif
  62. #endif /* __OFONO_CALL_VOLUME_H */