imanager.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <?php
  2. /**
  3. * @author Joas Schilling <nickvergessen@owncloud.com>
  4. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  5. * @author Morris Jobke <hey@morrisjobke.de>
  6. * @author Thomas Müller <thomas.mueller@tmit.eu>
  7. *
  8. * @copyright Copyright (c) 2015, ownCloud, Inc.
  9. * @license AGPL-3.0
  10. *
  11. * This code is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU Affero General Public License, version 3,
  13. * as published by the Free Software Foundation.
  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, version 3,
  21. * along with this program. If not, see <http://www.gnu.org/licenses/>
  22. *
  23. */
  24. /**
  25. * Public interface of ownCloud for apps to use.
  26. * Activity/IManager interface
  27. */
  28. // use OCP namespace for all classes that are considered public.
  29. // This means that they should be used by apps instead of the internal ownCloud classes
  30. namespace OCP\Activity;
  31. interface IManager {
  32. /**
  33. * @param $app
  34. * @param $subject
  35. * @param $subjectParams
  36. * @param $message
  37. * @param $messageParams
  38. * @param $file
  39. * @param $link
  40. * @param $affectedUser
  41. * @param $type
  42. * @param $priority
  43. * @return mixed
  44. */
  45. function publishActivity($app, $subject, $subjectParams, $message, $messageParams, $file, $link, $affectedUser, $type, $priority);
  46. /**
  47. * In order to improve lazy loading a closure can be registered which will be called in case
  48. * activity consumers are actually requested
  49. *
  50. * $callable has to return an instance of \OCP\Activity\IConsumer
  51. *
  52. * @param \Closure $callable
  53. * @return void
  54. */
  55. function registerConsumer(\Closure $callable);
  56. /**
  57. * In order to improve lazy loading a closure can be registered which will be called in case
  58. * activity consumers are actually requested
  59. *
  60. * $callable has to return an instance of \OCP\Activity\IExtension
  61. *
  62. * @param \Closure $callable
  63. * @return void
  64. */
  65. function registerExtension(\Closure $callable);
  66. /**
  67. * Will return additional notification types as specified by other apps
  68. * @param string $languageCode
  69. * @return array
  70. */
  71. function getNotificationTypes($languageCode);
  72. /**
  73. * @param string $method
  74. * @return array
  75. */
  76. function getDefaultTypes($method);
  77. /**
  78. * @param string $type
  79. * @return string
  80. */
  81. function getTypeIcon($type);
  82. /**
  83. * @param string $app
  84. * @param string $text
  85. * @param array $params
  86. * @param boolean $stripPath
  87. * @param boolean $highlightParams
  88. * @param string $languageCode
  89. * @return string|false
  90. */
  91. function translate($app, $text, $params, $stripPath, $highlightParams, $languageCode);
  92. /**
  93. * @param string $app
  94. * @param string $text
  95. * @return array|false
  96. */
  97. function getSpecialParameterList($app, $text);
  98. /**
  99. * @param array $activity
  100. * @return integer|false
  101. */
  102. function getGroupParameter($activity);
  103. /**
  104. * @return array
  105. */
  106. function getNavigation();
  107. /**
  108. * @param string $filterValue
  109. * @return boolean
  110. */
  111. function isFilterValid($filterValue);
  112. /**
  113. * @param array $types
  114. * @param string $filter
  115. * @return array
  116. */
  117. function filterNotificationTypes($types, $filter);
  118. /**
  119. * @param string $filter
  120. * @return array
  121. */
  122. function getQueryForFilter($filter);
  123. }