1
0

ITheme.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2022 John Molakvoæ <skjnldsv@protonmail.com>
  5. *
  6. * @author John Molakvoæ <skjnldsv@protonmail.com>
  7. *
  8. * @license GNU AGPL version 3 or any later version
  9. *
  10. * This code is free software: you can redistribute it and/or modify
  11. * it under the terms of the GNU Affero General Public License, version 3,
  12. * as published by the Free Software Foundation.
  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, version 3,
  20. * along with this program. If not, see <http://www.gnu.org/licenses/>
  21. *
  22. */
  23. namespace OCA\Theming;
  24. /**
  25. * Interface ITheme
  26. *
  27. * @since 25.0.0
  28. */
  29. interface ITheme {
  30. public const TYPE_THEME = 1;
  31. public const TYPE_FONT = 2;
  32. /**
  33. * Unique theme id
  34. * Will be used to search for ID.png in the img folder
  35. *
  36. * @since 25.0.0
  37. */
  38. public function getId(): string;
  39. /**
  40. * Theme type
  41. * TYPE_THEME or TYPE_FONT
  42. *
  43. * @since 25.0.0
  44. */
  45. public function getType(): int;
  46. /**
  47. * The theme translated title
  48. *
  49. * @since 25.0.0
  50. */
  51. public function getTitle(): string;
  52. /**
  53. * The theme enable checkbox translated label
  54. *
  55. * @since 25.0.0
  56. */
  57. public function getEnableLabel(): string;
  58. /**
  59. * The theme translated description
  60. *
  61. * @since 25.0.0
  62. */
  63. public function getDescription(): string;
  64. /**
  65. * Get the meta attribute matching the theme
  66. * e.g. https://html.spec.whatwg.org/multipage/semantics.html#meta-color-scheme
  67. * @return array{name?: string, content?: string}[]
  68. * @since 29.0.0
  69. */
  70. public function getMeta(): array;
  71. /**
  72. * Get the media query triggering this theme
  73. * Optional, ignored if falsy
  74. *
  75. * @return string
  76. * @since 25.0.0
  77. */
  78. public function getMediaQuery(): string;
  79. /**
  80. * Return the list of changed css variables
  81. *
  82. * @return array
  83. * @since 25.0.0
  84. */
  85. public function getCSSVariables(): array;
  86. /**
  87. * Return the custom css necessary for that app
  88. * ⚠️ Warning, should be used slightly.
  89. * Theoretically, editing the variables should be enough.
  90. *
  91. * @return string
  92. * @since 25.0.0
  93. */
  94. public function getCustomCss(): string;
  95. }