You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
2.8 KiB

3 years ago
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016 Arthur Schiwon <blizzz@arthur-schiwon.de>
  4. *
  5. * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
  6. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  7. * @author Joas Schilling <coding@schilljs.com>
  8. * @author Lukas Reschke <lukas@statuscode.ch>
  9. *
  10. * @license GNU AGPL version 3 or any later version
  11. *
  12. * This program is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU Affero General Public License as
  14. * published by the Free Software Foundation, either version 3 of the
  15. * License, or (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. *
  25. */
  26. namespace OCP\Settings;
  27. /**
  28. * @since 9.1
  29. */
  30. interface IManager {
  31. /**
  32. * @since 9.1.0
  33. */
  34. public const KEY_ADMIN_SETTINGS = 'admin';
  35. /**
  36. * @since 9.1.0
  37. */
  38. public const KEY_ADMIN_SECTION = 'admin-section';
  39. /**
  40. * @since 13.0.0
  41. */
  42. public const KEY_PERSONAL_SETTINGS = 'personal';
  43. /**
  44. * @since 13.0.0
  45. */
  46. public const KEY_PERSONAL_SECTION = 'personal-section';
  47. /**
  48. * @param string $type 'admin' or 'personal'
  49. * @param string $section Class must implement OCP\Settings\ISection
  50. * @since 14.0.0
  51. */
  52. public function registerSection(string $type, string $section);
  53. /**
  54. * @param string $type 'admin' or 'personal'
  55. * @param string $setting Class must implement OCP\Settings\ISetting
  56. * @since 14.0.0
  57. */
  58. public function registerSetting(string $type, string $setting);
  59. /**
  60. * returns a list of the admin sections
  61. *
  62. * @return array array of ISection[] where key is the priority
  63. * @since 9.1.0
  64. */
  65. public function getAdminSections(): array;
  66. /**
  67. * returns a list of the personal sections
  68. *
  69. * @return array array of ISection[] where key is the priority
  70. * @since 13.0.0
  71. */
  72. public function getPersonalSections(): array;
  73. /**
  74. * returns a list of the admin settings
  75. *
  76. * @param string $section the section id for which to load the settings
  77. * @param bool $subAdminOnly only return settings sub admins are supposed to see (since 17.0.0)
  78. * @return array array of IAdmin[] where key is the priority
  79. * @since 9.1.0
  80. */
  81. public function getAdminSettings($section, bool $subAdminOnly = false): array;
  82. /**
  83. * returns a list of the personal settings
  84. *
  85. * @param string $section the section id for which to load the settings
  86. * @return array array of IPersonal[] where key is the priority
  87. * @since 13.0.0
  88. */
  89. public function getPersonalSettings($section): array;
  90. }