From ac168cf9ff07ef57cda2453626e25d5a00283c21 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Tue, 10 Oct 2023 16:11:25 +0200 Subject: feat(contactsmenu): Show user status Signed-off-by: Christoph Wurst --- lib/public/Contacts/ContactsMenu/IBulkProvider.php | 40 ++++++++++++++++++++++ lib/public/Contacts/ContactsMenu/IEntry.php | 13 +++++++ lib/public/Contacts/ContactsMenu/IProvider.php | 7 ++++ 3 files changed, 60 insertions(+) create mode 100644 lib/public/Contacts/ContactsMenu/IBulkProvider.php (limited to 'lib/public/Contacts') diff --git a/lib/public/Contacts/ContactsMenu/IBulkProvider.php b/lib/public/Contacts/ContactsMenu/IBulkProvider.php new file mode 100644 index 00000000000..43d727e2ec3 --- /dev/null +++ b/lib/public/Contacts/ContactsMenu/IBulkProvider.php @@ -0,0 +1,40 @@ + + * + * @author Christoph Wurst + * + * @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\Contacts\ContactsMenu; + +/** + * Process contacts menu entries in bulk + * + * @since 28.0 + */ +interface IBulkProvider { + /** + * @since 28.0 + * @param list $entries + * @return void + */ + public function process(array $entries): void; +} diff --git a/lib/public/Contacts/ContactsMenu/IEntry.php b/lib/public/Contacts/ContactsMenu/IEntry.php index 9d78b0c8f57..cd683949985 100644 --- a/lib/public/Contacts/ContactsMenu/IEntry.php +++ b/lib/public/Contacts/ContactsMenu/IEntry.php @@ -53,6 +53,19 @@ interface IEntry extends JsonSerializable { */ public function addAction(IAction $action): void; + /** + * Set the (system) contact's user status + * + * @since 28.0 + * @param string $status + * @param string $statusMessage + * @param string|null $icon + * @return void + */ + public function setStatus(string $status, + string $statusMessage = null, + string $icon = null): void; + /** * Get an arbitrary property from the contact * diff --git a/lib/public/Contacts/ContactsMenu/IProvider.php b/lib/public/Contacts/ContactsMenu/IProvider.php index c05f2707c18..200ee0b1fea 100644 --- a/lib/public/Contacts/ContactsMenu/IProvider.php +++ b/lib/public/Contacts/ContactsMenu/IProvider.php @@ -1,4 +1,7 @@ * @@ -23,6 +26,10 @@ namespace OCP\Contacts\ContactsMenu; /** + * Process contacts menu entries + * + * @see IBulkProvider for providers that work with the full dataset at once + * * @since 12.0 */ interface IProvider { -- cgit v1.2.3