/**
 * yt_adblock.h - YouTube-specific ad blocking for WebKit2GTK
 *
 * This module provides YouTube-specific ad blocking capabilities through
 * JavaScript injection and CSS cosmetic filtering, similar to uBlock Origin.
 */

#ifndef EXTENSIONS_YT_ADBLOCK_H
#define EXTENSIONS_YT_ADBLOCK_H

#include <glib.h>
#include <webkit2/webkit2.h>

G_BEGIN_DECLS

/**
 * YTAdblockManager:
 *
 * Opaque structure representing the YouTube ad-blocking manager.
 * Manages JavaScript injection and CSS cosmetic filtering for YouTube.
 */
typedef struct _YTAdblockManager YTAdblockManager;

/**
 * yt_adblock_manager_new:
 *
 * Creates a new YTAdblockManager instance.
 * This initializes the YouTube-specific ad blocking scripts and styles.
 *
 * Returns: A new YTAdblockManager, or NULL on failure. Free with
 * yt_adblock_manager_free().
 */
YTAdblockManager *yt_adblock_manager_new(void);

/**
 * yt_adblock_manager_free:
 * @manager: The YTAdblockManager to free
 *
 * Frees all resources associated with the YTAdblockManager.
 */
void yt_adblock_manager_free(YTAdblockManager *manager);

/**
 * yt_adblock_manager_apply_to_webview:
 * @manager: The YTAdblockManager instance
 * @web_view: The WebKitWebView to apply YouTube ad blocking to
 *
 * Applies YouTube-specific ad blocking to the given WebView.
 * This injects scripts and styles that will block YouTube ads.
 * The scripts are only injected when navigating to YouTube URLs.
 *
 * Returns: TRUE if successful, FALSE otherwise
 */
gboolean yt_adblock_manager_apply_to_webview(YTAdblockManager *manager,
                                             WebKitWebView *web_view);

/**
 * yt_adblock_manager_set_enabled:
 * @manager: The YTAdblockManager instance
 * @enabled: TRUE to enable YouTube ad blocking, FALSE to disable
 *
 * Enables or disables YouTube ad blocking.
 * Note: Changes only affect newly created WebViews or page reloads.
 */
void yt_adblock_manager_set_enabled(YTAdblockManager *manager,
                                    gboolean enabled);

/**
 * yt_adblock_manager_is_enabled:
 * @manager: The YTAdblockManager instance
 *
 * Checks if YouTube ad blocking is currently enabled.
 *
 * Returns: TRUE if enabled, FALSE otherwise
 */
gboolean yt_adblock_manager_is_enabled(YTAdblockManager *manager);

G_END_DECLS

#endif /* EXTENSIONS_YT_ADBLOCK_H */
