#ifndef WEB_NAVIGATION_H
#define WEB_NAVIGATION_H

#include "core/profile.h"
#include <gtk/gtk.h>
#include <webkit2/webkit2.h>

typedef struct {
  WebKitWebView *webview;
  GtkEntry *url_entry;
  Profile *profile;
} NavigationContext;

/**
 * Initialize navigation signals for a webview
 * @param webview WebKitWebView instance
 * @param url_entry URL entry widget
 * @param profile User profile
 */
void navigation_init(WebKitWebView *webview, GtkEntry *url_entry,
                     Profile *profile);

/**
 * Load a URL in the webview
 * @param webview WebKitWebView instance
 * @param url URL to load
 */
void navigation_load_url(WebKitWebView *webview, const char *url);

/**
 * Load a URL in the webview with profile context for search engine
 * @param webview WebKitWebView instance
 * @param url URL to load
 * @param profile User profile (can be NULL)
 */
void navigation_load_url_with_profile(WebKitWebView *webview, const char *url,
                                      Profile *profile);

/**
 * Load home page from settings
 * @param webview WebKitWebView instance
 * @param profile User profile
 */
void navigation_load_home(WebKitWebView *webview, Profile *profile);

#endif
