iaddressbook.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. /**
  23. * Public interface of ownCloud for apps to use.
  24. * IAddressBook interface
  25. */
  26. // use OCP namespace for all classes that are considered public.
  27. // This means that they should be used by apps instead of the internal ownCloud classes
  28. namespace OCP {
  29. interface IAddressBook {
  30. /**
  31. * @return string defining the technical unique key
  32. */
  33. public function getKey();
  34. /**
  35. * In comparison to getKey() this function returns a human readable (maybe translated) name
  36. * @return mixed
  37. */
  38. public function getDisplayName();
  39. /**
  40. * @param string $pattern which should match within the $searchProperties
  41. * @param array $searchProperties defines the properties within the query pattern should match
  42. * @param array $options - for future use. One should always have options!
  43. * @return array an array of contacts which are arrays of key-value-pairs
  44. */
  45. public function search($pattern, $searchProperties, $options);
  46. // // dummy results
  47. // return array(
  48. // array('id' => 0, 'FN' => 'Thomas Müller', 'EMAIL' => 'a@b.c', 'GEO' => '37.386013;-122.082932'),
  49. // array('id' => 5, 'FN' => 'Thomas Tanghus', 'EMAIL' => array('d@e.f', 'g@h.i')),
  50. // );
  51. /**
  52. * @param array $properties this array if key-value-pairs defines a contact
  53. * @return array an array representing the contact just created or updated
  54. */
  55. public function createOrUpdate($properties);
  56. // // dummy
  57. // return array('id' => 0, 'FN' => 'Thomas Müller', 'EMAIL' => 'a@b.c',
  58. // 'PHOTO' => 'VALUE=uri:http://www.abc.com/pub/photos/jqpublic.gif',
  59. // 'ADR' => ';;123 Main Street;Any Town;CA;91921-1234'
  60. // );
  61. /**
  62. * @return mixed
  63. */
  64. public function getPermissions();
  65. /**
  66. * @param object $id the unique identifier to a contact
  67. * @return bool successful or not
  68. */
  69. public function delete($id);
  70. }
  71. }