1<?php
2
3namespace Drupal\ckeditor;
4
5use Drupal\Core\Form\FormStateInterface;
6use Drupal\editor\Entity\Editor;
7
8/**
9 * Defines an interface for configurable CKEditor plugins.
10 *
11 * This allows a CKEditor plugin to define a settings form. These settings can
12 * then be automatically passed on to the corresponding CKEditor instance via
13 * CKEditorPluginInterface::getConfig().
14 *
15 * @see \Drupal\ckeditor\CKEditorPluginInterface
16 * @see \Drupal\ckeditor\CKEditorPluginButtonsInterface
17 * @see \Drupal\ckeditor\CKEditorPluginContextualInterface
18 * @see \Drupal\ckeditor\CKEditorPluginCssInterface
19 * @see \Drupal\ckeditor\CKEditorPluginBase
20 * @see \Drupal\ckeditor\CKEditorPluginManager
21 * @see \Drupal\ckeditor\Annotation\CKEditorPlugin
22 * @see plugin_api
23 */
24interface CKEditorPluginConfigurableInterface extends CKEditorPluginInterface {
25
26  /**
27   * Returns a settings form to configure this CKEditor plugin.
28   *
29   * If the plugin's behavior depends on extensive options and/or external data,
30   * then the implementing module can choose to provide a separate, global
31   * configuration page rather than per-text-editor settings. In that case, this
32   * form should provide a link to the separate settings page.
33   *
34   * @param array $form
35   *   An empty form array to be populated with a configuration form, if any.
36   * @param \Drupal\Core\Form\FormStateInterface $form_state
37   *   The state of the entire filter administration form.
38   * @param \Drupal\editor\Entity\Editor $editor
39   *   A configured text editor object.
40   *
41   * @return array
42   *   A render array for the settings form.
43   */
44  public function settingsForm(array $form, FormStateInterface $form_state, Editor $editor);
45
46}
47