/***************************************************************************
 *   Copyright (C) 2008 by Andreas Silberstorff   *
 *   ml@andreas-silberstorff.de   *
 *                                                                         *
 *   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 collectionperspective_H
#define collectionperspective_H

#include <KalvaGeneralSettings>
#include <PluginInterface>
#include <PerspectiveInterface>
#include <Widgets/KalvaVideoPlayer>
#include <Widgets/KalvaFileManager>
#include <QtCore/QObject>
#include <QString>
#include <QUrl>
#include <KConfigDialog>

/**
 * This is the collection class for kalva2.
 * It provides a filemaneger as manager part and
 * a tabWidget with a video player and a tab for
 * managing indexdata as main view.
 *
 * @todo write the indexer (use nepumuk) and integrate it.
 * @short CollectionPerspective
 * @author Andreas Silberstorff <ml@andreas-silberstorff.de>
 * @version 1.91
 */

namespace CollectionPerspective
{
  
class Plugin
 : public QObject,
   public KalvaPlugin::PluginInterface,
   public KalvaPlugin::PerspectiveInterface
{
	Q_OBJECT
	Q_INTERFACES( KalvaPlugin::PluginInterface KalvaPlugin::PerspectiveInterface )

public:
	/**
	 * Default constructor
	 */
	Plugin();

	/**
	 * Destructor
	 */
	virtual ~Plugin();

	QString title();
	QString toolTip();
	QString whatsThis();
	QWidget* createManager(QWidget *parent);
	QWidget* createMainView(QWidget *parent);
	void settingsChanged();
	void addToConfigDialog( KConfigDialog *dialog );
	void removeFromConfigDialog( KConfigDialog *dialog );

	void setKalvaGeneralSettings( KalvaData::KalvaGeneralSettings * );

private:
	void createVideoPlayer(QWidget *parent);
	void createFileIndexer(QWidget *parent);

	KalvaData::KalvaGeneralSettings * m_kalvaGeneralSettings;
	KalvaWidget::KalvaVideoPlayer *m_videoplayer;
	KalvaWidget::KalvaFileManager *m_filemanager;
        QWidget *m_fileindexer;
	QUrl m_url;
//	KalvaFileIndexer *m_fileindexer;

private slots:

	void load( const QUrl& );
	void reload();

//signals:
//  none


};
} // end of namespace

#endif // collectionperspective_H
