iaddressbook.php 2.7 KB

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