AccessibilityProvider.php 3.0 KB

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