diff options
author | kondou <kondou@ts.unde.re> | 2013-09-20 11:46:11 +0200 |
---|---|---|
committer | kondou <kondou@ts.unde.re> | 2013-11-07 12:48:40 +0100 |
commit | 507325dd501c89972d5c820bcfefb3aab8b81e34 (patch) | |
tree | 3932f9a6262f344778f922a3ada87189d7c64172 /lib/public/iavatarmanager.php | |
parent | 263603aa4cf6747460c13443c400f53d90a31bf1 (diff) | |
download | nextcloud-server-507325dd501c89972d5c820bcfefb3aab8b81e34.tar.gz nextcloud-server-507325dd501c89972d5c820bcfefb3aab8b81e34.zip |
Add public API for \OC\Avatar
Diffstat (limited to 'lib/public/iavatarmanager.php')
-rw-r--r-- | lib/public/iavatarmanager.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/public/iavatarmanager.php b/lib/public/iavatarmanager.php new file mode 100644 index 00000000000..818dbb124af --- /dev/null +++ b/lib/public/iavatarmanager.php @@ -0,0 +1,38 @@ +<?php +/** + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCP; + +/** + * This class provides avatar functionality + */ + +interface IAvatarManager { + + /** + * @brief get the users avatar + * @param $size integer size in px of the avatar, avatars are square, defaults to 64 + * @return boolean|\OC_Image containing the avatar or false if there's no image + */ + function get($size = 64); + + /** + * @brief sets the users avatar + * @param $data mixed imagedata or path to set a new avatar + * @throws Exception if the provided file is not a jpg or png image + * @throws Exception if the provided image is not valid + * @throws \OCP\NotSquareException if the image is not square + * @return void + */ + function set($data); + + /** + * @brief remove the users avatar + * @return void + */ + function remove(); +} |