ITheme.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. const TYPE_THEME = 1;
  31. 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 media query triggering this theme
  66. * Optional, ignored if falsy
  67. *
  68. * @return string
  69. * @since 25.0.0
  70. */
  71. public function getMediaQuery(): string;
  72. /**
  73. * Return the list of changed css variables
  74. *
  75. * @return array
  76. * @since 25.0.0
  77. */
  78. public function getCSSVariables(): array;
  79. /**
  80. * Return the custom css necessary for that app
  81. * ⚠️ Warning, should be used slightly.
  82. * Theoretically, editing the variables should be enough.
  83. *
  84. * @return string
  85. * @since 25.0.0
  86. */
  87. public function getCustomCss(): string;
  88. }