1
0

ITheme.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\Theming;
  8. /**
  9. * Interface ITheme
  10. *
  11. * @since 25.0.0
  12. */
  13. interface ITheme {
  14. public const TYPE_THEME = 1;
  15. public const TYPE_FONT = 2;
  16. /**
  17. * Unique theme id
  18. * Will be used to search for ID.png in the img folder
  19. *
  20. * @since 25.0.0
  21. */
  22. public function getId(): string;
  23. /**
  24. * Theme type
  25. * TYPE_THEME or TYPE_FONT
  26. *
  27. * @since 25.0.0
  28. */
  29. public function getType(): int;
  30. /**
  31. * The theme translated title
  32. *
  33. * @since 25.0.0
  34. */
  35. public function getTitle(): string;
  36. /**
  37. * The theme enable checkbox translated label
  38. *
  39. * @since 25.0.0
  40. */
  41. public function getEnableLabel(): string;
  42. /**
  43. * The theme translated description
  44. *
  45. * @since 25.0.0
  46. */
  47. public function getDescription(): string;
  48. /**
  49. * Get the meta attribute matching the theme
  50. * e.g. https://html.spec.whatwg.org/multipage/semantics.html#meta-color-scheme
  51. * @return array{name?: string, content?: string}[]
  52. * @since 29.0.0
  53. */
  54. public function getMeta(): array;
  55. /**
  56. * Get the media query triggering this theme
  57. * Optional, ignored if falsy
  58. *
  59. * @return string
  60. * @since 25.0.0
  61. */
  62. public function getMediaQuery(): string;
  63. /**
  64. * Return the list of changed css variables
  65. *
  66. * @return array
  67. * @since 25.0.0
  68. */
  69. public function getCSSVariables(): array;
  70. /**
  71. * Return the custom css necessary for that app
  72. * ⚠️ Warning, should be used slightly.
  73. * Theoretically, editing the variables should be enough.
  74. *
  75. * @return string
  76. * @since 25.0.0
  77. */
  78. public function getCustomCss(): string;
  79. }