Completed
Push — master ( dfbc21...f148e3 )
by John
64:33 queued 45:49
created

AccessibilityProvider::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 3
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @copyright Copyright (c) 2018 John Molakvoæ <[email protected]>
5
 *
6
 * @author John Molakvoæ <[email protected]>
7
 *
8
 * @license GNU AGPL version 3 or any later version
9
 *
10
 * This program is free software: you can redistribute it and/or modify
11
 * it under the terms of the GNU Affero General Public License as
12
 * published by the Free Software Foundation, either version 3 of the
13
 * License, or (at your option) any later version.
14
 *
15
 * This program is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 * GNU Affero General Public License for more details.
19
 *
20
 * You should have received a copy of the GNU Affero General Public License
21
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22
 *
23
 */
24
25
namespace OCA\Accessibility;
26
27
use OCP\IL10N;
28
use OCP\IURLGenerator;
29
30
class AccessibilityProvider {
31
32
	/** @var string */
33
	protected $appName;
34
35
	/** @var IURLGenerator */
36
	private $urlGenerator;
37
38
	/** @var IL10N */
39
	private $l;
40
41
	/**
42
	 * Account constructor.
43
	 *
44
	 * @param string $appName
45
	 * @param IURLGenerator $urlGenerator
46
	 * @param IL10N $l
47
	 */
48
	public function __construct(string $appName,
49
								IURLGenerator $urlGenerator,
50
								IL10N $l) {
51
		$this->appName      = $appName;
52
		$this->urlGenerator = $urlGenerator;
53
		$this->l            = $l;
54
	}
55
56
	public function getThemes() {
57
		return array(
58
			[
59
				'id'    => 'themehighcontrast',
60
				'img'   => $this->urlGenerator->imagePath($this->appName, 'theme-highcontrast.jpg'),
61
				'title' => $this->l->t('High Contrast theme'),
62
				'text'  => $this->l->t('A high contrast theme to ease your navigation. Visual quality will be reduced but clarity will be increased.')
63
			], [
64
				'id'    => 'themedark',
65
				'img'   => $this->urlGenerator->imagePath($this->appName, 'theme-dark.jpg'),
66
				'title' => $this->l->t('Dark theme'),
67
				'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.')
68
			]
69
		);
70
	}
71
72
	public function getFonts() {
73
		return array(
74
			[
75
				'id'    => 'fontdyslexic',
76
				'img'   => $this->urlGenerator->imagePath($this->appName, 'font-opendyslexic.jpg'),
77
				'title' => $this->l->t('Dyslexia font'),
78
				'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.')
79
			]
80
		);
81
	}
82
83
}