You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ishare.php 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <?php
  2. /**
  3. * @author Roeland Jago Douma <rullzer@owncloud.com>
  4. *
  5. * @copyright Copyright (c) 2016, ownCloud, Inc.
  6. * @license AGPL-3.0
  7. *
  8. * This code is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Affero General Public License, version 3,
  10. * as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Affero General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Affero General Public License, version 3,
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>
  19. *
  20. */
  21. namespace OCP\Share;
  22. use OCP\Files\File;
  23. use OCP\Files\Folder;
  24. use OCP\Files\Node;
  25. use OCP\IUser;
  26. use OCP\IGroup;
  27. /**
  28. * Interface IShare
  29. *
  30. * @package OCP\Share
  31. * @since 9.0.0
  32. */
  33. interface IShare {
  34. /**
  35. * Get the internal id of the share.
  36. *
  37. * @return string
  38. * @since 9.0.0
  39. */
  40. public function getId();
  41. /**
  42. * Get the full share id. This is the <providerid>:<internalid>.
  43. * The full id is unique in the system.
  44. *
  45. * @return string
  46. * @since 9.0.0
  47. */
  48. public function getFullId();
  49. /**
  50. * Set the node of the file/folder that is shared
  51. *
  52. * @param File|Folder $path
  53. * @return \OCP\Share\IShare The modified object
  54. * @since 9.0.0
  55. */
  56. public function setNode(Node $path);
  57. /**
  58. * Get the node of the file/folder that is shared
  59. *
  60. * @return File|Folder
  61. * @since 9.0.0
  62. */
  63. public function getNode();
  64. /**
  65. * Set the shareType
  66. *
  67. * @param int $shareType
  68. * @return \OCP\Share\IShare The modified object
  69. * @since 9.0.0
  70. */
  71. public function setShareType($shareType);
  72. /**
  73. * Get the shareType
  74. *
  75. * @return int
  76. * @since 9.0.0
  77. */
  78. public function getShareType();
  79. /**
  80. * Set the receiver of this share.
  81. *
  82. * @param IUser|IGroup
  83. * @return \OCP\Share\IShare The modified object
  84. * @since 9.0.0
  85. */
  86. public function setSharedWith($sharedWith);
  87. /**
  88. * Get the receiver of this share.
  89. *
  90. * @return IUser|IGroup
  91. * @since 9.0.0
  92. */
  93. public function getSharedWith();
  94. /**
  95. * Set the permissions.
  96. * See \OCP\Constants::PERMISSION_*
  97. *
  98. * @param int $permissions
  99. * @return \OCP\Share\IShare The modified object
  100. * @since 9.0.0
  101. */
  102. public function setPermissions($permissions);
  103. /**
  104. * Get the share permissions
  105. * See \OCP\Constants::PERMISSION_*
  106. *
  107. * @return int
  108. * @since 9.0.0
  109. */
  110. public function getPermissions();
  111. /**
  112. * Set the expiration date
  113. *
  114. * @param \DateTime $expireDate
  115. * @return \OCP\Share\IShare The modified object
  116. * @since 9.0.0
  117. */
  118. public function setExpirationDate($expireDate);
  119. /**
  120. * Get the expiration date
  121. *
  122. * @return \DateTime
  123. * @since 9.0.0
  124. */
  125. public function getExpirationDate();
  126. /**
  127. * Set the sharer of the path.
  128. *
  129. * @param IUser $sharedBy
  130. * @return \OCP\Share\IShare The modified object
  131. * @since 9.0.0
  132. */
  133. public function setSharedBy($sharedBy);
  134. /**
  135. * Get share sharer
  136. *
  137. * @return IUser
  138. * @since 9.0.0
  139. */
  140. public function getSharedBy();
  141. /**
  142. * Set the original share owner (who owns the path that is shared)
  143. *
  144. * @param IUser
  145. * @return \OCP\Share\IShare The modified object
  146. * @since 9.0.0
  147. */
  148. public function setShareOwner($shareOwner);
  149. /**
  150. * Get the original share owner (who owns the path that is shared)
  151. *
  152. * @return IUser
  153. * @since 9.0.0
  154. */
  155. public function getShareOwner();
  156. /**
  157. * Set the password for this share.
  158. * When the share is passed to the share manager to be created
  159. * or updated the password will be hashed.
  160. *
  161. * @param string $password
  162. * @return \OCP\Share\IShare The modified object
  163. * @since 9.0.0
  164. */
  165. public function setPassword($password);
  166. /**
  167. * Get the password of this share.
  168. * If this share is obtained via a shareprovider the password is
  169. * hashed.
  170. *
  171. * @return string
  172. * @since 9.0.0
  173. */
  174. public function getPassword();
  175. /**
  176. * Set the public link token.
  177. *
  178. * @param string $token
  179. * @return \OCP\Share\IShare The modified object
  180. * @since 9.0.0
  181. */
  182. public function setToken($token);
  183. /**
  184. * Get the public link token.
  185. *
  186. * @return string
  187. * @since 9.0.0
  188. */
  189. public function getToken();
  190. /**
  191. * Set the target path of this share relative to the recipients user folder.
  192. *
  193. * @param string $target
  194. * @return \OCP\Share\IShare The modified object
  195. * @since 9.0.0
  196. */
  197. public function setTarget($target);
  198. /**
  199. * Get the target path of this share relative to the recipients user folder.
  200. *
  201. * @return string
  202. * @since 9.0.0
  203. */
  204. public function getTarget();
  205. /**
  206. * Set the time this share was created
  207. *
  208. * @param \DateTime $shareTime
  209. * @return \OCP\Share\IShare The modified object
  210. * @since 9.0.0
  211. */
  212. public function setShareTime(\DateTime $shareTime);
  213. /**
  214. * Get the timestamp this share was created
  215. *
  216. * @return \DateTime
  217. * @since 9.0.0
  218. */
  219. public function getShareTime();
  220. /**
  221. * Set if the recipient is informed by mail about the share.
  222. *
  223. * @param bool $mailSend
  224. * @return \OCP\Share\IShare The modified object
  225. * @since 9.0.0
  226. */
  227. public function setMailSend($mailSend);
  228. /**
  229. * Get if the recipient informed by mail about the share.
  230. *
  231. * @return bool
  232. * @since 9.0.0
  233. */
  234. public function getMailSend();
  235. }