INotification.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Joas Schilling <coding@schilljs.com>
  6. *
  7. * @license AGPL-3.0
  8. *
  9. * This code is free software: you can redistribute it and/or modify
  10. * it under the terms of the GNU Affero General Public License, version 3,
  11. * as published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Affero General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public License, version 3,
  19. * along with this program. If not, see <http://www.gnu.org/licenses/>
  20. *
  21. */
  22. namespace OCP\Notification;
  23. /**
  24. * Interface INotification
  25. *
  26. * @package OCP\Notification
  27. * @since 9.0.0
  28. */
  29. interface INotification {
  30. /**
  31. * @param string $app
  32. * @return $this
  33. * @throws \InvalidArgumentException if the app id are invalid
  34. * @since 9.0.0
  35. */
  36. public function setApp($app);
  37. /**
  38. * @return string
  39. * @since 9.0.0
  40. */
  41. public function getApp();
  42. /**
  43. * @param string $user
  44. * @return $this
  45. * @throws \InvalidArgumentException if the user id are invalid
  46. * @since 9.0.0
  47. */
  48. public function setUser($user);
  49. /**
  50. * @return string
  51. * @since 9.0.0
  52. */
  53. public function getUser();
  54. /**
  55. * @param \DateTime $dateTime
  56. * @return $this
  57. * @throws \InvalidArgumentException if the $dateTime is invalid
  58. * @since 9.0.0
  59. */
  60. public function setDateTime(\DateTime $dateTime);
  61. /**
  62. * @return \DateTime
  63. * @since 9.0.0
  64. */
  65. public function getDateTime();
  66. /**
  67. * @param string $type
  68. * @param string $id
  69. * @return $this
  70. * @throws \InvalidArgumentException if the object type or id is invalid
  71. * @since 9.0.0
  72. */
  73. public function setObject($type, $id);
  74. /**
  75. * @return string
  76. * @since 9.0.0
  77. */
  78. public function getObjectType();
  79. /**
  80. * @return string
  81. * @since 9.0.0
  82. */
  83. public function getObjectId();
  84. /**
  85. * @param string $subject
  86. * @param array $parameters
  87. * @return $this
  88. * @throws \InvalidArgumentException if the subject or parameters are invalid
  89. * @since 9.0.0
  90. */
  91. public function setSubject($subject, array $parameters = []);
  92. /**
  93. * @return string
  94. * @since 9.0.0
  95. */
  96. public function getSubject();
  97. /**
  98. * @return string[]
  99. * @since 9.0.0
  100. */
  101. public function getSubjectParameters();
  102. /**
  103. * @param string $subject
  104. * @return $this
  105. * @throws \InvalidArgumentException if the subject are invalid
  106. * @since 9.0.0
  107. */
  108. public function setParsedSubject($subject);
  109. /**
  110. * @return string
  111. * @since 9.0.0
  112. */
  113. public function getParsedSubject();
  114. /**
  115. * @param string $message
  116. * @param array $parameters
  117. * @return $this
  118. * @throws \InvalidArgumentException if the message or parameters are invalid
  119. * @since 9.0.0
  120. */
  121. public function setMessage($message, array $parameters = []);
  122. /**
  123. * @return string
  124. * @since 9.0.0
  125. */
  126. public function getMessage();
  127. /**
  128. * @return string[]
  129. * @since 9.0.0
  130. */
  131. public function getMessageParameters();
  132. /**
  133. * @param string $message
  134. * @return $this
  135. * @throws \InvalidArgumentException if the message are invalid
  136. * @since 9.0.0
  137. */
  138. public function setParsedMessage($message);
  139. /**
  140. * @return string
  141. * @since 9.0.0
  142. */
  143. public function getParsedMessage();
  144. /**
  145. * @param string $link
  146. * @return $this
  147. * @throws \InvalidArgumentException if the link are invalid
  148. * @since 9.0.0
  149. */
  150. public function setLink($link);
  151. /**
  152. * @return string
  153. * @since 9.0.0
  154. */
  155. public function getLink();
  156. /**
  157. * @return IAction
  158. * @since 9.0.0
  159. */
  160. public function createAction();
  161. /**
  162. * @param IAction $action
  163. * @return $this
  164. * @throws \InvalidArgumentException if the action are invalid
  165. * @since 9.0.0
  166. */
  167. public function addAction(IAction $action);
  168. /**
  169. * @return IAction[]
  170. * @since 9.0.0
  171. */
  172. public function getActions();
  173. /**
  174. * @param IAction $action
  175. * @return $this
  176. * @throws \InvalidArgumentException if the action are invalid
  177. * @since 9.0.0
  178. */
  179. public function addParsedAction(IAction $action);
  180. /**
  181. * @return IAction[]
  182. * @since 9.0.0
  183. */
  184. public function getParsedActions();
  185. /**
  186. * @return bool
  187. * @since 9.0.0
  188. */
  189. public function isValid();
  190. /**
  191. * @return bool
  192. * @since 9.0.0
  193. */
  194. public function isValidParsed();
  195. }