diff options
Diffstat (limited to 'src/frontend/searchdialog/csearchdialog.h')
-rw-r--r-- | src/frontend/searchdialog/csearchdialog.h | 62 |
1 files changed, 37 insertions, 25 deletions
diff --git a/src/frontend/searchdialog/csearchdialog.h b/src/frontend/searchdialog/csearchdialog.h index 55bded4..b8c097f 100644 --- a/src/frontend/searchdialog/csearchdialog.h +++ b/src/frontend/searchdialog/csearchdialog.h @@ -2,7 +2,7 @@ * * This file is part of BibleTime's source code, http://www.bibletime.info/. * -* Copyright 1999-2008 by the BibleTime developers. +* Copyright 1999-2011 by the BibleTime developers. * The BibleTime source code is licensed under the GNU General Public License version 2.0. * **********/ @@ -15,12 +15,10 @@ #include <QString> #include "backend/cswordmodulesearch.h" #include "backend/managers/cswordbackend.h" -#include "util/cpointers.h" - +#include "frontend/searchdialog/btsearchoptionsarea.h" namespace Search { class BtSearchResultArea; -class BtSearchOptionsArea; } class QPushButton; class QWidget; @@ -28,12 +26,15 @@ class QWidget; namespace Search { /** - *@author The BibleTime team - */ + \note destroys itself on close +*/ class CSearchDialog : public QDialog { Q_OBJECT public: - static void openDialog(const QList<CSwordModuleInfo*> modules, const QString& searchText = QString::null, QWidget* parentDialog = 0); + static void openDialog(const QList<const CSwordModuleInfo*> modules, + const QString &searchText = QString::null, + QWidget *parentDialog = 0); + static void closeDialog(); protected: @@ -47,10 +48,6 @@ class CSearchDialog : public QDialog { */ static CSearchDialog* getSearchDialog(); - /** - * The constructor of the dialog. It's protected because you should use the static public function openDialog. - * The dialog destroys itself if it was closed. - */ CSearchDialog(QWidget *parent); ~CSearchDialog(); @@ -58,33 +55,48 @@ class CSearchDialog : public QDialog { * Initializes this object. */ void initView(); + /** - * Starts the search with the given module list and given search text. - * Doesn't wait for the start button press, starts immediately + Starts the search with the given module list and given search text. */ - void startSearch( const QList<CSwordModuleInfo*> modules, const QString& searchText); + void startSearch(const QList<const CSwordModuleInfo*> modules, + const QString &searchText); + /**Prepares the search string given by user for a specific search type */ QString prepareSearchText(const QString& orig); + /** - * Sets the list of modules for the search. + Sets the list of modules for the search. */ - void setModules( const QList<CSwordModuleInfo*> modules ); + void setModules(const QList<const CSwordModuleInfo*> modules) { + m_searchOptionsArea->setModules(modules); + } + /** - * Returns the list of used modules. + Returns the list of used modules. */ - QList<CSwordModuleInfo*> modules() const; + inline QList<const CSwordModuleInfo*> modules() const { + return m_searchOptionsArea->modules(); + } + /** * Sets the search text which is used for the search. */ - void setSearchText( const QString searchText ); + void setSearchText( const QString &searchText ); + /** - * Returns the search text which is set currently. + \returns the search text which is set currently. */ - QString searchText() const; + QString searchText() const { + return m_searchOptionsArea->searchText(); + } + /** - * Returns the used search scope as a list key + \returns the used search scope as a list key */ - sword::ListKey searchScope(); + inline sword::ListKey searchScope() const { + return m_searchOptionsArea->searchScope(); + } /** * Resets the parts to the default. @@ -101,10 +113,10 @@ class CSearchDialog : public QDialog { protected slots: /** - * Starts the search with the set modules and the set search text. + Starts the search with the set modules and the set search text. */ void startSearch(); - void searchFinished(); + void showModulesSelector(); /** * Initializes the signal slot connections |