* @copyright Copyright (c) 2019 Janis Köhr * * @author Christoph Wurst * @author Greta Doci * @author Jan-Christoph Borchardt * @author Janis Köhr * @author Joas Schilling * @author John Molakvoæ * * @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 OCA\Accessibility; use OCP\IL10N; use OCP\IURLGenerator; class AccessibilityProvider { protected string $appName; private IURLGenerator $urlGenerator; private IL10N $l; public function __construct(string $appName, IURLGenerator $urlGenerator, IL10N $l) { $this->appName = $appName; $this->urlGenerator = $urlGenerator; $this->l = $l; } /** * @psalm-return array */ public function getThemes(): array { return [ [ 'id' => 'dark', 'img' => $this->urlGenerator->imagePath($this->appName, 'theme-dark.jpg'), 'title' => $this->l->t('Dark theme'), 'enableLabel' => $this->l->t('Enable dark theme'), 'text' => $this->l->t('A dark theme to ease your eyes by reducing the overall luminosity and brightness. It is still under development, so please report any issues you may find.') ] ]; } /** * @psalm-return array{id: string, img: string, title: string, enableLabel: string, text: string} */ public function getHighContrast(): array { return [ 'id' => 'highcontrast', 'img' => $this->urlGenerator->imagePath($this->appName, 'mode-highcontrast.jpg'), 'title' => $this->l->t('High contrast mode'), 'enableLabel' => $this->l->t('Enable high contrast mode'), 'text' => $this->l->t('A high contrast mode to ease your navigation. Visual quality will be reduced but clarity will be increased.') ]; } /** * @psalm-return array */ public function getFonts(): array { return [ [ 'id' => 'fontdyslexic', 'img' => $this->urlGenerator->imagePath($this->appName, 'font-opendyslexic.jpg'), 'title' => $this->l->t('Dyslexia font'), 'enableLabel' => $this->l->t('Enable dyslexia font'), 'text' => $this->l->t('OpenDyslexic is a free typeface/font designed to mitigate some of the common reading errors caused by dyslexia.') ] ]; } }