89 lines
2.9 KiB
PHP
89 lines
2.9 KiB
PHP
<?php
|
|
|
|
/**
|
|
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
|
|
*
|
|
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
|
*
|
|
* @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 <http://www.gnu.org/licenses/>.
|
|
*
|
|
*/
|
|
|
|
namespace OCA\Accessibility;
|
|
|
|
use OCP\IL10N;
|
|
use OCP\IURLGenerator;
|
|
|
|
class AccessibilityProvider {
|
|
|
|
/** @var string */
|
|
protected $appName;
|
|
|
|
/** @var IURLGenerator */
|
|
private $urlGenerator;
|
|
|
|
/** @var IL10N */
|
|
private $l;
|
|
|
|
/**
|
|
* Account constructor.
|
|
*
|
|
* @param string $appName
|
|
* @param IURLGenerator $urlGenerator
|
|
* @param IL10N $l
|
|
*/
|
|
public function __construct(string $appName,
|
|
IURLGenerator $urlGenerator,
|
|
IL10N $l) {
|
|
$this->appName = $appName;
|
|
$this->urlGenerator = $urlGenerator;
|
|
$this->l = $l;
|
|
}
|
|
|
|
public function getThemes() {
|
|
return array(
|
|
[
|
|
'id' => 'themehighcontrast',
|
|
'img' => $this->urlGenerator->imagePath($this->appName, 'theme-highcontrast.jpg'),
|
|
'title' => $this->l->t('High Contrast theme'),
|
|
'text' => $this->l->t('A high contrast theme to ease your navigation. Visual quality will be reduced but clarity will be increased.')
|
|
], [
|
|
'id' => 'themedark',
|
|
'img' => $this->urlGenerator->imagePath($this->appName, 'theme-dark.jpg'),
|
|
'title' => $this->l->t('Dark theme'),
|
|
'text' => $this->l->t('A dark theme to ease your eyes by reducing the overall luminosity and brightness of your navigation. This is suitable for people who use computes a lot or in low luminosity spaces.')
|
|
]
|
|
);
|
|
}
|
|
|
|
public function getFonts() {
|
|
return array(
|
|
[
|
|
'id' => 'fontdyslexic',
|
|
'img' => $this->urlGenerator->imagePath($this->appName, 'font-opendyslexic.jpg'),
|
|
'title' => $this->l->t('Dyslexia font'),
|
|
'text' => $this->l->t('OpenDyslexic is a free typeface/font designed to mitigate some of the common reading errors caused by dyslexia. The typeface was created by Abelardo Gonzalez, who released it through an open-source license.')
|
|
],
|
|
[
|
|
'id' => 'fonthighcontrast',
|
|
'img' => $this->urlGenerator->imagePath($this->appName, 'font-highcontrast.jpg'),
|
|
'title' => $this->l->t('High Contrast font'),
|
|
'text' => $this->l->t('Increase the weight of the font to improve the readability.')
|
|
]
|
|
);
|
|
}
|
|
|
|
} |