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.

111 lines
2.2 KiB

3 years ago
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2020, Georg Ehrke
  5. *
  6. * @author Georg Ehrke <oc.list@georgehrke.com>
  7. *
  8. * @license GNU AGPL version 3 or any later version
  9. *
  10. * This program is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License as
  12. * published by the Free Software Foundation, either version 3 of the
  13. * License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU Affero General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Affero General Public License
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. *
  23. */
  24. namespace OCP\UserStatus;
  25. use DateTimeImmutable;
  26. /**
  27. * Interface IUserStatus
  28. *
  29. * @since 20.0.0
  30. */
  31. interface IUserStatus {
  32. /**
  33. * @var string
  34. * @since 20.0.0
  35. */
  36. public const ONLINE = 'online';
  37. /**
  38. * @var string
  39. * @since 20.0.0
  40. */
  41. public const AWAY = 'away';
  42. /**
  43. * @var string
  44. * @since 20.0.0
  45. */
  46. public const DND = 'dnd';
  47. /**
  48. * @var string
  49. * @since 20.0.0
  50. */
  51. public const OFFLINE = 'offline';
  52. /**
  53. * @var string
  54. * @since 20.0.0
  55. */
  56. public const INVISIBLE = 'invisible';
  57. /**
  58. * Get the user this status is connected to
  59. *
  60. * @return string
  61. * @since 20.0.0
  62. */
  63. public function getUserId():string;
  64. /**
  65. * Get the status
  66. *
  67. * It will return one of the constants defined above.
  68. * It will never return invisible. In case a user marked
  69. * themselves as invisible, it will return offline.
  70. *
  71. * @return string See IUserStatus constants
  72. * @since 20.0.0
  73. */
  74. public function getStatus():string;
  75. /**
  76. * Get a custom message provided by the user
  77. *
  78. * @return string|null
  79. * @since 20.0.0
  80. */
  81. public function getMessage():?string;
  82. /**
  83. * Get a custom icon provided by the user
  84. *
  85. * @return string|null
  86. * @since 20.0.0
  87. */
  88. public function getIcon():?string;
  89. /**
  90. * Gets the time that the custom status will be cleared at
  91. *
  92. * @return DateTimeImmutable|null
  93. * @since 20.0.0
  94. */
  95. public function getClearAt():?DateTimeImmutable;
  96. }