From 0e5944748df24fde54e34cb1fcc0f15fb0d734de Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 23 Aug 2022 15:03:41 +0200 Subject: add dashboard api to list widgets Signed-off-by: Robin Appelman --- lib/public/Dashboard/IIconWidget.php | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 lib/public/Dashboard/IIconWidget.php (limited to 'lib') diff --git a/lib/public/Dashboard/IIconWidget.php b/lib/public/Dashboard/IIconWidget.php new file mode 100644 index 00000000000..b9928d5a6b3 --- /dev/null +++ b/lib/public/Dashboard/IIconWidget.php @@ -0,0 +1,37 @@ + + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ +namespace OCP\Dashboard; + +/** + * Allow getting the absolute icon url for a widget + * + * @since 25.0.0 + */ +interface IIconWidget extends IWidget { + /** + * Get the absolute url for the widget icon + * + * @return string + */ + public function getIconUrl(): string; +} -- cgit v1.2.3 From 79adca6b8b9b0be024899938f6e641c0379a14ed Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 29 Aug 2022 16:12:43 +0200 Subject: allow adding button to dashboard api output Signed-off-by: Robin Appelman --- lib/composer/composer/autoload_classmap.php | 2 ++ lib/composer/composer/autoload_static.php | 2 ++ lib/public/Dashboard/IButtonWidget.php | 51 +++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 lib/public/Dashboard/IButtonWidget.php (limited to 'lib') diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index a0a0db6327c..16ca9b856c7 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -192,8 +192,10 @@ return array( 'OCP\\DB\\Types' => $baseDir . '/lib/public/DB/Types.php', 'OCP\\Dashboard\\Exceptions\\DashboardAppNotAvailableException' => $baseDir . '/lib/public/Dashboard/Exceptions/DashboardAppNotAvailableException.php', 'OCP\\Dashboard\\IAPIWidget' => $baseDir . '/lib/public/Dashboard/IAPIWidget.php', + 'OCP\\Dashboard\\IButtonWidget' => $baseDir . '/lib/public/Dashboard/IButtonWidget.php', 'OCP\\Dashboard\\IDashboardManager' => $baseDir . '/lib/public/Dashboard/IDashboardManager.php', 'OCP\\Dashboard\\IDashboardWidget' => $baseDir . '/lib/public/Dashboard/IDashboardWidget.php', + 'OCP\\Dashboard\\IIconWidget' => $baseDir . '/lib/public/Dashboard/IIconWidget.php', 'OCP\\Dashboard\\IManager' => $baseDir . '/lib/public/Dashboard/IManager.php', 'OCP\\Dashboard\\IWidget' => $baseDir . '/lib/public/Dashboard/IWidget.php', 'OCP\\Dashboard\\Model\\IWidgetConfig' => $baseDir . '/lib/public/Dashboard/Model/IWidgetConfig.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 2e71b16807f..a818d684c36 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -225,8 +225,10 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OCP\\DB\\Types' => __DIR__ . '/../../..' . '/lib/public/DB/Types.php', 'OCP\\Dashboard\\Exceptions\\DashboardAppNotAvailableException' => __DIR__ . '/../../..' . '/lib/public/Dashboard/Exceptions/DashboardAppNotAvailableException.php', 'OCP\\Dashboard\\IAPIWidget' => __DIR__ . '/../../..' . '/lib/public/Dashboard/IAPIWidget.php', + 'OCP\\Dashboard\\IButtonWidget' => __DIR__ . '/../../..' . '/lib/public/Dashboard/IButtonWidget.php', 'OCP\\Dashboard\\IDashboardManager' => __DIR__ . '/../../..' . '/lib/public/Dashboard/IDashboardManager.php', 'OCP\\Dashboard\\IDashboardWidget' => __DIR__ . '/../../..' . '/lib/public/Dashboard/IDashboardWidget.php', + 'OCP\\Dashboard\\IIconWidget' => __DIR__ . '/../../..' . '/lib/public/Dashboard/IIconWidget.php', 'OCP\\Dashboard\\IManager' => __DIR__ . '/../../..' . '/lib/public/Dashboard/IManager.php', 'OCP\\Dashboard\\IWidget' => __DIR__ . '/../../..' . '/lib/public/Dashboard/IWidget.php', 'OCP\\Dashboard\\Model\\IWidgetConfig' => __DIR__ . '/../../..' . '/lib/public/Dashboard/Model/IWidgetConfig.php', diff --git a/lib/public/Dashboard/IButtonWidget.php b/lib/public/Dashboard/IButtonWidget.php new file mode 100644 index 00000000000..cc0297fe7bc --- /dev/null +++ b/lib/public/Dashboard/IButtonWidget.php @@ -0,0 +1,51 @@ + + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ +namespace OCP\Dashboard; + +/** + * Adds a button to the dashboard api representation + * + * @since 25.0.0 + */ +interface IButtonWidget extends IWidget { + /** + * Get the absolute url for the button target + * + * @return string + */ + public function getButtonUrl(): string; + + /** + * Get the absolute url for the button icon + * + * @return string + */ + public function getButtonIconUrl(): ?string; + + /** + * Get the text to show in the button + * + * @return string + */ + public function getButtonText(): string; +} -- cgit v1.2.3 From a3912e264a26d5ab3d042e6b47e7c75d2b123ada Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 1 Sep 2022 17:12:43 +0200 Subject: change widget button api to support multiple button types Signed-off-by: Robin Appelman --- lib/composer/composer/autoload_classmap.php | 1 + lib/composer/composer/autoload_static.php | 1 + lib/public/Dashboard/IButtonWidget.php | 24 +++------ lib/public/Dashboard/Model/WidgetButton.php | 75 +++++++++++++++++++++++++++++ 4 files changed, 84 insertions(+), 17 deletions(-) create mode 100644 lib/public/Dashboard/Model/WidgetButton.php (limited to 'lib') diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 16ca9b856c7..3f37d7cad6f 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -200,6 +200,7 @@ return array( 'OCP\\Dashboard\\IWidget' => $baseDir . '/lib/public/Dashboard/IWidget.php', 'OCP\\Dashboard\\Model\\IWidgetConfig' => $baseDir . '/lib/public/Dashboard/Model/IWidgetConfig.php', 'OCP\\Dashboard\\Model\\IWidgetRequest' => $baseDir . '/lib/public/Dashboard/Model/IWidgetRequest.php', + 'OCP\\Dashboard\\Model\\WidgetButton' => $baseDir . '/lib/public/Dashboard/Model/WidgetButton.php', 'OCP\\Dashboard\\Model\\WidgetItem' => $baseDir . '/lib/public/Dashboard/Model/WidgetItem.php', 'OCP\\Dashboard\\Model\\WidgetSetting' => $baseDir . '/lib/public/Dashboard/Model/WidgetSetting.php', 'OCP\\Dashboard\\Model\\WidgetSetup' => $baseDir . '/lib/public/Dashboard/Model/WidgetSetup.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index a818d684c36..aaef7c44b8f 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -233,6 +233,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OCP\\Dashboard\\IWidget' => __DIR__ . '/../../..' . '/lib/public/Dashboard/IWidget.php', 'OCP\\Dashboard\\Model\\IWidgetConfig' => __DIR__ . '/../../..' . '/lib/public/Dashboard/Model/IWidgetConfig.php', 'OCP\\Dashboard\\Model\\IWidgetRequest' => __DIR__ . '/../../..' . '/lib/public/Dashboard/Model/IWidgetRequest.php', + 'OCP\\Dashboard\\Model\\WidgetButton' => __DIR__ . '/../../..' . '/lib/public/Dashboard/Model/WidgetButton.php', 'OCP\\Dashboard\\Model\\WidgetItem' => __DIR__ . '/../../..' . '/lib/public/Dashboard/Model/WidgetItem.php', 'OCP\\Dashboard\\Model\\WidgetSetting' => __DIR__ . '/../../..' . '/lib/public/Dashboard/Model/WidgetSetting.php', 'OCP\\Dashboard\\Model\\WidgetSetup' => __DIR__ . '/../../..' . '/lib/public/Dashboard/Model/WidgetSetup.php', diff --git a/lib/public/Dashboard/IButtonWidget.php b/lib/public/Dashboard/IButtonWidget.php index cc0297fe7bc..5745c368c96 100644 --- a/lib/public/Dashboard/IButtonWidget.php +++ b/lib/public/Dashboard/IButtonWidget.php @@ -22,6 +22,8 @@ declare(strict_types=1); */ namespace OCP\Dashboard; +use OCP\Dashboard\Model\WidgetButton; + /** * Adds a button to the dashboard api representation * @@ -29,23 +31,11 @@ namespace OCP\Dashboard; */ interface IButtonWidget extends IWidget { /** - * Get the absolute url for the button target - * - * @return string - */ - public function getButtonUrl(): string; - - /** - * Get the absolute url for the button icon - * - * @return string - */ - public function getButtonIconUrl(): ?string; - - /** - * Get the text to show in the button + * Get the buttons to show on the widget * - * @return string + * @param string $userId + * @return WidgetButton[] + * @since 25.0.0 */ - public function getButtonText(): string; + public function getWidgetButtons(string $userId): array; } diff --git a/lib/public/Dashboard/Model/WidgetButton.php b/lib/public/Dashboard/Model/WidgetButton.php new file mode 100644 index 00000000000..c56ab232963 --- /dev/null +++ b/lib/public/Dashboard/Model/WidgetButton.php @@ -0,0 +1,75 @@ + + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCP\Dashboard\Model; + +/** + * Button for a dashboard widget + * + * @since 25.0.0 + */ +class WidgetButton { + const TYPE_NEW = 'new'; + const TYPE_MORE = 'more'; + const TYPE_SETUP = 'setup'; + + private string $type; + private string $link; + private string $text; + + public function __construct(string $type, string $link, string $text) { + $this->type = $type; + $this->link = $link; + $this->text = $text; + } + + /** + * Get the button type, either "new", "more" or "setup" + * + * @return string + * @since 25.0.0 + */ + public function getType(): string { + return $this->type; + } + + /** + * Get the absolute url the buttons links to + * + * @return string + * @since 25.0.0 + */ + public function getLink(): string { + return $this->link; + } + + /** + * Get the translated text for the button + * + * @return string + * @since 25.0.0 + */ + public function getText(): string { + return $this->text; + } +} -- cgit v1.2.3 From 845149bb7ccba5f0de37d145c6b7d13a7532e68b Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Thu, 8 Sep 2022 11:48:00 +0200 Subject: add IItemOptionWidget to define some item-related parameters, only getItemIconsRound() for now Signed-off-by: Julien Veyssier --- lib/public/Dashboard/IItemOptionWidget.php | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 lib/public/Dashboard/IItemOptionWidget.php (limited to 'lib') diff --git a/lib/public/Dashboard/IItemOptionWidget.php b/lib/public/Dashboard/IItemOptionWidget.php new file mode 100644 index 00000000000..9826286b041 --- /dev/null +++ b/lib/public/Dashboard/IItemOptionWidget.php @@ -0,0 +1,37 @@ + + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ +namespace OCP\Dashboard; + +/** + * Allow getting widget options + * + * @since 25.0.0 + */ +interface IItemOptionWidget extends IWidget { + /** + * Should the item icons be rendered round (or raw/square) by the clients? + * + * @return bool + */ + public function getItemIconsRound(): bool; +} -- cgit v1.2.3 From d9e75f00b1977da7325db14554729419f5fe02c9 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 13 Sep 2022 13:03:35 +0200 Subject: move widget options into a Option class Signed-off-by: Robin Appelman --- lib/composer/composer/autoload_classmap.php | 2 + lib/composer/composer/autoload_static.php | 2 + lib/public/Dashboard/IItemOptionWidget.php | 37 ----------------- lib/public/Dashboard/IOptionWidget.php | 37 +++++++++++++++++ lib/public/Dashboard/Model/WidgetButton.php | 6 +-- lib/public/Dashboard/Model/WidgetOptions.php | 61 ++++++++++++++++++++++++++++ 6 files changed, 105 insertions(+), 40 deletions(-) delete mode 100644 lib/public/Dashboard/IItemOptionWidget.php create mode 100644 lib/public/Dashboard/IOptionWidget.php create mode 100644 lib/public/Dashboard/Model/WidgetOptions.php (limited to 'lib') diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 3f37d7cad6f..40a5efea347 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -197,11 +197,13 @@ return array( 'OCP\\Dashboard\\IDashboardWidget' => $baseDir . '/lib/public/Dashboard/IDashboardWidget.php', 'OCP\\Dashboard\\IIconWidget' => $baseDir . '/lib/public/Dashboard/IIconWidget.php', 'OCP\\Dashboard\\IManager' => $baseDir . '/lib/public/Dashboard/IManager.php', + 'OCP\\Dashboard\\IOptionWidget' => $baseDir . '/lib/public/Dashboard/IOptionWidget.php', 'OCP\\Dashboard\\IWidget' => $baseDir . '/lib/public/Dashboard/IWidget.php', 'OCP\\Dashboard\\Model\\IWidgetConfig' => $baseDir . '/lib/public/Dashboard/Model/IWidgetConfig.php', 'OCP\\Dashboard\\Model\\IWidgetRequest' => $baseDir . '/lib/public/Dashboard/Model/IWidgetRequest.php', 'OCP\\Dashboard\\Model\\WidgetButton' => $baseDir . '/lib/public/Dashboard/Model/WidgetButton.php', 'OCP\\Dashboard\\Model\\WidgetItem' => $baseDir . '/lib/public/Dashboard/Model/WidgetItem.php', + 'OCP\\Dashboard\\Model\\WidgetOptions' => $baseDir . '/lib/public/Dashboard/Model/WidgetOptions.php', 'OCP\\Dashboard\\Model\\WidgetSetting' => $baseDir . '/lib/public/Dashboard/Model/WidgetSetting.php', 'OCP\\Dashboard\\Model\\WidgetSetup' => $baseDir . '/lib/public/Dashboard/Model/WidgetSetup.php', 'OCP\\Dashboard\\Model\\WidgetTemplate' => $baseDir . '/lib/public/Dashboard/Model/WidgetTemplate.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index aaef7c44b8f..50a2406a8d1 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -230,11 +230,13 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OCP\\Dashboard\\IDashboardWidget' => __DIR__ . '/../../..' . '/lib/public/Dashboard/IDashboardWidget.php', 'OCP\\Dashboard\\IIconWidget' => __DIR__ . '/../../..' . '/lib/public/Dashboard/IIconWidget.php', 'OCP\\Dashboard\\IManager' => __DIR__ . '/../../..' . '/lib/public/Dashboard/IManager.php', + 'OCP\\Dashboard\\IOptionWidget' => __DIR__ . '/../../..' . '/lib/public/Dashboard/IOptionWidget.php', 'OCP\\Dashboard\\IWidget' => __DIR__ . '/../../..' . '/lib/public/Dashboard/IWidget.php', 'OCP\\Dashboard\\Model\\IWidgetConfig' => __DIR__ . '/../../..' . '/lib/public/Dashboard/Model/IWidgetConfig.php', 'OCP\\Dashboard\\Model\\IWidgetRequest' => __DIR__ . '/../../..' . '/lib/public/Dashboard/Model/IWidgetRequest.php', 'OCP\\Dashboard\\Model\\WidgetButton' => __DIR__ . '/../../..' . '/lib/public/Dashboard/Model/WidgetButton.php', 'OCP\\Dashboard\\Model\\WidgetItem' => __DIR__ . '/../../..' . '/lib/public/Dashboard/Model/WidgetItem.php', + 'OCP\\Dashboard\\Model\\WidgetOptions' => __DIR__ . '/../../..' . '/lib/public/Dashboard/Model/WidgetOptions.php', 'OCP\\Dashboard\\Model\\WidgetSetting' => __DIR__ . '/../../..' . '/lib/public/Dashboard/Model/WidgetSetting.php', 'OCP\\Dashboard\\Model\\WidgetSetup' => __DIR__ . '/../../..' . '/lib/public/Dashboard/Model/WidgetSetup.php', 'OCP\\Dashboard\\Model\\WidgetTemplate' => __DIR__ . '/../../..' . '/lib/public/Dashboard/Model/WidgetTemplate.php', diff --git a/lib/public/Dashboard/IItemOptionWidget.php b/lib/public/Dashboard/IItemOptionWidget.php deleted file mode 100644 index 9826286b041..00000000000 --- a/lib/public/Dashboard/IItemOptionWidget.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ -namespace OCP\Dashboard; - -/** - * Allow getting widget options - * - * @since 25.0.0 - */ -interface IItemOptionWidget extends IWidget { - /** - * Should the item icons be rendered round (or raw/square) by the clients? - * - * @return bool - */ - public function getItemIconsRound(): bool; -} diff --git a/lib/public/Dashboard/IOptionWidget.php b/lib/public/Dashboard/IOptionWidget.php new file mode 100644 index 00000000000..0cc129a5087 --- /dev/null +++ b/lib/public/Dashboard/IOptionWidget.php @@ -0,0 +1,37 @@ + + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ +namespace OCP\Dashboard; + +use OCP\Dashboard\Model\WidgetOptions; + +/** + * Allow getting widget options + * + * @since 25.0.0 + */ +interface IOptionWidget extends IWidget { + /** + * Get additional options for the widget + */ + public function getWidgetOptions(): WidgetOptions; +} diff --git a/lib/public/Dashboard/Model/WidgetButton.php b/lib/public/Dashboard/Model/WidgetButton.php index c56ab232963..f3e706bf652 100644 --- a/lib/public/Dashboard/Model/WidgetButton.php +++ b/lib/public/Dashboard/Model/WidgetButton.php @@ -29,9 +29,9 @@ namespace OCP\Dashboard\Model; * @since 25.0.0 */ class WidgetButton { - const TYPE_NEW = 'new'; - const TYPE_MORE = 'more'; - const TYPE_SETUP = 'setup'; + public const TYPE_NEW = 'new'; + public const TYPE_MORE = 'more'; + public const TYPE_SETUP = 'setup'; private string $type; private string $link; diff --git a/lib/public/Dashboard/Model/WidgetOptions.php b/lib/public/Dashboard/Model/WidgetOptions.php new file mode 100644 index 00000000000..44efdbda457 --- /dev/null +++ b/lib/public/Dashboard/Model/WidgetOptions.php @@ -0,0 +1,61 @@ + + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +namespace OCP\Dashboard\Model; + +/** + * Option for displaying a widget + * + * @since 25.0.0 + */ +class WidgetOptions { + private bool $roundItemIcons; + + /** + * @param bool $roundItemIcons + * @since 25.0.0 + */ + public function __construct(bool $roundItemIcons) { + $this->roundItemIcons = $roundItemIcons; + } + + /** + * Get the default set of options + * + * @return WidgetOptions + * @since 25.0.0 + */ + public static function getDefault(): WidgetOptions { + return new WidgetOptions(false); + } + + /** + * Whether the clients should render icons for widget items as round icons + * + * @return bool + * @since 25.0.0 + */ + public function withRoundItemIcons(): bool { + return $this->roundItemIcons; + } +} -- cgit v1.2.3 From 9c402eb745c39a2b5122f45cdd1c3e673b72850a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 16 Sep 2022 08:23:04 +0200 Subject: Add since tags Signed-off-by: Joas Schilling --- lib/public/Dashboard/IIconWidget.php | 1 + lib/public/Dashboard/IOptionWidget.php | 1 + lib/public/Dashboard/Model/WidgetButton.php | 6 ++++++ 3 files changed, 8 insertions(+) (limited to 'lib') diff --git a/lib/public/Dashboard/IIconWidget.php b/lib/public/Dashboard/IIconWidget.php index b9928d5a6b3..3f5cf5fb050 100644 --- a/lib/public/Dashboard/IIconWidget.php +++ b/lib/public/Dashboard/IIconWidget.php @@ -32,6 +32,7 @@ interface IIconWidget extends IWidget { * Get the absolute url for the widget icon * * @return string + * @since 25.0.0 */ public function getIconUrl(): string; } diff --git a/lib/public/Dashboard/IOptionWidget.php b/lib/public/Dashboard/IOptionWidget.php index 0cc129a5087..8d5146c5248 100644 --- a/lib/public/Dashboard/IOptionWidget.php +++ b/lib/public/Dashboard/IOptionWidget.php @@ -32,6 +32,7 @@ use OCP\Dashboard\Model\WidgetOptions; interface IOptionWidget extends IWidget { /** * Get additional options for the widget + * @since 25.0.0 */ public function getWidgetOptions(): WidgetOptions; } diff --git a/lib/public/Dashboard/Model/WidgetButton.php b/lib/public/Dashboard/Model/WidgetButton.php index f3e706bf652..480249b539f 100644 --- a/lib/public/Dashboard/Model/WidgetButton.php +++ b/lib/public/Dashboard/Model/WidgetButton.php @@ -37,6 +37,12 @@ class WidgetButton { private string $link; private string $text; + /** + * @param string $type + * @param string $link + * @param string $text + * @since 25.0.0 + */ public function __construct(string $type, string $link, string $text) { $this->type = $type; $this->link = $link; -- cgit v1.2.3