1
0

WidgetOptions.php 863 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Dashboard\Model;
  8. /**
  9. * Option for displaying a widget
  10. *
  11. * @since 25.0.0
  12. */
  13. class WidgetOptions {
  14. private bool $roundItemIcons;
  15. /**
  16. * @param bool $roundItemIcons
  17. * @since 25.0.0
  18. */
  19. public function __construct(bool $roundItemIcons) {
  20. $this->roundItemIcons = $roundItemIcons;
  21. }
  22. /**
  23. * Get the default set of options
  24. *
  25. * @return WidgetOptions
  26. * @since 25.0.0
  27. */
  28. public static function getDefault(): WidgetOptions {
  29. return new WidgetOptions(false);
  30. }
  31. /**
  32. * Whether the clients should render icons for widget items as round icons
  33. *
  34. * @return bool
  35. * @since 25.0.0
  36. */
  37. public function withRoundItemIcons(): bool {
  38. return $this->roundItemIcons;
  39. }
  40. }