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.

138 lines
2.7 KiB

3 years ago
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright 2018, Maxence Lange <maxence@artificial-owl.com>
  5. *
  6. * @author Julius Härtl <jus@bitgrid.net>
  7. * @author Maxence Lange <maxence@artificial-owl.com>
  8. *
  9. * @license GNU AGPL version 3 or any later version
  10. *
  11. * This program is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU Affero General Public License as
  13. * published by the Free Software Foundation, either version 3 of the
  14. * License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU Affero General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Affero General Public License
  22. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  23. *
  24. */
  25. namespace OCP\Dashboard\Model;
  26. use OCP\Dashboard\IDashboardWidget;
  27. /**
  28. * Interface IWidgetRequest
  29. *
  30. * WidgetRequest are created by the Dashboard App and used to communicate from
  31. * the frontend to the backend.
  32. * The object is send to the WidgetClass using IDashboardWidget::requestWidget
  33. *
  34. * @see IDashboardWidget::requestWidget
  35. *
  36. * @since 15.0.0
  37. * @deprecated 20.0.0
  38. *
  39. */
  40. interface IWidgetRequest {
  41. /**
  42. * Get the widgetId.
  43. *
  44. * @since 15.0.0
  45. * @deprecated 20.0.0
  46. *
  47. * @return string
  48. */
  49. public function getWidgetId(): string;
  50. /**
  51. * Get the WidgetClass.
  52. *
  53. * @since 15.0.0
  54. * @deprecated 20.0.0
  55. *
  56. * @return IDashboardWidget
  57. */
  58. public function getWidget(): IDashboardWidget;
  59. /**
  60. * Get the 'request' string sent by the request from the front-end with
  61. * the format:
  62. *
  63. * net.requestWidget(
  64. * {
  65. * widget: widgetId,
  66. * request: request,
  67. * value: value
  68. * },
  69. * callback);
  70. *
  71. * @since 15.0.0
  72. * @deprecated 20.0.0
  73. *
  74. * @return string
  75. */
  76. public function getRequest(): string;
  77. /**
  78. * Get the 'value' string sent by the request from the front-end.
  79. *
  80. * @see getRequest
  81. *
  82. * @since 15.0.0
  83. * @deprecated 20.0.0
  84. *
  85. * @return string
  86. */
  87. public function getValue(): string;
  88. /**
  89. * Returns the result.
  90. *
  91. * @since 15.0.0
  92. * @deprecated 20.0.0
  93. *
  94. * @return array
  95. */
  96. public function getResult(): array;
  97. /**
  98. * add a result (as string)
  99. *
  100. * @since 15.0.0
  101. * @deprecated 20.0.0
  102. *
  103. * @param string $key
  104. * @param string $result
  105. *
  106. * @return $this
  107. */
  108. public function addResult(string $key, string $result): IWidgetRequest;
  109. /**
  110. * add a result (as array)
  111. *
  112. * @since 15.0.0
  113. * @deprecated 20.0.0
  114. *
  115. * @param string $key
  116. * @param array $result
  117. *
  118. * @return $this
  119. */
  120. public function addResultArray(string $key, array $result): IWidgetRequest;
  121. }