Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

textwidget.h

Go to the documentation of this file.
00001 /*
00002 Dagger - A Bible study program utilizing the Sword library.
00003 Copyright (c) 2004 Dan Williams <drw@handhelds.org>
00004 
00005 This file is free software; you can redistribute it and/or modify it under
00006 the terms of the GNU General Public License as published by the Free Software
00007 Foundation; either version 2 of the License, or (at your option) any later version.
00008 
00009 This file is distributed in the hope that it will be useful, but WITHOUT ANY
00010 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
00011 PARTICULAR PURPOSE. See the GNU General Public License for more details.
00012 
00013 You should have received a copy of the GNU General Public License along with this
00014 file; see the file COPYING. If not, write to the Free Software Foundation, Inc.,
00015 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00016 */
00017 
00018 #ifndef TEXTWIDGET_H
00019 #define TEXTWIDGET_H
00020 
00021 #include <qwidget.h>
00022 
00023 #include <swkey.h>
00024 #include <swmodule.h>
00025 
00026 class QTextBrowser;
00027 
00028 class TextWidget : public QWidget
00029 {
00030     Q_OBJECT
00031 
00032 public:
00033     TextWidget( QWidget *parent = 0x0, sword::SWModule *module = 0x0, int numVerses = 5,
00034                 const QFont *font = 0x0 );
00035     ~TextWidget();
00036 
00037     const QString   &getFullKey()    { return m_fullKey; }
00038     const QString   &getAbbrevKey()  { return m_abbrevKey; }
00039     QString          getModuleName() { return QString( m_module->Name() ); }
00040     sword::SWModule *getModule()     { return m_module; }
00041     QString          getCurrVerse();
00042 
00043     bool isBibleText() const { return m_isBibleText; }
00044 
00045     void prevPage();
00046     void prevVerse();
00047     void setKey( const QString &newKey );
00048     void nextVerse();
00049     void nextPage();
00050 
00051 public slots:
00052     void slotNumVersesChanged( int numVerses );
00053     void slotFontChanged( const QFont *newFont );
00054     void slotOptionChanged();
00055 
00056 private:
00057     sword::SWModule *m_module;      // Sword module to display in this widget
00058     sword::SWKey    *m_key;         // Current module key
00059     bool             m_isBibleText; // Indicates whether module is a Bible or not
00060 
00061     QTextBrowser    *m_textView;    // Displays module's text
00062     QString          m_fullKey;     // Contains full key text in format 'key (module)'
00063     QString          m_abbrevKey;   // Contains abbreviated key text
00064 
00065     int              m_numVerses;   // Number of verses to display at a time for Bible modules
00066 
00067     void setText();
00068 
00069 signals:
00070     void sigRefClicked( const QString &ref );
00071 };
00072 
00073 #endif

Generated on Sat Nov 5 16:16:48 2005 for OPIE by  doxygen 1.4.2