summaryrefslogtreecommitdiff
path: root/src/frontend/keychooser/cbookkeychooser.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/keychooser/cbookkeychooser.h')
-rw-r--r--src/frontend/keychooser/cbookkeychooser.h86
1 files changed, 86 insertions, 0 deletions
diff --git a/src/frontend/keychooser/cbookkeychooser.h b/src/frontend/keychooser/cbookkeychooser.h
new file mode 100644
index 0000000..80dd03f
--- /dev/null
+++ b/src/frontend/keychooser/cbookkeychooser.h
@@ -0,0 +1,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 CBOOKKEYCHOOSER_H
+#define CBOOKKEYCHOOSER_H
+
+//BibleTime includes
+#include "ckeychooser.h"
+#include "ckeychooserwidget.h"
+
+#include <QList>
+
+class CSwordKey;
+class CSwordBookModuleInfo;
+class CSwordTreeKey;
+
+namespace sword {
+ class TreeKeyIdx;
+}
+
+/** The keychooser implementation for books.
+ * @author The BibleTime team
+ */
+class CBookKeyChooser : public CKeyChooser {
+ Q_OBJECT
+public:
+ CBookKeyChooser(QList<CSwordModuleInfo*> modules, CSwordKey *key=0, QWidget *parent=0);
+ ~CBookKeyChooser();
+ /**
+ * Refreshes the content.
+ */
+ virtual void refreshContent();
+ /**
+ * Sets another module to this keychooser
+ */
+ virtual void setModules(const QList<CSwordModuleInfo*>& modules, const bool refresh = false);
+ /**
+ * Returns the key of this keychooser
+ */
+ virtual CSwordKey* key();
+ /**
+ * Sets a new key to this keychooser
+ */
+ virtual void setKey(CSwordKey*);
+ /**
+ * Sets a new key to this keychooser
+ */
+ void setKey(CSwordKey*, const bool emitSignal);
+
+
+public slots: // Public slots
+ /**
+ * Updates the keychoosers for the given key but emit no signal.
+ */
+ void updateKey(CSwordKey*);
+
+protected: // Protected methods
+ /**
+ * Fills the combo given by depth with the items from the key having depth "depth".
+ * The parent sibling is given by key.
+ */
+ void setupCombo(const QString key, const int depth, const int currentItem);
+ /** No descriptions */
+ virtual void adjustFont();
+
+protected slots:
+ /**
+ * A keychooser changed. Update and emit a signal if necessary.
+ */
+ void keyChooserChanged(int);
+ virtual void setKey(QString& newKey);
+
+private:
+ QList<CKeyChooserWidget*> m_chooserWidgets;
+ QList<CSwordBookModuleInfo*> m_modules;
+ CSwordTreeKey *m_key;
+ QHBoxLayout* m_layout;
+};
+
+#endif