3 namespace Drupal\bootstrap\Plugin\Setting;
5 use Drupal\bootstrap\Plugin\Form\FormInterface;
6 use Drupal\bootstrap\Utility\Element;
7 use Drupal\Component\Plugin\PluginInspectionInterface;
8 use Drupal\Core\Form\FormStateInterface;
11 * Defines the interface for an object oriented theme setting plugin.
13 * @ingroup plugins_setting
15 interface SettingInterface extends PluginInspectionInterface, FormInterface {
18 * Determines whether a theme setting should added to drupalSettings.
20 * By default, this value will be FALSE unless the method is overridden. This
21 * is to ensure that no sensitive information can be potientially leaked.
23 * @see \Drupal\bootstrap\Plugin\Setting\SettingBase::drupalSettings()
28 public function drupalSettings();
31 * The cache tags associated with this object.
33 * When this object is modified, these cache tags will be invalidated.
36 * A set of cache tags.
38 public function getCacheTags();
41 * Retrieves the setting's default value.
44 * The setting's default value.
46 public function getDefaultValue();
49 * Retrieves the group form element the setting belongs to.
52 * Nested array of form elements that comprise the form.
53 * @param \Drupal\Core\Form\FormStateInterface $form_state
54 * The current state of the form.
56 * @return \Drupal\bootstrap\Utility\Element
57 * The group element object.
59 * @deprecated Will be removed in a future release. Use \Drupal\bootstrap\Plugin\Setting\SettingInterface::getGroupElement
61 public function getGroup(array &$form, FormStateInterface $form_state);
64 * Retrieves the group form element the setting belongs to.
66 * @param \Drupal\bootstrap\Utility\Element $form
67 * The Element object that comprises the form.
68 * @param \Drupal\Core\Form\FormStateInterface $form_state
69 * The current state of the form.
71 * @return \Drupal\bootstrap\Utility\Element
72 * The group element object.
74 public function getGroupElement(Element $form, FormStateInterface $form_state);
77 * Retrieves the setting's groups.
80 * The setting's group.
82 public function getGroups();
85 * Retrieves the form element for the setting.
88 * Nested array of form elements that comprise the form.
89 * @param \Drupal\Core\Form\FormStateInterface $form_state
90 * The current state of the form.
92 * @return \Drupal\bootstrap\Utility\Element
93 * The setting element object.
95 * @deprecated Will be removed in a future release. Use \Drupal\bootstrap\Plugin\Setting\SettingInterface::getSettingElement
97 public function getElement(array &$form, FormStateInterface $form_state);
100 * Retrieves the settings options, if set.
103 * An array of options.
105 public function getOptions();
108 * Retrieves the form element for the setting.
110 * @param \Drupal\bootstrap\Utility\Element $form
111 * The Element object that comprises the form.
112 * @param \Drupal\Core\Form\FormStateInterface $form_state
113 * The current state of the form.
115 * @return \Drupal\bootstrap\Utility\Element
116 * The setting element object.
118 public function getSettingElement(Element $form, FormStateInterface $form_state);
121 * Retrieves the setting's human-readable title.
124 * The setting's type.
126 public function getTitle();