~vcs-imports/bibletime/trunk

« back to all changes in this revision

Viewing changes to bibletime/backend/cswordmodulesearch.h

  • Committer: mgruner
  • Date: 2007-05-08 15:51:07 UTC
  • Revision ID: vcs-imports@canonical.com-20070508155107-0rj7jdmm5ivf8685
-imported source and data files to new svn module
-this is where KDE4-based development will take place

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*********
 
2
*
 
3
* This file is part of BibleTime's source code, http://www.bibletime.info/.
 
4
*
 
5
* Copyright 1999-2006 by the BibleTime developers.
 
6
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
 
7
*
 
8
**********/
 
9
 
 
10
 
 
11
 
 
12
#ifndef CSWORDMODULESEARCH_H
 
13
#define CSWORDMODULESEARCH_H
 
14
 
 
15
//BibleTime - backend
 
16
#include "cswordmoduleinfo.h"
 
17
 
 
18
//BibleTime - utils
 
19
#include "util/cpointers.h"
 
20
 
 
21
//Qt includes
 
22
#include <qptrlist.h>
 
23
#include <qstring.h>
 
24
#include <qsignal.h>
 
25
 
 
26
//System includes
 
27
#include <pthread.h>
 
28
 
 
29
//Sword includes
 
30
#include <listkey.h>
 
31
 
 
32
/**
 
33
 * CSwordModuleSearch manages the search on Sword modules. It manages the thread(s)
 
34
 * and manages the different modules.
 
35
  *
 
36
  * @author The BibleTime team
 
37
  * @version $Id: cswordmodulesearch.h,v 1.34 2006/08/08 19:32:48 joachim Exp $
 
38
  */
 
39
 
 
40
class CSwordModuleSearch: public CPointers {
 
41
 
 
42
public:
 
43
        CSwordModuleSearch();
 
44
        /**
 
45
        * The destructor of this class. It cleans uop memory before it's deleted.
 
46
        */
 
47
        virtual ~CSwordModuleSearch();
 
48
        /**
 
49
        * Sets the text which should be search in the modules.
 
50
        */
 
51
        void setSearchedText( const QString& );
 
52
        /**
 
53
        * Starts the search for the search text.
 
54
        */
 
55
        const bool startSearch();
 
56
        /**
 
57
        * This function sets the modules which should be searched.
 
58
        */
 
59
        void setModules( const ListCSwordModuleInfo& );
 
60
        /**
 
61
        * Sets the search scope.
 
62
        */
 
63
        void setSearchScope( const sword::ListKey& scope );
 
64
        /**
 
65
        * Sets the seaech scope back.
 
66
        */
 
67
        void resetSearchScope();
 
68
        /**
 
69
        * @return "true" if in the last search the searcher found items, if no items were found return "false"
 
70
        */
 
71
        const bool foundItems() const;
 
72
        /**
 
73
        * Returns a copy of the used search scope.
 
74
        */
 
75
        const sword::ListKey& searchScope() const;
 
76
 
 
77
        void connectFinished( QObject * receiver, const char * member );
 
78
        void searchFinished();
 
79
 
 
80
        /**
 
81
        * Returns true if all of the specified modules have indices already built.
 
82
        */
 
83
        const bool modulesHaveIndices( const ListCSwordModuleInfo& );
 
84
 
 
85
protected:
 
86
        QString m_searchedText;
 
87
        sword::ListKey m_searchScope;
 
88
        ListCSwordModuleInfo m_moduleList;
 
89
 
 
90
        int m_searchOptions;
 
91
 
 
92
        bool m_foundItems;
 
93
 
 
94
private:
 
95
        QSignal m_finishedSig;
 
96
        static CSwordModuleSearch* searcher;
 
97
};
 
98
 
 
99
#endif