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

#include <PluginInterface>
#include <SchedulerInterface>
#include <QObject>
#include <QDate>
#include <QTime>
#include <KConfigDialog>

/**
 * The CronAndAtScheduler implements a scheduler plugin for kalva2
 * using systemcalls to the unix shell tools crontab and at.
 * TODO
 *
 * @short CronAndAtScheduler
 * @author Andreas Silberstorff <ml@andreas-silberstorff.de>
 * @version 1.91
 */
class CronAndAtScheduler
 : public QObject,
   public KalvaPlugin::PluginInterface,
   public KalvaPlugin::SchedulerInterface
{
	Q_OBJECT
	Q_INTERFACES( KalvaPlugin::PluginInterface KalvaPlugin::SchedulerInterface )

public:

	CronAndAtScheduler();

	virtual ~CronAndAtScheduler();

	/**
	 * @see KalvaPlugin::PluginInterface
	 */
	QString title();

	/**
	 * @see KalvaPlugin::PluginInterface
	 */
	QString toolTip();

	/**
	 * @see KalvaPlugin::PluginInterface
	 */
	QString whatsThis();

	/**
	 * @see KalvaPlugin::PluginInterface
	 */
	void settingsChanged();

	/**
	 * @see KalvaPlugin::PluginInterface
	 */
	void addToConfigDialog( KConfigDialog *dialog );

	/**
	 * @see KalvaPlugin::SchedulerInterface
	 */
	void setDate( QDate date );

	/**
	 * @see KalvaPlugin::SchedulerInterface
	 */
	void setTime( QTime time );

	/**
	 * @see KalvaPlugin::SchedulerInterface
	 */
	void setDaysOfTheWeek( KalvaData::DaysOfTheWeek * daysOfTheWeek );

	/**
	 * @see KalvaPlugin::SchedulerInterface
	 */
	void setCommand( KalvaData::KalvaScriptCommand * command );

private:

	/**
	 *
	 */
	void installCommand();
};


#endif
