/*======================================================================================

	Program:		Range Imaging Toolkit (RITK)
	Module:			ritkPluginFactories.h
	Version:		$Revision: 1763 $
	Date:			$Date: 2011-09-25 20:22:20 +0200 (So, 25 Sep 2011) $

	Copyright (c) 2010-2011
	Pattern Recognition Lab, 
    University Erlangen-Nuremberg, Germany
    All rights reserved.

	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 RITKCopyright.txt for more information.

	http://www5.informatik.uni-erlangen.de/research/software/ritk

========================================================================================*/

#ifndef PLUGINFACTORIES_H__
#define PLUGINFACTORIES_H__

#include "ritkCore.h"

#include "ritkPluginBase.h"
#include "ritkApplicationPlugin.h"
#include "ritkFilterPlugin.h"
#include "ritkSourcePlugin.h"
#include "ritkImageTypePlugin.h"
#include "ritkAbstractFactory.h"

namespace ritk
{


/**	@ingroup	Core
 *	@class		PluginDescriptor
 *	@author		Jakob Wasza
 *	@brief		Interface to query plugin descriptions
 *
 *	@details
 *	This class defines the interface (pure virtual methods) to query plugin
 *	descriptions.
 */
class PluginDescriptor
{
public:
	/// Destructor
	virtual ~PluginDescriptor() {}

	/**	@brief	Name for the plugin
	 *	@return	The name
	 *
	 *	@details
	 *	This method returns the name for the plugin.
	 */
	virtual QString GetName()=0;

	/**	@brief	Description for the plugin
	 *	@return	The description
	 *
	 *	@details
	 *	This method should return a SHORT description for the plugin
	 */
	virtual QString GetDescription()=0;
};



/**	@class	ApplicationPluginFactory
 *	@author	Jakob Wasza
 *	@brief	Interface for creating application plugins
 *
 *	@details
 *	This class defines the interface (pure virtual methods) for creating
 *	application plugins via the factory design pattern. If your plugin
 *	is an application plugin you should derive your concrete factory from this class.
 */
class ApplicationPluginFactory : public AbstractFactory<ApplicationPlugin>, public PluginDescriptor
{
public:
	/// Destructor
	virtual ~ApplicationPluginFactory() {}
};

/**	@class	FilterPluginFactory
 *	@author	Jakob Wasza
 *	@brief	Interface for creating filter plugins
 *
 *	@details
 *	This class defines the interface (pure virtual methods) for creating
 *	filter plugins via the factory design pattern. If your plugin
 *	is a filter plugin you should derive your concrete factory from this class.
 */
class FilterPluginFactory : public AbstractFactory<FilterPlugin>, public PluginDescriptor
{
public:
	/// Destructor
	virtual ~FilterPluginFactory() {}
};

/**	@class	SourcePluginFactory
 *	@author	Jakob Wasza
 *	@brief	Interface for creating source plugins
 *
 *	@details
 *	This class defines the interface (pure virtual methods) for creating
 *	source plugins via the factory design pattern. If your plugin
 *	is a source plugin you should derive your concrete factory from this class.
 */
class SourcePluginFactory : public AbstractFactory<SourcePlugin>, public PluginDescriptor
{
public:
	/// Destructor
	virtual ~SourcePluginFactory() {}
};


/**	@class	ImageTypePluginFactory
 *	@author	Jakob Wasza
 *	@brief	Interface for creating image type plugins
 *
 *	@details
 *	This class defines the interface (pure virtual methods) for creating
 *	image type plugins via the factory design pattern. If your plugin
 *	is an image type plugin you should derive your concrete factory from this class.
 */
class ImageTypePluginFactory : public AbstractFactory<ImageTypePlugin>, public PluginDescriptor
{
public:
	/// Destructor
	virtual ~ImageTypePluginFactory() {}
};


/**	@class	GenericPluginFactory
 *	@author	Jakob Wasza
 *	@brief	Interface for creating generic plugins
 *
 *	@details
 *	This class defines the interface (pure virtual methods) for creating
 *	generic plugins via the factory design pattern. This class should be used
 *	if and only if your concrete plugin does neither inherit from ApplicationPlugin
 *	nor FilterPlugin nor SourcePlugin (i.e. the provided plugin types are not appropriate
 *	and you have to design your own class of plugins)! In this case please contact us
 *  so that we are aware of the need for an additional plugin type. \n
 *	Note that this factory's CreateInstance() method returns a pointer to a PluginBase
 *	object!
 */
class CORE_EXPORT GenericPluginFactory : public AbstractFactory<PluginBase>, public PluginDescriptor
{
public:
	/// Destructor
	virtual ~GenericPluginFactory() {}
};


} // end namespace ritk


Q_DECLARE_INTERFACE(ritk::ApplicationPluginFactory,"ritk.plugin.ApplicationPluginFactory/1.0")
Q_DECLARE_INTERFACE(ritk::FilterPluginFactory,"ritk.plugin.FilterPluginFactory/1.0")
Q_DECLARE_INTERFACE(ritk::SourcePluginFactory,"ritk.plugin.SourcePluginFactory/1.0")
Q_DECLARE_INTERFACE(ritk::ImageTypePluginFactory,"ritk.plugin.ImageTypePluginFactory/1.0")
Q_DECLARE_INTERFACE(ritk::GenericPluginFactory,"ritk.plugin.GenericPluginFactory/1.0")

#endif // PLUGINFACTORIES_H__