/*
 *  Copyright (C) 2000 Marco Pesenti Gritti
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2, or (at your option)
 *  any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef __galeon_h
#define __galeon_h

#ifdef __cplusplus
extern "C" {
#endif

/**
 * Configuration includes
 */	
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

/**
 * Macros for checking mozilla version
 */
#include "mozilla_version.h"

/**
 * Runtime detected mozilla version
 */
extern int mozilla_version; 

/**
 * Galeon global includes 
 */
#include "galeon_types.h"

/**
 * Preferences strings
 */
#include "prefs_strings.h"

/* the virtual URL of "My Portal" feature */
#define MYPORTAL_URL          "myportal:"

/* the Galeon homepage */
#define GALEON_HOMEPAGE_URL   "http://galeon.sourceforge.net"

/* the Galeon bug report homepage */
#define GALEON_BUGREPORT_URL  ("http://bugzilla.gnome.org/enter_bug.cgi" \
                               "?product=galeon&version=" VERSION)

/* bookmark file locations - relative to home dir */
#define NETSCAPE_BOOKMARKS    "/.netscape/bookmarks.html"
#define MOZILLA_PREFS_DIR     "/.mozilla/"

/**
 * Globals: FIXME!
 */

/* Has xpcom been initialised? */
extern gboolean pushed_startup;

/* types of drag and drop for links */
extern const GtkTargetEntry url_drag_types[];
extern const GtkTargetEntry drop_types[];
extern const GtkTargetEntry embed_drop_types[];
extern const gint url_drag_types_num_items;
extern const gint drop_types_num_items;
extern const gint embed_drop_types_num_items;

/** the global list of MimeItems */
extern GList *mime_types; /* FIXME: can this be made local?  MattA */
			  /* No: philipl :-) */

/** The root of the bookmarks tree */
extern BookmarkItem *bookmarks_root;

/** The root of the temporary bookmark tree */
extern BookmarkItem *default_bookmarks_root;

/** The AutoBookmarks folder */
extern BookmarkItem *autobookmarks_root;

/** Do we need to save the bookmarks? */
extern gboolean bookmarks_dirty;

/** Do we need to recreate the bookmarks toolbars? */
extern gboolean bookmarks_tb_dirty;

/** The bookmarks editors list */
extern GList *bookmarks_editors;

/** Global windows count, includes download progress dialogs **/
extern gint window_count;

/** The global list of all GaleonWindow structures */
extern GList *all_windows;

/** The global list of all GaleonEmbed structures */
extern GList *all_embeds;

/** Styles for tab labels */
extern GtkStyle *loading_text_style;
extern GtkStyle *new_text_style;

/* global character set hash and sorted title list*/
extern GHashTable *charsets;
extern GList *sorted_charset_titles;

/* are we in server mode? */
extern gboolean galeon_server_mode;

/* server mode timeout */
extern gint galeon_server_timeout;

/* are we in panel mode? */
extern gboolean galeon_panel_mode;

/* last save image directory */
extern gchar *save_dir;

/**
 * The standard pixmaps for bookmarks / sites
 */
extern PixmapData *folder_pixmap_data;
extern PixmapData *folder_open_pixmap_data;
extern PixmapData *default_folder_pixmap_data;
extern PixmapData *default_folder_open_pixmap_data;
extern PixmapData *site_pixmap_data;
extern PixmapData *smart_bm_tray_pixmap_data;

#define DEFAULT_CHROME GTK_MOZ_EMBED_FLAG_ALLCHROME

extern const gint bookmarks_dnd_targets_num_items;

/*
 * Miscellaneous function prototypes. Most large modules have a header
 * of their own.
 */

/* netscape.c */
gint netscape_import_bookmarks (GString *filename, gboolean use_locale);
gint netscape_export_bookmarks (gchar *filename, BookmarkItem *root,
				gboolean use_locale);
gboolean netscape_import_prefs (void);

/* mozilla_prefs.c */
void mozilla_prefs_import_language (void);

/* autobookmarks.c */
void autobookmarks_generate (void);

/* cookies.c */
GtkWidget *pdm_show_manager (GaleonWindow *window);
GtkWidget *pdm_show_page (GaleonWindow *window, PDMPage page);

/* newuser.c */
gboolean newuser_check (void);
void newuser_show_druid (void); 

/* panel.c */
void panel_main (void);

#ifdef __cplusplus
}
#endif

#endif /* __galeon_h */
