Including security review as a submodule - with patched for Yaffs.
[yaffs-website] / web / modules / contrib / entity_browser / src / WidgetSelectorInterface.php
1 <?php
2
3 namespace Drupal\entity_browser;
4
5 use Drupal\Component\Plugin\ConfigurablePluginInterface;
6 use Drupal\Component\Plugin\PluginInspectionInterface;
7 use Drupal\Core\Form\FormStateInterface;
8 use Drupal\Core\Plugin\PluginFormInterface;
9
10 /**
11  * Defines the interface for entity browser widget selectors.
12  *
13  * This plugin type is responsible for providing ways for users to select the
14  * current widget used for selecting entities in an entity browser. For example,
15  * if the user wants to tab between widgets, the tab set will be created and
16  * managed by the widget selector.
17  */
18 interface WidgetSelectorInterface extends PluginInspectionInterface, ConfigurablePluginInterface, PluginFormInterface {
19
20   /**
21    * Returns the widget selector label.
22    *
23    * @return string
24    *   The widget label.
25    */
26   public function label();
27
28   /**
29    * Returns widget selector form.
30    *
31    * @return array
32    *   Form structure.
33    */
34   public function getForm(array &$form, FormStateInterface &$form_state);
35
36   /**
37    * Sets the default widget.
38    *
39    * @param string $widget
40    *   Id of widget to set as the current widget.
41    */
42   public function setDefaultWidget($widget);
43
44   /**
45    * Validates form.
46    *
47    * @param array $form
48    *   Form.
49    * @param \Drupal\Core\Form\FormStateInterface $form_state
50    *   Form state object.
51    */
52   public function validate(array &$form, FormStateInterface $form_state);
53
54   /**
55    * Submits form.
56    *
57    * @param array $form
58    *   Form.
59    * @param \Drupal\Core\Form\FormStateInterface $form_state
60    *   Form state object.
61    *
62    * @return string
63    *   The selected widget ID.
64    */
65   public function submit(array &$form, FormStateInterface $form_state);
66
67 }