DeclarativeSettingsTypes.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2023 Andrey Borysenko <andrey.borysenko@nextcloud.com>
  5. *
  6. * @author Andrey Borysenko <andrey.borysenko@nextcloud.com>
  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. * Declarative settings types supported in the IDeclarativeSettingsForm forms
  27. *
  28. * @since 29.0.0
  29. */
  30. final class DeclarativeSettingsTypes {
  31. /**
  32. * IDeclarativeSettingsForm section_type which is determines where the form is displayed
  33. *
  34. * @since 29.0.0
  35. */
  36. public const SECTION_TYPE_ADMIN = 'admin';
  37. /**
  38. * IDeclarativeSettingsForm section_type which is determines where the form is displayed
  39. *
  40. * @since 29.0.0
  41. */
  42. public const SECTION_TYPE_PERSONAL = 'personal';
  43. /**
  44. * IDeclarativeSettingsForm storage_type which is determines where and how the config value is stored
  45. *
  46. *
  47. * For `external` storage_type the app implementing \OCP\Settings\SetDeclarativeSettingsValueEvent and \OCP\Settings\GetDeclarativeSettingsValueEvent events is responsible for storing and retrieving the config value.
  48. *
  49. * @since 29.0.0
  50. */
  51. public const STORAGE_TYPE_EXTERNAL = 'external';
  52. /**
  53. * IDeclarativeSettingsForm storage_type which is determines where and how the config value is stored
  54. *
  55. * For `internal` storage_type the config value is stored in default `appconfig` and `preferences` tables.
  56. * For `external` storage_type the app implementing \OCP\Settings\SetDeclarativeSettingsValueEvent and \OCP\Settings\GetDeclarativeSettingsValueEvent events is responsible for storing and retrieving the config value.
  57. *
  58. * @since 29.0.0
  59. */
  60. public const STORAGE_TYPE_INTERNAL = 'internal';
  61. /**
  62. * NcInputField type text
  63. *
  64. * @since 29.0.0
  65. */
  66. public const TEXT = 'text';
  67. /**
  68. * NcInputField type password
  69. *
  70. * @since 29.0.0
  71. */
  72. public const PASSWORD = 'password';
  73. /**
  74. * NcInputField type email
  75. *
  76. * @since 29.0.0
  77. */
  78. public const EMAIL = 'email';
  79. /**
  80. * NcInputField type tel
  81. *
  82. * @since 29.0.0
  83. */
  84. public const TEL = 'tel';
  85. /**
  86. * NcInputField type url
  87. *
  88. * @since 29.0.0
  89. */
  90. public const URL = 'url';
  91. /**
  92. * NcInputField type number
  93. *
  94. * @since 29.0.0
  95. */
  96. public const NUMBER = 'number';
  97. /**
  98. * NcCheckboxRadioSwitch type checkbox
  99. *
  100. * @since 29.0.0
  101. */
  102. public const CHECKBOX = 'checkbox';
  103. /**
  104. * Multiple NcCheckboxRadioSwitch type checkbox representing a one config value (saved as JSON object)
  105. *
  106. * @since 29.0.0
  107. */
  108. public const MULTI_CHECKBOX = 'multi-checkbox';
  109. /**
  110. * NcCheckboxRadioSwitch type radio
  111. *
  112. * @since 29.0.0
  113. */
  114. public const RADIO = 'radio';
  115. /**
  116. * NcSelect
  117. *
  118. * @since 29.0.0
  119. */
  120. public const SELECT = 'select';
  121. /**
  122. * Multiple NcSelect representing a one config value (saved as JSON array)
  123. *
  124. * @since 29.0.0
  125. */
  126. public const MULTI_SELECT = 'multi-select';
  127. }