/*
 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
 * Copyright (C) 1999-2004 Hiroyuki Yamamoto
 * This file (C) 2005 Andrej Kacian <andrej@kacian.sk>
 *
 * - generic s-c plugin stuff
 *
 * 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 of the License, 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.
 */

#ifdef HAVE_CONFIG_H
#  include "config.h"
#endif

#include <common/version.h>
#include <claws.h>
#include <curl/curl.h>

#include "gettext.h"

#include "rssyl.h"
#include "plugin.h"

gint plugin_init(gchar **error)
{
#ifdef G_OS_UNIX
	bindtextdomain(TEXTDOMAIN, LOCALEDIR);
#else
	bindtextdomain(TEXTDOMAIN, get_locale_dir());
#endif
	bind_textdomain_codeset(TEXTDOMAIN, "UTF-8");

	if( !check_plugin_version(MAKE_NUMERIC_VERSION(3,5,0,47),
				VERSION_NUMERIC, PLUGIN_NAME, error) )
		return -1;

	curl_global_init(CURL_GLOBAL_DEFAULT);
	rssyl_init();

	return 0;
}

gboolean plugin_done(void)
{
	rssyl_done();
	return TRUE;
}

const gchar *plugin_name(void)
{
	return PLUGIN_NAME;
}

const gchar *plugin_desc(void)
{
	return _("This plugin allows you to create a mailbox tree where you can add "
		"newsfeeds in RSS 1.0, RSS 2.0 or Atom format.\n\n"
		"Each newsfeed will create a folder with appropriate entries, fetched "
		"from the web. You can read them, and delete or keep old entries.");
}

const gchar *plugin_type(void)
{
	return "GTK2";
}

const gchar *plugin_licence(void)
{
	return "GPL2+";
}

const gchar *plugin_version(void)
{
	return PLUGINVERSION;
}

struct PluginFeature *plugin_provides(void)
{
	static struct PluginFeature features[] = 
		{ {PLUGIN_FOLDERCLASS, N_("RSS feed")},
		  {PLUGIN_NOTHING, NULL}};
	return features;
}
