1
0

INotification.php 5.4 KB

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