1
0

IWidgetConfig.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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 IWidgetConfig
  29. *
  30. * This object contains the configuration of a widget for a userId
  31. *
  32. * @see IDashboardWidget::loadWidget
  33. *
  34. * @since 15.0.0
  35. * @deprecated 20.0.0
  36. *
  37. */
  38. interface IWidgetConfig {
  39. /**
  40. * Returns the userId
  41. *
  42. * @since 15.0.0
  43. * @deprecated 20.0.0
  44. *
  45. * @return string
  46. */
  47. public function getUserId(): string;
  48. /**
  49. * Returns the widgetId
  50. *
  51. * @since 15.0.0
  52. * @deprecated 20.0.0
  53. *
  54. * @return string
  55. */
  56. public function getWidgetId(): string;
  57. /**
  58. * Returns the current position and the current size of the widget as
  59. * displayed on the user's dashboard
  60. *
  61. * The returned value is an array:
  62. * [
  63. * 'x' => (int) position on the X axis,
  64. * 'y' => (int) position on the Y axis,
  65. * 'width' => (int) width of the widget,
  66. * 'height' => (int) height of the widget
  67. * ]
  68. *
  69. * @since 15.0.0
  70. * @deprecated 20.0.0
  71. *
  72. * @return array
  73. */
  74. public function getPosition(): array;
  75. /**
  76. * Returns an array with the settings defined by the user for the widget.
  77. * The returned value is an array, with setting used as keys:
  78. *
  79. * [
  80. * 'setting1' => 'any value',
  81. * 'setting2' => 'other value'
  82. * ]
  83. *
  84. * Each setting that can be edited by a user should be defined in a
  85. * WidgetSetting.
  86. *
  87. * @see WidgetSetting
  88. *
  89. * Those WidgetSetting are in the WidgetTemplate defined during the setup
  90. * of the widget in the IDashboardWidget.
  91. *
  92. * @see IDashboardWidget::getWidgetTemplate
  93. * @see WidgetTemplate
  94. *
  95. * When using this framework, the settings interface is generated by the
  96. * Dashboard app.
  97. *
  98. * @since 15.0.0
  99. * @deprecated 20.0.0
  100. *
  101. * @return array
  102. */
  103. public function getSettings(): array;
  104. /**
  105. * Returns if the widget is enabled/displayed in this user's dashboard.
  106. *
  107. * @since 15.0.0
  108. * @deprecated 20.0.0
  109. *
  110. * @return bool
  111. */
  112. public function isEnabled(): bool;
  113. }