summaryrefslogtreecommitdiff
path: root/noncore/apps/dagger/textwidget.h
Unidiff
Diffstat (limited to 'noncore/apps/dagger/textwidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/dagger/textwidget.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/noncore/apps/dagger/textwidget.h b/noncore/apps/dagger/textwidget.h
new file mode 100644
index 0000000..647eae9
--- a/dev/null
+++ b/noncore/apps/dagger/textwidget.h
@@ -0,0 +1,73 @@
1/*
2Dagger - A Bible study program utilizing the Sword library.
3Copyright (c) 2004 Dan Williams <drw@handhelds.org>
4
5This file is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License as published by the Free Software
7Foundation; either version 2 of the License, or (at your option) any later version.
8
9This file is distributed in the hope that it will be useful, but WITHOUT ANY
10WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13You should have received a copy of the GNU General Public License along with this
14file; see the file COPYING. If not, write to the Free Software Foundation, Inc.,
1559 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16*/
17
18#ifndef TEXTWIDGET_H
19#define TEXTWIDGET_H
20
21#include <qwidget.h>
22
23#include <swkey.h>
24#include <swmodule.h>
25
26class QTextBrowser;
27
28class TextWidget : public QWidget
29{
30 Q_OBJECT
31
32public:
33 TextWidget( QWidget *parent = 0x0, sword::SWModule *module = 0x0, int numVerses = 5,
34 const QFont *font = 0x0 );
35 ~TextWidget();
36
37 const QString &getFullKey() { return m_fullKey; }
38 const QString &getAbbrevKey() { return m_abbrevKey; }
39 QString getModuleName() { return QString( m_module->Name() ); }
40 sword::SWModule *getModule() { return m_module; }
41 QString getCurrVerse();
42
43 bool isBibleText() const { return m_isBibleText; }
44
45 void prevChapter();
46 void prevVerse();
47 void setKey( const QString &newKey );
48 void nextVerse();
49 void nextChapter();
50
51public slots:
52 void slotNumVersesChanged( int numVerses );
53 void slotFontChanged( const QFont *newFont );
54 void slotOptionChanged();
55
56private:
57 sword::SWModule *m_module; // Sword module to display in this widget
58 sword::SWKey *m_key; // Current module key
59 bool m_isBibleText; // Indicates whether module is a Bible or not
60
61 QTextBrowser *m_textView; // Displays module's text
62 QString m_fullKey; // Contains full key text in format 'key (module)'
63 QString m_abbrevKey; // Contains abbreviated key text
64
65 int m_numVerses; // Number of verses to display at a time for Bible modules
66
67 void setText();
68
69signals:
70 void sigRefClicked( const QString &ref );
71};
72
73#endif