iaddressbook.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. /**
  3. * ownCloud
  4. *
  5. * @author Thomas Müller
  6. * @copyright 2012 Thomas Müller thomas.mueller@tmit.eu
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  10. * License as published by the Free Software Foundation; either
  11. * version 3 of the License, or any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public
  19. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. // use OCP namespace for all classes that are considered public.
  23. // This means that they should be used by apps instead of the internal ownCloud classes
  24. namespace OCP {
  25. interface IAddressBook {
  26. /**
  27. * @return string defining the technical unique key
  28. */
  29. public function getKey();
  30. /**
  31. * In comparison to getKey() this function returns a human readable (maybe translated) name
  32. * @return mixed
  33. */
  34. public function getDisplayName();
  35. /**
  36. * @param string $pattern which should match within the $searchProperties
  37. * @param array $searchProperties defines the properties within the query pattern should match
  38. * @param array $options - for future use. One should always have options!
  39. * @return array of contacts which are arrays of key-value-pairs
  40. */
  41. public function search($pattern, $searchProperties, $options);
  42. // // dummy results
  43. // return array(
  44. // array('id' => 0, 'FN' => 'Thomas Müller', 'EMAIL' => 'a@b.c', 'GEO' => '37.386013;-122.082932'),
  45. // array('id' => 5, 'FN' => 'Thomas Tanghus', 'EMAIL' => array('d@e.f', 'g@h.i')),
  46. // );
  47. /**
  48. * @param array $properties this array if key-value-pairs defines a contact
  49. * @return array representing the contact just created or updated
  50. */
  51. public function createOrUpdate($properties);
  52. // // dummy
  53. // return array('id' => 0, 'FN' => 'Thomas Müller', 'EMAIL' => 'a@b.c',
  54. // 'PHOTO' => 'VALUE=uri:http://www.abc.com/pub/photos/jqpublic.gif',
  55. // 'ADR' => ';;123 Main Street;Any Town;CA;91921-1234'
  56. // );
  57. /**
  58. * @return mixed
  59. */
  60. public function getPermissions();
  61. /**
  62. * @param object $id the unique identifier to a contact
  63. * @return bool successful or not
  64. */
  65. public function delete($id);
  66. }
  67. }