From 55f627d20b6eacb1773381ea4325d2159f9c3103 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 26 Feb 2019 14:16:59 +0100 Subject: Add an event to the Autocomplete Controller to allow to filter the results Signed-off-by: Joas Schilling --- lib/composer/composer/autoload_classmap.php | 1 + lib/composer/composer/autoload_static.php | 1 + .../AutoComplete/AutoCompleteEvent.php | 99 ++++++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 lib/public/Collaboration/AutoComplete/AutoCompleteEvent.php (limited to 'lib') diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 9ac6d837449..be7702c1d41 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -104,6 +104,7 @@ return array( 'OCP\\Calendar\\Room\\IRoom' => $baseDir . '/lib/public/Calendar/Room/IRoom.php', 'OCP\\Capabilities\\ICapability' => $baseDir . '/lib/public/Capabilities/ICapability.php', 'OCP\\Capabilities\\IPublicCapability' => $baseDir . '/lib/public/Capabilities/IPublicCapability.php', + 'OCP\\Collaboration\\AutoComplete\\AutoCompleteEvent' => $baseDir . '/lib/public/Collaboration/AutoComplete/AutoCompleteEvent.php', 'OCP\\Collaboration\\AutoComplete\\IManager' => $baseDir . '/lib/public/Collaboration/AutoComplete/IManager.php', 'OCP\\Collaboration\\AutoComplete\\ISorter' => $baseDir . '/lib/public/Collaboration/AutoComplete/ISorter.php', 'OCP\\Collaboration\\Collaborators\\ISearch' => $baseDir . '/lib/public/Collaboration/Collaborators/ISearch.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index ca5e47bb9f1..04395a3b80d 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -134,6 +134,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c 'OCP\\Calendar\\Room\\IRoom' => __DIR__ . '/../../..' . '/lib/public/Calendar/Room/IRoom.php', 'OCP\\Capabilities\\ICapability' => __DIR__ . '/../../..' . '/lib/public/Capabilities/ICapability.php', 'OCP\\Capabilities\\IPublicCapability' => __DIR__ . '/../../..' . '/lib/public/Capabilities/IPublicCapability.php', + 'OCP\\Collaboration\\AutoComplete\\AutoCompleteEvent' => __DIR__ . '/../../..' . '/lib/public/Collaboration/AutoComplete/AutoCompleteEvent.php', 'OCP\\Collaboration\\AutoComplete\\IManager' => __DIR__ . '/../../..' . '/lib/public/Collaboration/AutoComplete/IManager.php', 'OCP\\Collaboration\\AutoComplete\\ISorter' => __DIR__ . '/../../..' . '/lib/public/Collaboration/AutoComplete/ISorter.php', 'OCP\\Collaboration\\Collaborators\\ISearch' => __DIR__ . '/../../..' . '/lib/public/Collaboration/Collaborators/ISearch.php', diff --git a/lib/public/Collaboration/AutoComplete/AutoCompleteEvent.php b/lib/public/Collaboration/AutoComplete/AutoCompleteEvent.php new file mode 100644 index 00000000000..59dbafcb56f --- /dev/null +++ b/lib/public/Collaboration/AutoComplete/AutoCompleteEvent.php @@ -0,0 +1,99 @@ + + * + * @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\Collaboration\AutoComplete; + + +use Symfony\Component\EventDispatcher\GenericEvent; + +/** + * @since 16.0.0 + */ +class AutoCompleteEvent extends GenericEvent { + + /** + * @param array $arguments + * @since 16.0.0 + */ + public function __construct(array $arguments) { + parent::__construct(null, $arguments); + } + + /** + * @since 16.0.0 + */ + public function getResults(): array { + return $this->getArgument('results'); + } + + /** + * @param array $results + * @since 16.0.0 + */ + public function setResults(array $results): void { + $this->setArgument('results', $results); + } + + /** + * @since 16.0.0 + */ + public function getSearchTerm(): string { + return $this->getArgument('search'); + } + + /** + * @return int[] + * @since 16.0.0 + */ + public function getShareTypes(): array { + return $this->getArgument('shareTypes'); + } + + /** + * @since 16.0.0 + */ + public function getItemType(): string { + return $this->getArgument('itemType'); + } + + /** + * @since 16.0.0 + */ + public function getItemId(): string { + return $this->getArgument('itemId'); + } + + /** + * @since 16.0.0 + */ + public function getSorter(): string { + return $this->getArgument('sorter'); + } + + /** + * @since 16.0.0 + */ + public function getLimit(): int { + return $this->getArgument('limit'); + } + +} -- cgit v1.2.3