3 namespace Drupal\views_ui\Form\Ajax;
5 use Drupal\Core\Form\FormInterface;
6 use Drupal\views\ViewEntityInterface;
8 interface ViewsFormInterface extends FormInterface {
11 * Returns the key that represents this form.
14 * The form key used in the URL, e.g., the string 'add-handler' in
15 * 'admin/structure/views/%/add-handler/%/%/%'.
17 public function getFormKey();
20 * Gets the form state for this form.
22 * @param \Drupal\views\ViewEntityInterface $view
23 * The view being edited.
24 * @param string|null $display_id
25 * The display ID being edited, or NULL to load the first available display.
27 * If this is an AJAX form, it will be the string 'ajax'. Otherwise, it will
28 * be 'nojs'. This determines the response.
30 * @return \Drupal\Core\Form\FormStateInterface
31 * The current state of the form.
33 public function getFormState(ViewEntityInterface $view, $display_id, $js);
36 * Creates a new instance of this form.
38 * @param \Drupal\views\ViewEntityInterface $view
39 * The view being edited.
40 * @param string|null $display_id
41 * The display ID being edited, or NULL to load the first available display.
43 * If this is an AJAX form, it will be the string 'ajax'. Otherwise, it will
44 * be 'nojs'. This determines the response.
47 * An form for a specific operation in the Views UI, or an array of AJAX
48 * commands to render a form.
50 * @todo When https://www.drupal.org/node/1843224 is in, this will return
51 * \Drupal\Core\Ajax\AjaxResponse instead of the array of AJAX commands.
53 public function getForm(ViewEntityInterface $view, $display_id, $js);