00001 // -*- C++ -*- 00002 /* 00003 Phrasehunter - index and query text corpora 00004 Copyright (C) 2006 Torsten Marek (shlomme@gmx.de) & 00005 Armin Schmidt (armin.sch@gmail.com) 00006 00007 This program is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public License 00009 as published by the Free Software Foundation; either version 2 00010 of the License, or (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef SEARCHTAB_H 00023 #define SEARCHTAB_H SEARCHTAB_H 00024 00025 #include <QtGui/QWidget> 00026 #include <QtCore/QString> 00027 00028 #include "ui_searchtab.h" 00029 00030 #include "phrasehunter/searchengine.h" 00031 #include "phrasehunter/statistics.h" 00032 #include "phrasehunter/ph_types.h" 00033 00034 #include "kwicmodels.h" 00035 00036 //! Class that brings the Phrasehunter logic into the GUI. Represented by a search tab in the main window. 00037 class SearchTab: public QWidget, Ui::SearchTab 00038 { 00039 Q_OBJECT 00040 00041 public: 00042 SearchTab(QWidget* parent); 00043 ~SearchTab() 00044 {} 00045 00046 void enableSearch(PhraseHunter::CorpusManager*); 00047 void setStatistics(int, int, int); 00048 00049 private slots: 00050 void search(); 00051 void emitDocumentRequested(const QModelIndex&); 00052 void hideWidgets(); 00053 00054 public slots: 00055 void setContextWidth(int); 00056 void setQueryType(const QString&); 00057 00058 private: 00059 PhraseHunter::SearchEngine* m_searchEngine; 00060 PhraseHunter::StatisticsEngine* m_stats; 00061 00062 unsigned int m_contextWidth; 00063 00064 unsigned int numberOfDocs; 00065 unsigned int numberOfTypes; 00066 unsigned int numberOfTokens; 00067 00068 QString queryType; 00069 00070 KwicTableModel* m_model; 00071 00072 signals: 00073 void documentRequested(PhraseHunter::DocID, PhraseHunter::IdxPos, size_t); 00074 }; 00075 00076 #endif // SEARCHTAB_H