~ubuntu-branches/ubuntu/intrepid/bibletime/intrepid

« back to all changes in this revision

Viewing changes to bibletime/frontend/keychooser/cbookkeychooser.h

  • Committer: Bazaar Package Importer
  • Author(s): Ralph Janke
  • Date: 2008-05-10 15:18:16 UTC
  • mfrom: (1.1.6 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080510151816-bqp8y1to705zd0fm
Tags: 1.6.5.1-1
* New upstream version (Closes: #441161, #271502)
* fixes for new autotools and gcc 4.3 (Closes: #407291)
* added poxml to Build-Depends
* No DFSG necessary anymore since biblestudy howto has 
  now Commons Licence 
* Added libclucene-dev to dev-depends (Closes: #436677)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*********
 
2
*
 
3
* This file is part of BibleTime's source code, http://www.bibletime.info/.
 
4
*
 
5
* Copyright 1999-2006 by the BibleTime developers.
 
6
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
 
7
*
 
8
**********/
 
9
 
 
10
 
 
11
 
 
12
#ifndef CBOOKKEYCHOOSER_H
 
13
#define CBOOKKEYCHOOSER_H
 
14
 
 
15
//BibleTime includes
 
16
#include "ckeychooser.h"
 
17
#include "ckeychooserwidget.h"
 
18
 
 
19
//Sword includes
 
20
 
 
21
//Qt includes
 
22
#include <qwidget.h>
 
23
#include <qsize.h>
 
24
#include <qmap.h>
 
25
#include <qptrlist.h>
 
26
#include <qstringlist.h>
 
27
 
 
28
class CSwordKey;
 
29
class CSwordBookModuleInfo;
 
30
class CSwordTreeKey;
 
31
 
 
32
namespace sword {
 
33
        class TreeKeyIdx;
 
34
}
 
35
 
 
36
class QHBoxLayout;
 
37
 
 
38
/** The keychooser implementation for books.
 
39
  * @author The BibleTime team
 
40
  */
 
41
class CBookKeyChooser : public CKeyChooser  {
 
42
        Q_OBJECT
 
43
public:
 
44
        CBookKeyChooser(ListCSwordModuleInfo modules, CSwordKey *key=0, QWidget *parent=0, const char *name=0);
 
45
        ~CBookKeyChooser();
 
46
        /**
 
47
        * Refreshes the content.
 
48
        */
 
49
        virtual void refreshContent();
 
50
        /**
 
51
        * Sets another module to this keychooser
 
52
        */
 
53
        virtual void setModules(const ListCSwordModuleInfo& modules, const bool refresh = false);
 
54
        /**
 
55
        * Returns the key of this kechooser.
 
56
        */
 
57
        virtual CSwordKey* const key();
 
58
        /**
 
59
        * Sets a new key to this keychooser
 
60
        */
 
61
        virtual void setKey(CSwordKey*);
 
62
        /**
 
63
        * Sets a new key to this keychooser
 
64
        */
 
65
        void setKey(CSwordKey*, const bool emitSignal);
 
66
 
 
67
 
 
68
public slots: // Public slots
 
69
        /**
 
70
        * Updates the keychoosers for the given key but emit no signal.
 
71
        */
 
72
        void updateKey(CSwordKey*);
 
73
 
 
74
protected: // Protected methods
 
75
        /**
 
76
        * Fills the combo given by depth with the items from the key having depth "depth".
 
77
        * The parent sibling is given by key.
 
78
        */
 
79
        void setupCombo(const QString key, const int depth, const int currentItem);
 
80
        /** No descriptions */
 
81
        virtual void adjustFont();
 
82
 
 
83
protected slots:
 
84
        /**
 
85
        * A keychooser changed. Update and emit a signal if necessary.
 
86
        */
 
87
        void keyChooserChanged(int);
 
88
        //is called when a keychooser widget wants to jump to the next/previous key
 
89
        //  void nextEntry();
 
90
        //  void previousEntry();
 
91
 
 
92
private:
 
93
        QPtrList<CKeyChooserWidget> m_chooserWidgets;
 
94
        QPtrList<CSwordBookModuleInfo> m_modules;
 
95
        CSwordTreeKey *m_key;
 
96
        QHBoxLayout* m_layout;
 
97
};
 
98
 
 
99
#endif