選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

IAddressBook.php 3.3KB

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