<?php
/**
 * Main core plugin class.
 *
 * @package TextToPDF
 */

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

/**
 * TextToPDF_Plugin Class
 */
class TextToPDF_Plugin {

	/**
	 * Constructor.
	 */
	public function __construct() {
		$this->load_dependencies();
	}

	/**
	 * Load required dependencies.
	 */
	private function load_dependencies() {
		require_once TEXTTOPDF_PLUGIN_DIR . 'includes/class-settings.php';
		require_once TEXTTOPDF_PLUGIN_DIR . 'includes/class-admin.php';
		require_once TEXTTOPDF_PLUGIN_DIR . 'includes/class-shortcodes.php';
		require_once TEXTTOPDF_PLUGIN_DIR . 'includes/class-frontend.php';
		require_once TEXTTOPDF_PLUGIN_DIR . 'includes/class-pdf-generator.php';
	}

	/**
	 * Run the loader to execute all of the hooks with WordPress.
	 */
	public function run() {
		// Initialize Settings.
		$settings = new TextToPDF_Settings();
		$settings->init();

		// Initialize Admin.
		$admin = new TextToPDF_Admin();
		$admin->init();

		// Initialize Shortcodes.
		$shortcodes = new TextToPDF_Shortcodes();
		$shortcodes->init();

		// Initialize Frontend display logic.
		$frontend = new TextToPDF_Frontend();
		$frontend->init();

		// Initialize PDF Generator / Processors.
		$pdf_generator = new TextToPDF_Generator();
		$pdf_generator->init();
	}
}
