INotification.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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 is 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 is 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 is 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 $subject
  116. * @param array $parameters
  117. * @return $this
  118. * @throws \InvalidArgumentException if the subject or parameters are invalid
  119. * @since 11.0.0
  120. */
  121. public function setRichSubject($subject, array $parameters = []);
  122. /**
  123. * @return string
  124. * @since 11.0.0
  125. */
  126. public function getRichSubject();
  127. /**
  128. * @return array[]
  129. * @since 11.0.0
  130. */
  131. public function getRichSubjectParameters();
  132. /**
  133. * @param string $message
  134. * @param array $parameters
  135. * @return $this
  136. * @throws \InvalidArgumentException if the message or parameters are invalid
  137. * @since 9.0.0
  138. */
  139. public function setMessage($message, array $parameters = []);
  140. /**
  141. * @return string
  142. * @since 9.0.0
  143. */
  144. public function getMessage();
  145. /**
  146. * @return string[]
  147. * @since 9.0.0
  148. */
  149. public function getMessageParameters();
  150. /**
  151. * @param string $message
  152. * @return $this
  153. * @throws \InvalidArgumentException if the message is invalid
  154. * @since 9.0.0
  155. */
  156. public function setParsedMessage($message);
  157. /**
  158. * @return string
  159. * @since 9.0.0
  160. */
  161. public function getParsedMessage();
  162. /**
  163. * @param string $message
  164. * @param array $parameters
  165. * @return $this
  166. * @throws \InvalidArgumentException if the message or parameters are invalid
  167. * @since 11.0.0
  168. */
  169. public function setRichMessage($message, array $parameters = []);
  170. /**
  171. * @return string
  172. * @since 11.0.0
  173. */
  174. public function getRichMessage();
  175. /**
  176. * @return array[]
  177. * @since 11.0.0
  178. */
  179. public function getRichMessageParameters();
  180. /**
  181. * @param string $link
  182. * @return $this
  183. * @throws \InvalidArgumentException if the link is invalid
  184. * @since 9.0.0
  185. */
  186. public function setLink($link);
  187. /**
  188. * @return string
  189. * @since 9.0.0
  190. */
  191. public function getLink();
  192. /**
  193. * @param string $icon
  194. * @return $this
  195. * @throws \InvalidArgumentException if the icon is invalid
  196. * @since 11.0.0
  197. */
  198. public function setIcon($icon);
  199. /**
  200. * @return string
  201. * @since 11.0.0
  202. */
  203. public function getIcon();
  204. /**
  205. * @return IAction
  206. * @since 9.0.0
  207. */
  208. public function createAction();
  209. /**
  210. * @param IAction $action
  211. * @return $this
  212. * @throws \InvalidArgumentException if the action is invalid
  213. * @since 9.0.0
  214. */
  215. public function addAction(IAction $action);
  216. /**
  217. * @return IAction[]
  218. * @since 9.0.0
  219. */
  220. public function getActions();
  221. /**
  222. * @param IAction $action
  223. * @return $this
  224. * @throws \InvalidArgumentException if the action is invalid
  225. * @since 9.0.0
  226. */
  227. public function addParsedAction(IAction $action);
  228. /**
  229. * @return IAction[]
  230. * @since 9.0.0
  231. */
  232. public function getParsedActions();
  233. /**
  234. * @return bool
  235. * @since 9.0.0
  236. */
  237. public function isValid();
  238. /**
  239. * @return bool
  240. * @since 9.0.0
  241. */
  242. public function isValidParsed();
  243. }