You are here

interface MiconIconInterface in Micon 8

Same name and namespace in other branches
  1. 2.x src/MiconIconInterface.php \Drupal\micon\MiconIconInterface

Defines an object which can be rendered by the Render API.

Hierarchy

Expanded class hierarchy of MiconIconInterface

All classes that implement MiconIconInterface

2 files declare their use of MiconIconInterface
micon.module in ./micon.module
Contains micon.module.
micon.theme.inc in ./micon.theme.inc
Contains micon.theme.inc.

File

src/MiconIconInterface.php, line 8

Namespace

Drupal\micon
View source
interface MiconIconInterface {

  /**
   * Get the type of the IcoMoon package.
   *
   * @return string
   *   The type of package. Either image or font.
   */
  public function getType();

  /**
   * Get the id of the Micon package.
   *
   * @return string
   *   The package entity id.
   */
  public function getPackageId();

  /**
   * Get the label of the Micon package.
   *
   * @return string
   *   The package entity label.
   */
  public function getPackageLabel();

  /**
   * Get the unique prefix of the IcoMoon package.
   *
   * @return string
   *   The IcoMoon prefix.
   */
  public function getPrefix();

  /**
   * Get the unique tag of the IcoMoon icon.
   *
   * @return string
   *   The IcoMoon icon.
   */
  public function getTag();

  /**
   * Get the unique selector of the IcoMoon icon.
   *
   * @return string
   *   The CSS selector.
   */
  public function getSelector();

  /**
   * Get the HEX used within sudo-elements of CSS.
   *
   * @return string
   *   The CSS HEX value.
   */
  public function getHex();

  /**
   * Get the wrapping element HTML element type.
   *
   * @return string
   *   The wrapping tag used within the template.
   */
  public function getWrappingElement();

  /**
   * Get the content entered within the icon tags.
   *
   * @return mixed[]
   *   A render array.
   */
  public function getChildren();

  /**
   * Sets attributes.
   *
   * @param array $attributes
   *   An attributes array.
   *
   * @return $this
   */
  public function setAttributes(array $attributes);

  /**
   * Sets values for an attribute key.
   *
   * @param string $attribute
   *   Name of the attribute.
   * @param string|array $value
   *   Value(s) to set for the given attribute key.
   *
   * @return $this
   */
  public function setAttribute($attribute, $value);

  /**
   * Adds classes or merges them on to array of existing CSS classes.
   *
   * @param string|array ...
   *   CSS classes to add to the class attribute array.
   *
   * @return $this
   */
  public function addClass($classes);

  /**
   * Returns a render array representation of the object.
   *
   * @return mixed[]
   *   A render array.
   */
  public function toRenderable();

  /**
   * Returns a fully rendered Markup representation of the object.
   *
   * @return \Drupal\Core\Render\Markup
   *   A Markup object.
   */
  public function toMarkup();

  /**
   * Returns a trimmed, json encoded string of the rendered markup.
   *
   * @return string
   *   A json encoded string.
   */
  public function toJson();

}

Members

Namesort descending Modifiers Type Description Overrides
MiconIconInterface::addClass public function Adds classes or merges them on to array of existing CSS classes. 1
MiconIconInterface::getChildren public function Get the content entered within the icon tags. 1
MiconIconInterface::getHex public function Get the HEX used within sudo-elements of CSS. 1
MiconIconInterface::getPackageId public function Get the id of the Micon package. 1
MiconIconInterface::getPackageLabel public function Get the label of the Micon package. 1
MiconIconInterface::getPrefix public function Get the unique prefix of the IcoMoon package. 1
MiconIconInterface::getSelector public function Get the unique selector of the IcoMoon icon. 1
MiconIconInterface::getTag public function Get the unique tag of the IcoMoon icon. 1
MiconIconInterface::getType public function Get the type of the IcoMoon package. 1
MiconIconInterface::getWrappingElement public function Get the wrapping element HTML element type. 1
MiconIconInterface::setAttribute public function Sets values for an attribute key. 1
MiconIconInterface::setAttributes public function Sets attributes. 1
MiconIconInterface::toJson public function Returns a trimmed, json encoded string of the rendered markup. 1
MiconIconInterface::toMarkup public function Returns a fully rendered Markup representation of the object. 1
MiconIconInterface::toRenderable public function Returns a render array representation of the object. 1