#ifndef _KCLUCENE_DAEMON_H
#define _KCLUCENE_DAEMON_H

#include <qstringlist.h>
#include <qmap.h>
#include <kdebug.h>
#include <qdict.h>

#include <CLucene.h>
#include <CLucene/search/IndexSearcher.h>

// constains methods and data structures needed to search
// kclucene indexes
class KCLuceneDaemon {
	public:
		KCLuceneDaemon ();
		~KCLuceneDaemon ();
		void deleteSearchers (QStringList &indexesPathList, QString *res);
		bool initCLuceneIndexes (QStringList &indexesPathList);
		QStringList getValidSubList(QStringList indexesPathList);
		int initIndexes(QStringList indexesPathList);
		int initSingleIndex( QStringList indexesPathList );
		int initMultiIndex( QStringList  indexesPathList);
		void prepareIndexForQuery (QStringList &indexesPathList);
		bool isIndexesListValid(QStringList & /*indexesPathList*/);
		bool isIndexesPathListValid(QStringList indexesPathList);
		bool InitAllSingleSearchers(QStringList & indexesPathList);
		bool InitAllMultiSearchers(QStringList & indexesPathList);

		QDict <lucene::search::IndexSearcher>  m_indexSingleSearchersList;
		QDict <QStringList   >  m_indexMultiSearchersList;
		
		QMap <QString, int> m_indexMultiSearchersListCounter;
		QMap <QString, int> m_indexSingleSearchersListCounter;
		

};

#endif
