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


#include "settings.h"
#include <qmap.h>
#include <kconfigdialog.h>
#include "textconverterswidget_base.h"

class TextConverterWidget : public TextConverterWidgetBase
{
  Q_OBJECT


	public:
	
		TextConverterWidget( KDialogBase * , Settings *, QMap< QString ,QString >*,
			     QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
  
		~TextConverterWidget();
  

	public slots:
		void saveSettingsTextConvertor();
		void updateEntriesInWidget(const QString & indexGroup);
		void storeEntries( QString & indexGroup );
		void someIndexSelected(const QString & index);

		void slotMimeOrPattern();
		void slotRemoveMime();
		void slotRemovePattern();
		void slotRemoveTextConvertersName();
		

		

	signals:
		void MimeOrPattern();
		void newTextConverter(const QString &);
		void textConverterRemoved(const QString &);


	protected:
		bool validateStoredIndexEntries(const QString&);
	protected slots:
	
	private:
		//pointer to cluceneindexsettingsrc config kconfigskeleton
		Settings *m_settings;
		KDialogBase *  m_dialog;
		//map of stored index names and corresponding path to the index database
		QMap<QString , QString > * m_indexMap;
		QMap<QString , QString > * m_textConvertersNameMap;
				
		QStringList m_patternList;
		QStringList m_patternProc;
		QStringList m_patternArgs;
		QStringList m_patternOutput;
		
		QStringList m_mimeList;
		QStringList m_mimeProc;
		QStringList m_mimeArgs;
		QStringList m_mimeOutput;


};

#endif

