AccessibilityProvider.php 2.5 KB

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