summaryrefslogtreecommitdiff
path: root/noncore/apps/dagger/mainwindow.h
Unidiff
Diffstat (limited to 'noncore/apps/dagger/mainwindow.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/dagger/mainwindow.h134
1 files changed, 134 insertions, 0 deletions
diff --git a/noncore/apps/dagger/mainwindow.h b/noncore/apps/dagger/mainwindow.h
new file mode 100644
index 0000000..0c7f3c8
--- a/dev/null
+++ b/noncore/apps/dagger/mainwindow.h
@@ -0,0 +1,134 @@
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 MAINWINDOW_H
19#define MAINWINDOW_H
20
21#include "swordoptionlist.h"
22
23#include <opie2/otabwidget.h>
24
25#include <qpe/config.h>
26
27#include <qmainwindow.h>
28#include <qtimer.h>
29
30#include <swmgr.h>
31
32class QAction;
33class QMenuBar;
34class QPixmap;
35class QToolBar;
36
37class NavBar;
38class SearchBar;
39
40class MainWindow : public QMainWindow
41{
42 Q_OBJECT
43
44public:
45 MainWindow( QWidget *parent = 0x0, const char *name = 0x0, WFlags fl = 0 );
46 ~MainWindow();
47
48 static QString appName() { return QString::fromLatin1( "dagger" ); };
49
50protected:
51 bool eventFilter( QObject *obj, QEvent *event );
52
53private:
54 sword::SWMgr *m_swordMgr; // Sword library module manager
55 Config m_config; // Application configuration
56
57 // Configuration items
58 QString m_modulePath; // Directory where sword modules are located
59 bool m_alwaysOpenNew; // Whether or not open modules as new window/tab (or re-use existing)
60 int m_numVerses; // Number of verses to display at a time for Bible modules
61 bool m_disableScreenBlank; // Whether or not to disable automatic screen blanking
62 int m_copyFormat; // Format used when copying
63 QFont m_textFont; // Font used for module text
64
65 // UI components
66 QToolBar *m_barDock; // Main toolbar which contains menu and all other toolbars
67 QMenuBar *m_menuBar; // Application menu bar
68 QPopupMenu *m_bookmarkMenu; // Pointer to bookmark menu
69 NavBar *m_navToolbar; // Text navigation toolbar
70 SearchBar *m_searchToolbar; // Text search toolbar
71 Opie::Ui::OTabWidget m_tabs; // Main widget in which all texts, notes, etc. will be displayed
72
73 // Other visual items
74 QPixmap *m_bibleIcon; // Icon used for bible modules
75 QPixmap *m_commentaryIcon; // Icon used for commentary modules
76 QPixmap *m_lexiconIcon; // Icon used for lexicon modules
77
78 QTimer m_autoScrollTimer; // Timer for auto-scrolling of bible texts
79
80 // Menubar/toolbar actions
81 SwordOptionList m_actionSwordOpts; // List of actions for sword options
82 // (e.g. footnotes, Strong's numbers, etc.)
83 QAction *m_actionTextClose; // Action for closing currently opened module
84 QAction *m_actionEditCopy; // Action for copying text from current module
85 QAction *m_actionBookmarkAdd; // Action for adding a bookmark
86 QAction *m_actionBookmarkRemove; // Action for removing a bookmark
87 QAction *m_actionViewNavToolbar; // Action for displaying/hiding the navigation toolbar
88 QAction *m_actionViewSearchToolbar; // Action for displaying/hiding the search toolbar
89
90 void initUI();
91 void openModule( const QString &modulename, const QString &key = 0x0 );
92 int findBookmark( const QString &bookmark );
93 void enableScreenBlanking( bool enable );
94
95private slots:
96 void initConfig();
97
98 void slotTextDisplayed( QWidget *textWidget );
99
100 // Menubar/toolbar action slots
101 void slotTextOpen();
102 void slotTextClose();
103 void slotTextInstall();
104 void slotEditCopy();
105 void slotEditConfigure();
106 void slotBookmarkAdd();
107 void slotBookmarkRemove();
108 void slotBookmarkSelected();
109 void slotViewSwordOption( bool enabled );
110 void slotViewNavToolbar( bool enabled );
111 void slotViewSearchToolbar( bool enabled );
112
113 // Navigation toolbar slots
114 void slotNavPrevChapter();
115 void slotNavPrevVerse();
116 void slotNavKeyChanged( const QString &newKey );
117 void slotNavNextVerse();
118 void slotNavNextChapter();
119 void slotNavAutoScroll( bool enabled );
120 void slotNavScrollRateChanged( int newRate );
121
122 // Search toolbar slots
123 void slotSearchResultClicked( const QString &key );
124
125 // Text widget slots
126 void slotTextRefClicked( const QString &ref );
127
128signals:
129 void sigNumVersesChanged( int numVerses );
130 void sigFontChanged( const QFont *newFont );
131 void sigOptionChanged();
132};
133
134#endif