/***************************************************************************
 *   Copyright (C) 2005 by xavier helluy                                   *
 *   xavier.helluy@web.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.,                                       *
 *   51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA.             *
 ***************************************************************************/
#ifndef QOBJECTCLUCENEINDEXERGUI_H
#define QOBJECTCLUCENEINDEXERGUI_H


#include <kconfigdialog.h>

#include "settings.h"

//configuration headers
#include "indexerwidget.h"
#include "indexesmanagerwidget.h"
#include "textconverterwidget.h"
#include "ioslaveconfigwidget.h"


enum displayType {ALL , IOSLAVE_ONLY};

/**
@author xavier helluy
*/
class MainGUI : public QWidget
{
	Q_OBJECT

	public:
		MainGUI(displayType);
		~MainGUI();
		void loadIndexAndTextConvertersNames();
	
	public slots:
		void slotQuit();
		void saveSettings();
		void slotSetupTextConverters();
		void setUpPages(QWidget * page);
		KDialogBase *  m_dialog;

	signals:
		void indexCreatorCalled();
		
		void indexManagerCalled();
		void ioSlaveConfigCalled();
		void textConverterCalled();
	
	private:
		
		//pointer to   kconfigskeleton config. 
		//Not really needed as a class without KconfigXT
		Settings *m_settings;
		
		//map of stored index names and corresponding path to the index database
		//one cannot change the location and the name of the index once saved.
		QMap<QString , QString > m_indexMap;
		//Qmap useless below
		QMap<QString , QString > m_textConvertersNameMap;
		
		//all four config classes
		IndexesManagerWidget 	* m_indexManager;
		IndexerWidget 		* m_indexCreator;
		TextConverterWidget 	* m_textConvertor;
		IOSlaveConfigWidget 	* m_ioslaveConfig;
};



#endif
