/*
Copyright (C) 2006 Evan Teran
                   eteran@alum.rit.edu

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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

#ifndef RECENTFILEMANAGER_20070430_H_
#define RECENTFILEMANAGER_20070430_H_

#include <QStringList>
#include <QString>
#include <QWidget>

class QMenu;
class QWidget;

class RecentFileManager : public QWidget {
	Q_OBJECT
public:
	RecentFileManager(QWidget * parent = 0, Qt::WindowFlags f = 0);
	virtual ~RecentFileManager();

public:
	void addFile(const QString &file);
	QMenu *createMenu();

public Q_SLOTS:
	void clearFileList();
	void itemSelected();
	
signals:
	void fileSelected(const QString &);

private:
	void saveFileList();
	void loadFileList();
	void update();

private:
	static const int MaxRecentFiles = 4;

private:
	QStringList	m_FileList;
	QMenu		*m_Menu;
};

#endif

