author | drw <drw> | 2004-04-06 16:00:07 (UTC) |
---|---|---|
committer | drw <drw> | 2004-04-06 16:00:07 (UTC) |
commit | 76406c20db58f6007539db80e0f7b27e7cc3e83f (patch) (unidiff) | |
tree | 0f19911a7ec644bb40e0e4650b312ddccffb5ad3 /noncore/apps/dagger/mainwindow.h | |
parent | 31a82304d62ab4943c0926c35cce552e2164eaf4 (diff) | |
download | opie-76406c20db58f6007539db80e0f7b27e7cc3e83f.zip opie-76406c20db58f6007539db80e0f7b27e7cc3e83f.tar.gz opie-76406c20db58f6007539db80e0f7b27e7cc3e83f.tar.bz2 |
New Bible reader app
Diffstat (limited to 'noncore/apps/dagger/mainwindow.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/dagger/mainwindow.h | 134 |
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 | /* | ||
2 | Dagger - A Bible study program utilizing the Sword library. | ||
3 | Copyright (c) 2004 Dan Williams <drw@handhelds.org> | ||
4 | |||
5 | This file is free software; you can redistribute it and/or modify it under | ||
6 | the terms of the GNU General Public License as published by the Free Software | ||
7 | Foundation; either version 2 of the License, or (at your option) any later version. | ||
8 | |||
9 | This file is distributed in the hope that it will be useful, but WITHOUT ANY | ||
10 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
11 | PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
12 | |||
13 | You should have received a copy of the GNU General Public License along with this | ||
14 | file; see the file COPYING. If not, write to the Free Software Foundation, Inc., | ||
15 | 59 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 | |||
32 | class QAction; | ||
33 | class QMenuBar; | ||
34 | class QPixmap; | ||
35 | class QToolBar; | ||
36 | |||
37 | class NavBar; | ||
38 | class SearchBar; | ||
39 | |||
40 | class MainWindow : public QMainWindow | ||
41 | { | ||
42 | Q_OBJECT | ||
43 | |||
44 | public: | ||
45 | MainWindow( QWidget *parent = 0x0, const char *name = 0x0, WFlags fl = 0 ); | ||
46 | ~MainWindow(); | ||
47 | |||
48 | static QString appName() { return QString::fromLatin1( "dagger" ); }; | ||
49 | |||
50 | protected: | ||
51 | bool eventFilter( QObject *obj, QEvent *event ); | ||
52 | |||
53 | private: | ||
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 | |||
95 | private 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 | |||
128 | signals: | ||
129 | void sigNumVersesChanged( int numVerses ); | ||
130 | void sigFontChanged( const QFont *newFont ); | ||
131 | void sigOptionChanged(); | ||
132 | }; | ||
133 | |||
134 | #endif | ||