/* ====================================================================
 * FTD4Linux Software License, Version 1.0
 *
 * Copyright (c) 2000-2004 The FTD4Linux Development Team.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by the
 *        FTD4Linux Development Team (http://www.ftd4linux.2y.net/)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "FTD" and "FTD4Linux" must
 *    not be used to endorse or promote products derived from this
 *    software without prior written permission. For written
 *    permission, please contact alguno@ftd4linux.2y.net.
 *
 * 5. Products derived from this software may not be called "FTD4Linux",
 *    nor may "FTD4Linux" appear in their name, without prior written
 *    permission of the FTD4Linux Development Team.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE FTD4LINUX DEVELOPMENT TEAM OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

#ifndef _FTD_GUI_MAIN_H_
#define _FTD_GUI_MAIN_H_

#include <gtk/gtk.h>
#ifdef WIN32
#include <windows.h>
#endif

#include "ftd4linux.h"
#include "ftd_gui_config.h"

/* Aantal event info's die tegelijkertijd in de GUI getoond mogen worden */
#define MAX_EVENT_INFO  10

typedef struct ftd_status_task {
    FtdString *tekst;
    GtkWidget *label;
    GtkWidget *image;
} FtdStatusTask;

typedef struct _ftd_gui_menu        FtdGuiMenu;
typedef struct _ftd_gui_worksheet   FtdGuiWorksheet;
typedef struct _ftd_gui_mail        FtdGuiMail;
typedef struct _ftd_gui_toolbar     FtdGuiToolbar;
typedef struct _ftd_gui_kudos       FtdGuiKudos;
typedef struct _ftd_gui_post        FtdGuiPost;
typedef struct _ftd_gui_import      FtdGuiImport;
typedef struct _ftd_gui_modje       FtdGuiModje;

typedef struct _ftd_gui_main {
    GtkWidget           *window;
    GtkWidget           *vbox;
    GtkWidget           *statusbar;
    GtkWidget           *progressbar;
    FtdGuiToolbar       *toolbar;
    FtdGuiMenu          *menu;
    FtdGuiWorksheet     *worksheet;
    FtdGuiConfig        *config;
    FtdGuiMail          *mail;
    FtdGuiKudos         *kudos;
    FtdGuiPost          *post;
    FtdGuiImport        *import;
    FtdGuiModje         *modje;
    GtkWidget           *dayselector;
    gboolean             trayIconActivated;
} FtdGuiMain;

extern FtdGuiMain *gui;

void         ftd_gui_main_new(void);
void         ftd_gui_main_init_pixbufs(void);
gboolean     ftd_gui_main_window_state_changed(GtkWidget *, GdkEvent *, gpointer);

/***********************/
/* ftd_gui_callbacks.c */
/***********************/
gboolean     ftd_gui_callback_afsluiten(GtkWidget *, gpointer);
gboolean     ftd_gui_callback_updaten(GtkWidget *, gpointer);
gboolean     ftd_gui_callback_do_updaten(gpointer);
gboolean     ftd_gui_callback_config(GtkWidget *, gpointer);
gboolean     ftd_gui_callback_config_destroy(GtkWidget *, gpointer);
gboolean     ftd_gui_callback_nieuw(GtkWidget *, gpointer);
gboolean     ftd_gui_callback_do_nieuw(gpointer);
gboolean     ftd_gui_callback_mail(GtkWidget *, gpointer);
gboolean     ftd_gui_callback_toevoegen(GtkWidget *, gpointer);
gboolean     ftd_gui_callback_watchlist(GtkWidget *, gpointer);
gboolean     ftd_gui_callback_watcher(GtkWidget *, gpointer);
gboolean     ftd_gui_callback_myftd(GtkWidget *, gpointer);
gboolean     ftd_gui_callback_about(GtkWidget *, gpointer);
gboolean     ftd_gui_callback_refresh(GtkWidget *, gpointer);
gboolean     ftd_gui_callback_dayselector(GtkWidget *, gpointer);
gboolean     ftd_gui_callback_vrienden(GtkWidget *, gpointer);
gboolean     ftd_gui_callback_import(GtkWidget *, gpointer);
gboolean     ftd_gui_callback_modje(GtkWidget *caller, gpointer data);

#ifdef HAVE_DBUS
void         ftd_gui_callback_bring_to_front(OpenFTDDBusObject *obj);
void         ftd_gui_callback_open_posting(OpenFTDDBusObject *obj, int postID);
#endif

/******************/
/* ftd_gui_tray.c */
/******************/
#ifndef DARWIN
gboolean     ftd_gui_tray_create(gpointer);
void         ftd_gui_tray_destroy(void);
#endif
#if GTK_CHECK_VERSION(2,9,0)
GtkStatusIcon *ftd_gui_tray_get_status_icon(void);
#endif

/*******************/
/* ftd_gui_about.c */
/*******************/
void         ftd_gui_about_show(void);

/*************************/
/* ftd_gui_dayselector.c */
/*************************/
void         ftd_gui_dayselector_new(void);

/********************/
/* ftd_gui_status.c */
/********************/
void         ftd_gui_status_new(FtdList *, GtkWidget *);
void         ftd_gui_status_disable_keep_above(void);
void         ftd_gui_status_set_parent(GtkWidget *);
void         ftd_gui_status_push(void);
GtkWidget   *ftd_gui_status_get_window(void);

/*****************/
/* ftd_gui_nzb.c */
/*****************/
void         ftd_gui_nzb_popup(int postId);

/*******************/
/* ftd_gui_modje.c */
/*******************/
FtdGuiModje *ftd_gui_modje_create (int post_id, int forum_id);


/*********************/
/* ftd_gui_profile.c */
/*********************/
void ftd_gui_profile_show(const char *username);

/**********/
/* main.c */
/**********/
#ifdef WIN32
HINSTANCE main_getinstance(void);
#endif

#endif /* _FTD_GUI_MAIN_H_ */
