summaryrefslogtreecommitdiff
path: root/src/frontend/keychooser/clexiconkeychooser.h
blob: ea1137b8c11a102aea6f3ab22746848e80457a33 (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
80
81
82
83
84
85
86
/*********
*
* 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 CLEXICONKEYCHOOSER_H
#define CLEXICONKEYCHOOSER_H


#include "ckeychooser.h"
class CSwordModuleInfo;


class CKeyChooserWidget;
class CSwordLexiconModuleInfo;
class CSwordLDKey;

class QWidget;
class QHBoxLayout;

/**
 * This class implements the KeyChooser for lexicons
 *
 * it inhertits @ref CKeyChooser
 * it uses 1 @ref CKeyChooserWidget to represent the lexicon keys
 *
  * @author The BibleTime team
  */
class CLexiconKeyChooser : public CKeyChooser  {
        Q_OBJECT
    public:
        /**
        * The constructor
        *
        * you should not need to use this, use @ref CKeyChooser::createInstance instead
        */
        CLexiconKeyChooser(QList<CSwordModuleInfo*> modules, CSwordKey *key = 0, QWidget *parent = 0);

    public slots:
        /**
        * see @ref CKeyChooser::getKey
        * @return Return the key object we use.
        */
        virtual CSwordKey* key();
        /**
        * see @ref CKeyChooser::setKey
        */
        virtual void setKey(CSwordKey* key);
        /**
        * used to react to changes in the @ref CKeyChooserWidget
        *
        * @param index not used
        **/
        virtual void activated(int index);
        /**
        * Reimplementation.
        */
        virtual void refreshContent();
        /**
        * Sets the module and refreshes the combo boxes of this keychooser.
        */
        virtual void setModules( const QList<CSwordModuleInfo*>& modules, const bool refresh = true );

    protected:
        CKeyChooserWidget *m_widget;
        CSwordLDKey* m_key;
        QList<CSwordLexiconModuleInfo*> m_modules;
        QHBoxLayout *m_layout;

        virtual void adjustFont();

    public slots: // Public slots
        virtual void updateKey(CSwordKey* key);

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

};

#endif