<?php
/**
 * Abstract base class for MoxIcon icon libraries.
 *
 * @package MoxIcon
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

abstract class MoxIcon_Library_Abstract {

	/**
	 * Get the unique library name (used as Elementor tab key).
	 *
	 * @return string
	 */
	abstract public function get_name();

	/**
	 * Get the display label.
	 *
	 * @return string
	 */
	abstract public function get_label();

	/**
	 * Get CSS class prefix (e.g. 'hi hi-').
	 *
	 * @return string
	 */
	abstract public function get_prefix();

	/**
	 * Get display prefix for Elementor (e.g. 'hi').
	 *
	 * @return string
	 */
	abstract public function get_display_prefix();

	/**
	 * Get URL to the icon CSS file.
	 *
	 * @return string
	 */
	abstract public function get_css_url();

	/**
	 * Get URL to the icons JSON manifest.
	 *
	 * @return string
	 */
	abstract public function get_json_url();

	/**
	 * Get library version string.
	 *
	 * @return string
	 */
	abstract public function get_version();

	/**
	 * Get the icon to use as this tab's label icon in Elementor.
	 *
	 * @return string Full class string e.g. 'hi hi-home'
	 */
	abstract public function get_label_icon();

	/**
	 * Build and return the config array for Elementor additional_tabs.
	 *
	 * @return array
	 */
	public function get_config() {
		return array(
			'name'          => $this->get_name(),
			'label'         => $this->get_label(),
			'url'           => $this->get_css_url(),
			'enqueue'       => array(),
			'prefix'        => $this->get_prefix(),
			'displayPrefix' => $this->get_display_prefix(),
			'labelIcon'     => $this->get_label_icon(),
			'ver'           => $this->get_version(),
			'fetchJson'     => $this->get_json_url(),
			'native'        => false,
		);
	}
}
