summaryrefslogtreecommitdiffstats
path: root/bibletime/frontend/keychooser/cbiblekeychooser.h
blob: 34722e491284c53e3395532140a904ab7895e7d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*********
*
* This file is part of BibleTime's source code, http://www.bibletime.info/.
*
* Copyright 1999-2006 by the BibleTime developers.
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
*
**********/



#ifndef CBIBLEKEYCHOOSER_H
#define CBIBLEKEYCHOOSER_H

#include <tqwidget.h>
#include "ckeychooser.h"

#include "backend/cswordbiblemoduleinfo.h"

class CKeyReferenceWidget;
class CSwordVerseKey;
class CSwordBibleModuleInfo;

/** This class implements the KeyChooser for bibles and commentaries
 *
 * it inhertits @ref CKeyChooser
 *
 * it uses a CKeyReferenceWidget 's to represent the bible keys
 *
  * @author The BibleTime team
  */

class CBibleKeyChooser : public CKeyChooser  {
	Q_OBJECT
  

public:
	/**
	* the constructor
	* you should not need to use this, use @ref CKeyChooser::createInstance instead
	*/
	CBibleKeyChooser(ListCSwordModuleInfo modules, CSwordKey *key=0, TQWidget *parent=0, const char *name=0);

public slots:
	/**
	* see @ref CKeyChooser::getKey
	*/
#ifndef Q_MOC_RUN
	CSwordKey* const key();
#endif // Q_MOC_RUN
	/**
	* see @ref CKeyChooser::setKey
	*/
	virtual void setKey(CSwordKey *key);
	/**
	* Sets the module
	*/
	virtual void setModules(const ListCSwordModuleInfo& modules, const bool refresh = true);
	/**
	* used to react to changes
	* @param index not used
	*/
	void refChanged(CSwordVerseKey *key);

	void updateKey(CSwordKey* key);
	void adjustFont();
	void refreshContent();


private:
	CKeyReferenceWidget* w_ref;
	TQPtrList<CSwordBibleModuleInfo> m_modules;
	CSwordVerseKey *m_key;
};

#endif