#ifndef UI_H
#define UI_H

#include <gtk/gtk.h>
#include "player.h"
#include "controls.h"
#include "playlist.h"
#include "dialogs.h"

typedef struct AppUI AppUI;

/* Create main application UI */
AppUI* ui_new(void);
void ui_destroy(AppUI *ui);
void ui_set_preferences(AppUI *ui, Preferences *prefs);

/* Get main window */
GtkWidget* ui_get_window(AppUI *ui);

/* Get player instance */
Player* ui_get_player(AppUI *ui);

/* Get playlist */
Playlist* ui_get_playlist(AppUI *ui);

/* Get plugin manager */
struct PluginManager;
typedef struct PluginManager PluginManager;
PluginManager* ui_get_plugin_manager(AppUI *ui);

/* Run the application */
void ui_run(AppUI *ui);

/* File operations */
void ui_open_file(AppUI *ui);
void ui_open_url(AppUI *ui);
void ui_load_subtitle(AppUI *ui);

/* View operations */
void ui_toggle_fullscreen(AppUI *ui);
void ui_toggle_playlist(AppUI *ui);
void ui_toggle_always_on_top(AppUI *ui);

/* Update window title */
void ui_update_title(AppUI *ui, const char *media_title);

/* Plugin UI Access */
void ui_set_video_area_visible(AppUI *ui, gboolean visible);
void ui_set_window_size(AppUI *ui, int width, int height);
Player* ui_get_player(AppUI *ui); /* Helper to get player from UI */

/* Application control */
void ui_restart(AppUI *ui);
void ui_open_scripts_folder(AppUI *ui);
void ui_show_script_manager(AppUI *ui);

#endif /* UI_H */
