iaddressbook.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. /**
  3. * @author Bart Visscher <bartv@thisnet.nl>
  4. * @author Morris Jobke <hey@morrisjobke.de>
  5. * @author Robin McCorkell <robin@mccorkell.me.uk>
  6. * @author Thomas Müller <thomas.mueller@tmit.eu>
  7. *
  8. * @copyright Copyright (c) 2016, 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. /**
  32. * Interface IAddressBook
  33. *
  34. * @package OCP
  35. * @since 5.0.0
  36. */
  37. interface IAddressBook {
  38. /**
  39. * @return string defining the technical unique key
  40. * @since 5.0.0
  41. */
  42. public function getKey();
  43. /**
  44. * In comparison to getKey() this function returns a human readable (maybe translated) name
  45. * @return mixed
  46. * @since 5.0.0
  47. */
  48. public function getDisplayName();
  49. /**
  50. * @param string $pattern which should match within the $searchProperties
  51. * @param array $searchProperties defines the properties within the query pattern should match
  52. * @param array $options - for future use. One should always have options!
  53. * @return array an array of contacts which are arrays of key-value-pairs
  54. * @since 5.0.0
  55. */
  56. public function search($pattern, $searchProperties, $options);
  57. // // dummy results
  58. // return array(
  59. // array('id' => 0, 'FN' => 'Thomas Müller', 'EMAIL' => 'a@b.c', 'GEO' => '37.386013;-122.082932'),
  60. // array('id' => 5, 'FN' => 'Thomas Tanghus', 'EMAIL' => array('d@e.f', 'g@h.i')),
  61. // );
  62. /**
  63. * @param array $properties this array if key-value-pairs defines a contact
  64. * @return array an array representing the contact just created or updated
  65. * @since 5.0.0
  66. */
  67. public function createOrUpdate($properties);
  68. // // dummy
  69. // return array('id' => 0, 'FN' => 'Thomas Müller', 'EMAIL' => 'a@b.c',
  70. // 'PHOTO' => 'VALUE=uri:http://www.abc.com/pub/photos/jqpublic.gif',
  71. // 'ADR' => ';;123 Main Street;Any Town;CA;91921-1234'
  72. // );
  73. /**
  74. * @return mixed
  75. * @since 5.0.0
  76. */
  77. public function getPermissions();
  78. /**
  79. * @param object $id the unique identifier to a contact
  80. * @return bool successful or not
  81. * @since 5.0.0
  82. */
  83. public function delete($id);
  84. }
  85. }