IUserStatus.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\UserStatus;
  8. use DateTimeImmutable;
  9. /**
  10. * Interface IUserStatus
  11. *
  12. * @since 20.0.0
  13. */
  14. interface IUserStatus {
  15. /**
  16. * @var string
  17. * @since 20.0.0
  18. */
  19. public const ONLINE = 'online';
  20. /**
  21. * @var string
  22. * @since 20.0.0
  23. */
  24. public const AWAY = 'away';
  25. /**
  26. * @var string
  27. * @since 20.0.0
  28. */
  29. public const DND = 'dnd';
  30. /**
  31. * @var string
  32. * @since 28.0.0
  33. */
  34. public const BUSY = 'busy';
  35. /**
  36. * @var string
  37. * @since 20.0.0
  38. */
  39. public const OFFLINE = 'offline';
  40. /**
  41. * @var string
  42. * @since 20.0.0
  43. */
  44. public const INVISIBLE = 'invisible';
  45. /**
  46. * @var string
  47. * @since 25.0.0
  48. */
  49. public const MESSAGE_CALL = 'call';
  50. /**
  51. * @var string
  52. * @since 25.0.0
  53. */
  54. public const MESSAGE_AVAILABILITY = 'availability';
  55. /**
  56. * @var string
  57. * @since 28.0.1
  58. */
  59. public const MESSAGE_OUT_OF_OFFICE = 'out-of-office';
  60. /**
  61. * @var string
  62. * @since 28.0.0
  63. */
  64. public const MESSAGE_VACATION = 'vacationing';
  65. /**
  66. * @var string
  67. * @since 28.0.0
  68. */
  69. public const MESSAGE_CALENDAR_BUSY = 'meeting';
  70. /**
  71. * @var string
  72. * @since 28.0.0
  73. */
  74. public const MESSAGE_CALENDAR_BUSY_TENTATIVE = 'busy-tentative';
  75. /**
  76. * Get the user this status is connected to
  77. *
  78. * @return string
  79. * @since 20.0.0
  80. */
  81. public function getUserId():string;
  82. /**
  83. * Get the status
  84. *
  85. * It will return one of the constants defined above.
  86. * It will never return invisible. In case a user marked
  87. * themselves as invisible, it will return offline.
  88. *
  89. * @return string See IUserStatus constants
  90. * @since 20.0.0
  91. */
  92. public function getStatus():string;
  93. /**
  94. * Get a custom message provided by the user
  95. *
  96. * @return string|null
  97. * @since 20.0.0
  98. */
  99. public function getMessage():?string;
  100. /**
  101. * Get a custom icon provided by the user
  102. *
  103. * @return string|null
  104. * @since 20.0.0
  105. */
  106. public function getIcon():?string;
  107. /**
  108. * Gets the time that the custom status will be cleared at
  109. *
  110. * @return DateTimeImmutable|null
  111. * @since 20.0.0
  112. */
  113. public function getClearAt():?DateTimeImmutable;
  114. }