<?php
/**
 * Template Interface
 *
 * This interface defines the contract that all template classes must implement
 * to provide OTP verification popup template functionality.
 *
 * @package miniorange-sms-order-notification-otp-verification/objects
 */

namespace WCSMSOTP\Objects;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

/**
 * Template Interface
 *
 * This interface defines the contract that all template classes must implement
 * to provide OTP verification popup template functionality.
 */
interface MoITemplate {

	/**
	 * This function is used to build the template
	 *
	 * @param string $template the HTML Template.
	 * @param string $template_type the template type.
	 * @param string $message the message to be shown in the popup.
	 * @param string $otp_type the otp type invoked.
	 * @param string $from_both does user have the option to choose between email and sms verification.
	 * @return string The built template HTML.
	 */
	public function build( $template, $template_type, $message, $otp_type, $from_both );

	/**
	 * This function is used to parse the template and replace the
	 * tags with the appropriate content. Some of the contents are
	 * not shown if the admin/user is just previewing the pop-up.
	 *
	 * @param string $template the HTML Template.
	 * @param string $message the message to be shown in the popup.
	 * @param string $otp_type the otp type invoked.
	 * @param string $from_both does user have the option to choose between email and sms verification.
	 * @return string The parsed template HTML.
	 */
	public function parse( $template, $message, $otp_type, $from_both );

	/**
	 * Get default value of templates.
	 *
	 * @param string $templates template value.
	 * @return array Default template values.
	 */
	public function get_defaults( $templates );

	/**
	 * Show preview of the template.
	 *
	 * @return void
	 */
	public function show_preview();

	/**
	 * Save popup template.
	 *
	 * @return void
	 */
	public function save_popup();

	/**
	 * Get the singleton instance of the template class.
	 *
	 * @return static The template instance.
	 */
	public static function instance();

	/**
	 * Get the template key.
	 *
	 * @return string The template key identifier.
	 */
	public function get_template_key();

	/**
	 * Get the template editor ID.
	 *
	 * @return string The template editor ID.
	 */
	public function get_template_editor_id();
}
