ITrashItem.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2018 Robin Appelman <robin@icewind.nl>
  4. *
  5. * @license GNU AGPL version 3 or any later version
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU Affero General Public License as
  9. * published by the Free Software Foundation, either version 3 of the
  10. * License, or (at your option) any later version.
  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
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. *
  20. */
  21. namespace OCA\Files_Trashbin\Trash;
  22. use OCP\Files\FileInfo;
  23. use OCP\IUser;
  24. /**
  25. * @since 15.0.0
  26. */
  27. interface ITrashItem extends FileInfo {
  28. /**
  29. * Get the trash backend for this item
  30. *
  31. * @return ITrashBackend
  32. * @since 15.0.0
  33. */
  34. public function getTrashBackend(): ITrashBackend;
  35. /**
  36. * Get the original location for the trash item
  37. *
  38. * @return string
  39. * @since 15.0.0
  40. */
  41. public function getOriginalLocation(): string;
  42. /**
  43. * Get the timestamp that the file was moved to trash
  44. *
  45. * @return int
  46. * @since 15.0.0
  47. */
  48. public function getDeletedTime(): int;
  49. /**
  50. * Get the path of the item relative to the users trashbin
  51. *
  52. * @return string
  53. * @since 15.0.0
  54. */
  55. public function getTrashPath(): string;
  56. /**
  57. * Whether the item is a deleted item in the root of the trash, or a file in a subfolder
  58. *
  59. * @return bool
  60. * @since 15.0.0
  61. */
  62. public function isRootItem(): bool;
  63. /**
  64. * Get the user for which this trash item applies
  65. *
  66. * @return IUser
  67. * @since 15.0.0
  68. */
  69. public function getUser(): IUser;
  70. }