3
* This file is part of BibleTime's source code, http://www.bibletime.info/.
5
* Copyright 1999-2006 by the BibleTime developers.
6
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
12
#ifndef BIBLETIME_INTERFACE_H
13
#define BIBLETIME_INTERFACE_H
17
#include <qstringlist.h>
20
#include <dcopobject.h>
21
#include <kmainwindowiface.h>
23
/** DCOP interface definition for BibleTime.
24
* This is the interface definition for BibleTime's DCOP client interface. The main window class "BibleTime"
25
* inherits from this class and re-implements these pure virtual functions.
26
* It uses virtual inheritance so that a widget which inherits twice from DCOPObject does not get mixed up.
27
* This file is turned into bibletimeinterface_skel.cpp by the KDE automake system.
29
* @author Joachim Ansorg
31
class BibleTimeInterface : virtual public DCOPObject {
32
//This K_DCOP line is required so that the k_dcop: and void are processed.
36
BibleTimeInterface(QCString id) : DCOPObject(id) {}
39
/** Sync all open Bible windows to the key.
40
* @param key The key which is set to all Bible windows.
42
virtual void syncAllBibles(const QString& key) = 0;
43
/** Sync all open commentary windows to the key.
44
* @param key The key which is set to all Commentary windows.
46
virtual void syncAllCommentaries(const QString& key) = 0;
47
/** Sync all open lexicon windows to the key.
48
* @param key The key which is set to all Lexicon windows.
50
virtual void syncAllLexicons(const QString& key) = 0;
51
/** Sync all open verse based (i.e. Bibles and commentaries) windows to the key.
52
* @param key The key which is set to all Bible and Commentary windows.
54
virtual void syncAllVerseBasedModules(const QString& key) = 0;
55
/** Reload all modules
57
virtual void reloadModules() = 0;
58
/** Open a new read window for the module moduleName using the given key
59
* @param moduleName The name of the module which is opened in a new module window.
60
* @param key The key to set to the newly opened window.
62
virtual void openWindow(const QString& moduleName, const QString& key) = 0;
63
/** Open a new read window for the default Bible module using the given key
64
* @param key The key to set to the newly opened window.
66
virtual void openDefaultBible(const QString& key) = 0;
67
/** Close all open windows.
69
virtual void closeAllModuleWindows() = 0;
70
/** Returns the reference used in the current window.
71
* The format of the returned reference is
72
* [Module] [Type] OSIS_Reference,
73
* wtih type one of BIBLE/COMMENTARY/BOOK/LEXICON/UNSUPPORTED
74
* If the type is BIBLE or COMMENTARY the reference is an OSIS ref
75
* in the other cases it's the key name, for books /Chapter/Subsection
76
* for Lexicons just the plain key, e.g. "ADAM".
78
* [KJV] [BIBLE] Gen.1.1
79
* [MHC] [COMMENTARY] Gen.1.1
80
* [ISBE] [LEXICON] REDEMPTION
81
* @return The reference displayed in the currently active module window. Empty if none is active.
83
virtual QString getCurrentReference() = 0;
84
/** Seach the searchText in the specified module.
85
* @param moduleName The module to search in
86
* @param searchText Search for this in the modules
87
* @return The search result. It's in the format [modulename] osis_ref_of_the_found_key. For example "[KJV] Gen.1.1".
89
virtual QStringList searchInModule(const QString& moduleName, const QString& searchText) = 0;
90
/** Search in all open modules and return the search result.
91
* The result is in the same format as searchInModule
92
* @param searchText Search for this in the modules
93
* @return The search result for a searchin all opened module windows
94
* @see searchInModule For the search result format.
96
virtual QStringList searchInOpenModules(const QString& searchText) = 0;
97
/** Search in the default Bible module and return the search result.
98
* The result is in the same format as searchInModule
99
* @param searchText Search for this in the modules
100
* @return The search result for a search in the default Bible
101
* @see searchInModule
103
virtual QStringList searchInDefaultBible(const QString& searchText) = 0;
104
/** Return a list of modules of the given type.
105
* @param type One of BIBLES, COMMENTARIES, LEXICONS, BOOKS
106
* @return The list of modules of the given type, may be empty
108
virtual QStringList getModulesOfType(const QString& type) = 0;