IManager.php 2.5 KB

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