interface IconPackManagerInterface

Interface for icon pack manager.

@internal This API is experimental.

Hierarchy

Expanded class hierarchy of IconPackManagerInterface

All classes that implement IconPackManagerInterface

2 files declare their use of IconPackManagerInterface
IconPackManagerKernelTest.php in core/tests/Drupal/KernelTests/Core/Theme/Icon/IconPackManagerKernelTest.php
IconTest.php in core/tests/Drupal/Tests/Core/Theme/Icon/IconTest.php

File

core/lib/Drupal/Core/Theme/Icon/Plugin/IconPackManagerInterface.php, line 17

Namespace

Drupal\Core\Theme\Icon\Plugin
View source
interface IconPackManagerInterface extends PluginManagerInterface {
  
  /**
   * Get a list of all the icons within definitions.
   *
   * @param array $allowed_icon_pack
   *   Limit the icons to some definition id.
   *
   * @return array
   *   Gets a list of icons index by id with `source` and `group`.
   */
  public function getIcons(array $allowed_icon_pack = []) : array;
  
  /**
   * Get definition of a specific icon.
   *
   * @param string $icon_full_id
   *   The ID of the icon to retrieve, include pack id.
   *
   * @return \Drupal\Core\Theme\Icon\IconDefinitionInterface|null
   *   Icon definition.
   */
  public function getIcon(string $icon_full_id) : ?IconDefinitionInterface;
  
  /**
   * Populates a key-value pair of available icon pack.
   *
   * @param bool $include_description
   *   Include Pack description if set, default to not include.
   *
   * @return array
   *   An array of translated icon pack labels, keyed by ID.
   */
  public function listIconPackOptions(bool $include_description = FALSE) : array;
  
  /**
   * Retrieve extractor forms based on the provided icon set limit.
   *
   * @param array $form
   *   The form structure where widgets are being attached to. This might be a
   *   full form structure, or a sub-element of a larger form.
   * @param \Drupal\Core\Form\FormStateInterface $form_state
   *   The current state of the form.
   * @param array $default_settings
   *   The settings for the forms (optional).
   * @param array $allowed_icon_packs
   *   The list of icon packs (optional).
   * @param bool $wrap_details
   *   Wrap each form in details (optional).
   */
  public function getExtractorPluginForms(array &$form, FormStateInterface $form_state, array $default_settings = [], array $allowed_icon_packs = [], bool $wrap_details = FALSE) : void;
  
  /**
   * Retrieve extractor default options.
   *
   * @param string $pack_id
   *   The icon pack to look for.
   *
   * @return array
   *   The extractor defaults options.
   */
  public function getExtractorFormDefaults(string $pack_id) : array;

}

Members

Title Sort descending Modifiers Object type Summary Overrides
DiscoveryInterface::getDefinition public function Gets a specific plugin definition. 4
DiscoveryInterface::getDefinitions public function Gets the definition of all plugins for this type. 3
DiscoveryInterface::hasDefinition public function Indicates if a specific plugin definition exists. 1
FactoryInterface::createInstance public function Creates a plugin instance based on the provided ID and configuration. 7
IconPackManagerInterface::getExtractorFormDefaults public function Retrieve extractor default options. 1
IconPackManagerInterface::getExtractorPluginForms public function Retrieve extractor forms based on the provided icon set limit. 1
IconPackManagerInterface::getIcon public function Get definition of a specific icon. 1
IconPackManagerInterface::getIcons public function Get a list of all the icons within definitions. 1
IconPackManagerInterface::listIconPackOptions public function Populates a key-value pair of available icon pack. 1
MapperInterface::getInstance public function Gets or creates a plugin instance that satisfies the given options. 3

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.