/***************************************************************************
 *   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 DEVICEINTERFACE_H
#define DEVICEINTERFACE_H

#include <Data/Command>
#include <Data/Channel>

#include <QObject>
#include <Phonon/VideoWidget>

namespace KalvaPlugin {

/**
 * This class describes the interface for kalva device plugins.
 *
 * Kalva device plugins have to implement this interface.
 *
 * The PluginManager reads in all plugins
 * and constructs a DeviceFactory for each device plugin.
 * DeviceFactories are held by the manager and can be accessed through
 * PluginManager::devices();
 *
 *  The plugin can be accessed through DeviceFactory::plugin().
 *
 * @short DeviceInterface
 * @author Andreas Silberstorff <ml@andreas-silberstorff.de>
 * @version 1.0.91
 */

class DeviceInterface
{
public:
	virtual ~DeviceInterface() {};

	/**
	 * Implementing plugins must overwrite this to
	 * get a pointer to the player widget.
	 * See kalvaview.
	 */
	virtual void setVideoWidget( Phonon::VideoWidget * ) = 0;

	/**
	 * Implementing plugins must overwrite this to allow
	 * recording of the tv stream.
	 *
	 * The managing perspective must have set the video widget
	 * and the channellist and a station has to be selected
	 * before this function can be called!
	 */
	virtual KalvaData::KalvaScriptCommand* createRecordCommand( QString titel, QTime duration ) = 0;

	/**
	 * Implementing plugins must overwrite this to allow
	 * viewing the tv stream.
	 */
	virtual KalvaData::KalvaScriptCommand* createPlayCommand() = 0;

	/**
	 * Implementing plugins must overwrite this as a slot
	 * to allow tuning via station parameter.
	 */
	virtual void setChannel( KalvaData::Channel *) = 0;

};

}

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

#endif
