/***************************************************************************
 *   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 kalvafilemanager_H
#define kalvafilemanager_H
#include "libkalva_export.h"

#include <QtGui/QWidget>

class KFileWidget;
class QString;
class QUrl;
class KUrl;

namespace KalvaWidget {

/**
 * This is the file manager class for kalva2.
 * It can be used by perspectives for the mainViewWidget.
 *
 * @todo enable drag and drop inside the filemanager to enable moving video files into directories.
 *
 * @short Video player
 * @author Andreas Silberstorff <ml@andreas-silberstorff.de>
 * @version 1.91
 */

class KALVALIB_EXPORT KalvaFileManager : public QWidget
{
	Q_OBJECT
public:
	/**
	 * Default constructor
	 */
	KalvaFileManager ( QWidget *parent );

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

signals:
	void urlSelected( const QUrl & );

public slots:

	/**
	 * Get informed when settings changed.
	 */
	void settingsChanged();
	void setUrl(const QUrl & );

private:
	KFileWidget *m_filewidget;

	/**
	 * Creates the actions.
	 */
	void createActions();

	/**
	 * Creates the widgets.
	 */
	void createWidgets();

	/**
	 * Layouts the widgets.
	 */
	void layoutWidgets();

private slots:

	/**
	 * Load the selected Url into the video player.
	 * See KalvaVideoPlayer::load( const QUrl & )
	 */
	void selectionChanged();

	/**
	 * Load the Url from the QString into the video player.
	 * See KalvaVideoPlayer::load( const QUrl & )
	 */
	void fileHighlighted( const QString & );

	/**
	 * Load the Url from the QString into the video player.
	 * See KalvaVideoPlayer::load( const QUrl & )
	 */
	void fileHighlighted( const KUrl & );
};

}

#endif // kalvafilemanager_H
