summaryrefslogtreecommitdiff
path: root/src/frontend/keychooser/versekeychooser/cbiblekeychooser.h
blob: 9501099feaf50ff6e001b2cfd79898bb4bbb57b6 (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
77
78
79
/*********
*
* This file is part of BibleTime's source code, http://www.bibletime.info/.
*
* Copyright 1999-2008 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 "frontend/keychooser/ckeychooser.h"

#include <QList>
#include "backend/drivers/cswordbiblemoduleinfo.h"


class QWidget;

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(QList<CSwordModuleInfo*> modules, CSwordKey *key = 0, QWidget *parent = 0);

    public slots:
        /**
        * see @ref CKeyChooser::getKey
        */
        CSwordKey* key();
        /**
        * see @ref CKeyChooser::setKey
        */
        virtual void setKey(CSwordKey *key);
        /**
        * Sets the module
        */
        virtual void setModules(const QList<CSwordModuleInfo*>& modules, const bool refresh = true);
        /**
        * used to do actions before key changes
        */
        void beforeRefChange(CSwordVerseKey *key);
        /**
        * used to do actions after key changes
        */
        void refChanged(CSwordVerseKey *key);

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

    protected slots:
        virtual void setKey(QString& newKey);

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

#endif