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.
17
#include "backend/cswordmoduleinfo.h"
19
class CSwordModuleInfo;
23
* The base class for the KeyChooser.
24
* Do not use directly, create a KeyChooser with
25
* @ref #createInstance , this will create the proper one
26
* of the classes that inherit from @ref CKeyChooser
28
* @author The BibleTime team
31
class CKeyChooser : public QWidget {
36
* Creates a proper Instance, either
38
@ref CLexiconKeyChooser or
39
* @ref CBibleKeyChooser
40
* @param info the @ref CModuleInfo to be represented by the KeyChooser
41
* @param key if not NULL, the @ref CKey the KeyChooser should be set to
42
* @param parent the parent of the widget to create
44
static CKeyChooser* createInstance(ListCSwordModuleInfo modules, CSwordKey *key, QWidget *parent);
46
const QStringList getPreviousKeys() const;
47
const QStringList getNextKeys() const;
52
* @param key the key which the widget should be set to
54
virtual void setKey(CSwordKey* key) = 0;
57
* @param key the key which the widget should be set to
59
virtual void updateKey(CSwordKey* key) = 0;
61
* gets the current @ref CKey
63
* @return the current @ref CKey
65
virtual CSwordKey* const key() = 0;
67
* Sets the module of this keychooser and refreshes the comboboxes
69
virtual void setModules( const ListCSwordModuleInfo& modules, const bool refresh = true ) = 0;
71
* Freshes the content of the different key chooser parts.
73
virtual void refreshContent() = 0;
75
void addToHistory(CSwordKey*);
78
void backInHistory(int);
80
void forwardInHistory();
81
void forwardInHistory(int);
85
* is emitted if the @ref CKey was changed by the user
87
void keyChanged(CSwordKey* key);
89
* Is emitted before the key is changed!
91
void beforeKeyChange(const QString& key);
92
void historyChanged();
96
* the constructor - DO NOT USE! -- use @ref #createInstance instead!
98
CKeyChooser(ListCSwordModuleInfo info, CSwordKey *key=0, QWidget *parent=0, const char *name=0);
99
virtual ~CKeyChooser();
101
* Set the appropriate font do display the modules
103
virtual void adjustFont() = 0;
106
QStringList m_prevKeyHistoryList;
107
QStringList m_nextKeyHistoryList;
108
int m_currentKeyHistoryPos;
109
bool m_inHistoryFunction;
111
virtual void polish();