/***************************************************************************
 *   Copyright (C) 2008 by Andreas Silberstorff   *
 *   taki@Rivendell   *
 *                                                                         *
 *   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.             *
 ***************************************************************************/
#ifndef PLUGININTERFACE_H
#define PLUGININTERFACE_H

#include <QObject>
#include <KalvaGeneralSettings>

class QString;
class KConfigDialog;

namespace KalvaPlugin {

/**
 * This class describes the basic interface for kalva plugins.
 *
 * All Kalva plugins have to implement this interface and one specialized interface.
 *
 * The PluginInterface allows managing plugins by the manager and the plugin preferences page.
 * The PluginManager reads in all specialized plugins, creates factories and
 * stores a list of factories. 
 *
 * Plugins can be enabled or disabled. When enabled the factory emits the
 * enabled signal. They get a call when the settings have changed.
 *
 * Factories can be accessed through PluginManager::factories().
 * The plugin can be accessed through PluginFactory::plugin().
 *
 * @short PluginInterface
 * @author Andreas Silberstorff <ml@andreas-silberstorff.de>
 * @version 1.0.91
 */

class PluginInterface
{
public:

	virtual ~PluginInterface() {};

	/**
	 * Implementing plugins must overwrite this to
         * define the text for the manager tab.
	 */
	virtual QString title() = 0;

	/**
	 * Implementing plugins must overwrite this to
	 * define a short description of what the perspective provides.
	 */
	virtual QString toolTip() = 0;

	/**
	 * Implementing plugins must overwrite this to
	 * define a short description of what the perspective provides.
	 */
	virtual QString whatsThis() = 0;

	/**
	 * Implementing plugins must overwrite this to
	 * get informed when settings have changed.
	 */
	virtual void settingsChanged() = 0;

	/**
	 * Implementing plugins must overwrite this to
	 * construct one or more complex widgets and add them
	 * as new pages to the KConfigDialog.
	 * See KConfigDialog::add()
	 * See kalva2.
	 */
	virtual void addToConfigDialog( KConfigDialog *dialog ) = 0;

	/**
	 * Overwrite if You need acces to kalvas general settings
	 */
	virtual void setKalvaGeneralSettings( KalvaData::KalvaGeneralSettings * ) {};
};
}

Q_DECLARE_INTERFACE( KalvaPlugin::PluginInterface, "org.kde.apps.kalva2.PluginInterface/1.0" )

#endif
