2 This file is part of KHelpCenter.
4 Copyright (c) 2005 Cornelius Schumacher <schumacher@kde.org>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef KHC_SEARCHHANDLER_H
21 #define KHC_SEARCHHANDLER_H
23 #include "searchengine.h"
34 class SearchJob
: public QObject
{
37 SearchJob(DocEntry
*entry
);
40 bool startLocal(const QString
&cmdString
);
41 bool startRemote(const QString
&url
);
44 void searchFinished( SearchJob
*, DocEntry
*, const QString
& );
45 void searchError( SearchJob
*, DocEntry
*, const QString
& );
48 void searchExited( int exitCode
, QProcess::ExitStatus
);
49 void slotJobResult( KJob
*job
);
50 void slotJobData( KIO::Job
*, const QByteArray
&data
);
61 class SearchHandler
: public QObject
65 static SearchHandler
*initFromFile( const QString
&filename
);
67 void search( DocEntry
*, const QStringList
&words
,
69 SearchEngine::Operation operation
= SearchEngine::And
);
71 QString
indexCommand( const QString
&identifier
);
73 QStringList
documentTypes() const;
75 bool checkPaths() const;
78 void searchFinished( SearchHandler
*, DocEntry
*, const QString
& );
79 void searchError( SearchHandler
*, DocEntry
*, const QString
& );
83 bool checkBinary( const QString
&cmd
) const;
86 void searchFinished( SearchJob
*, DocEntry
*, const QString
& );
87 void searchError( SearchJob
*, DocEntry
*, const QString
& );
94 QString mSearchCommand
;
96 QString mIndexCommand
;
97 QStringList mDocumentTypes
;