iavatar.php 861 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * This file is licensed under the Affero General Public License version 3 or
  4. * later.
  5. * See the COPYING-README file.
  6. */
  7. namespace OCP;
  8. /**
  9. * This class provides avatar functionality
  10. */
  11. interface IAvatar {
  12. /**
  13. * get the users avatar
  14. * @param int $size size in px of the avatar, avatars are square, defaults to 64
  15. * @return boolean|\OC_Image containing the avatar or false if there's no image
  16. */
  17. function get($size = 64);
  18. /**
  19. * sets the users avatar
  20. * @param Image $data mixed imagedata or path to set a new avatar
  21. * @throws \Exception if the provided file is not a jpg or png image
  22. * @throws \Exception if the provided image is not valid
  23. * @throws \OC\NotSquareException if the image is not square
  24. * @return void
  25. */
  26. function set($data);
  27. /**
  28. * remove the users avatar
  29. * @return void
  30. */
  31. function remove();
  32. }