3 namespace Drupal\ckeditor;
5 use Drupal\editor\Entity\Editor;
8 * Defines an interface for contextually enabled CKEditor plugins.
10 * Contextually enabled CKEditor plugins can be enabled via an explicit setting,
11 * or enable themselves based on the configuration of another setting, such as
12 * enabling based on a particular button being present in the toolbar.
14 * If a contextually enabled CKEditor plugin must also be configurable (for
15 * instance, in the case where it must be enabled based on an explicit setting),
16 * then one must also implement the CKEditorPluginConfigurableInterface
19 * @see \Drupal\ckeditor\CKEditorPluginInterface
20 * @see \Drupal\ckeditor\CKEditorPluginButtonsInterface
21 * @see \Drupal\ckeditor\CKEditorPluginConfigurableInterface
22 * @see \Drupal\ckeditor\CKEditorPluginCssInterface
23 * @see \Drupal\ckeditor\CKEditorPluginBase
24 * @see \Drupal\ckeditor\CKEditorPluginManager
25 * @see \Drupal\ckeditor\Annotation\CKEditorPlugin
28 interface CKEditorPluginContextualInterface extends CKEditorPluginInterface {
31 * Checks if this plugin should be enabled based on the editor configuration.
33 * The editor's settingsĀ can be retrieved via $editor->getSettings().
35 * @param \Drupal\editor\Entity\Editor $editor
36 * A configured text editor object.
40 public function isEnabled(Editor $editor);