IAvatarManager.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2016, ownCloud, Inc.
  5. *
  6. * @author Christopher Schäpers <kondou@ts.unde.re>
  7. * @author John Molakvoæ <skjnldsv@protonmail.com>
  8. * @author Michael Weimann <mail@michael-weimann.eu>
  9. * @author Morris Jobke <hey@morrisjobke.de>
  10. * @author Robin McCorkell <robin@mccorkell.me.uk>
  11. * @author Roeland Jago Douma <roeland@famdouma.nl>
  12. *
  13. * @license AGPL-3.0
  14. *
  15. * This code is free software: you can redistribute it and/or modify
  16. * it under the terms of the GNU Affero General Public License, version 3,
  17. * as published by the Free Software Foundation.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU Affero General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU Affero General Public License, version 3,
  25. * along with this program. If not, see <http://www.gnu.org/licenses/>
  26. *
  27. */
  28. namespace OCP;
  29. /**
  30. * This class provides avatar functionality
  31. * @since 6.0.0
  32. */
  33. interface IAvatarManager {
  34. /**
  35. * Return a user specific instance of \OCP\IAvatar
  36. * @see IAvatar
  37. * @param string $userId the Nextcloud user id
  38. * @throws \Exception In case the username is potentially dangerous
  39. * @throws \OCP\Files\NotFoundException In case there is no user folder yet
  40. * @since 6.0.0
  41. */
  42. public function getAvatar(string $userId): IAvatar;
  43. /**
  44. * Returns a guest user avatar instance.
  45. *
  46. * @param string $name The guest name, e.g. "Albert".
  47. * @return IAvatar
  48. * @since 16.0.0
  49. */
  50. public function getGuestAvatar(string $name): IAvatar;
  51. }