~vcs-imports/bibletime/trunk

« back to all changes in this revision

Viewing changes to bibletime/frontend/coptionsdialog.h

  • Committer: mgruner
  • Date: 2007-05-08 15:51:07 UTC
  • Revision ID: vcs-imports@canonical.com-20070508155107-0rj7jdmm5ivf8685
-imported source and data files to new svn module
-this is where KDE4-based development will take place

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*********
 
2
*
 
3
* This file is part of BibleTime's source code, http://www.bibletime.info/.
 
4
*
 
5
* Copyright 1999-2006 by the BibleTime developers.
 
6
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
 
7
*
 
8
**********/
 
9
 
 
10
 
 
11
 
 
12
#ifndef COPTIONSDIALOG_H
 
13
#define COPTIONSDIALOG_H
 
14
 
 
15
#include "cprofilemgr.h"
 
16
#include "cbtconfig.h"
 
17
#include "util/cpointers.h"
 
18
 
 
19
//QT includes
 
20
#include <qwidget.h>
 
21
#include <qframe.h>
 
22
#include <qguardedptr.h>
 
23
#include <qlabel.h>
 
24
#include <qstring.h>
 
25
#include <qmap.h>
 
26
#include <qdict.h>
 
27
#include <qmap.h>
 
28
 
 
29
//KDE includes
 
30
#include <kdialogbase.h>
 
31
#include <kfontdialog.h>
 
32
#include <kaccel.h>
 
33
#include <kcolorbutton.h>
 
34
#include <kapp.h>
 
35
#include <klocale.h>
 
36
 
 
37
class QHBox;
 
38
class QCheckBox;
 
39
class QComboBox;
 
40
class QRadioButton;
 
41
class QWidgetStack;
 
42
 
 
43
class KListBox;
 
44
class KKeyChooser;
 
45
class KTabCtl;
 
46
class KHTMLPart;
 
47
class KActionCollection;
 
48
 
 
49
/**
 
50
 * The optionsdialog of BibleTime
 
51
  * @author The BibleTime Team
 
52
  */
 
53
class COptionsDialog : public KDialogBase, public CPointers  {
 
54
        Q_OBJECT
 
55
 
 
56
public:
 
57
        COptionsDialog(QWidget *parent, const char *name, KActionCollection* actionCollection);
 
58
        virtual ~COptionsDialog();
 
59
 
 
60
        enum Parts {
 
61
                Startup,
 
62
                Font,
 
63
                DisplayTemplates,
 
64
                Desk,
 
65
                Hotkeys
 
66
        };
 
67
 
 
68
        /** Opens the page which contaisn the given part ID. */
 
69
        const bool showPart( COptionsDialog::Parts ID );
 
70
 
 
71
private:
 
72
        struct Settings {
 
73
                struct StartupSettings {
 
74
                        QCheckBox* showTips;
 
75
                        QCheckBox* showLogo;
 
76
                }
 
77
                startup;
 
78
 
 
79
                struct SwordSettings {
 
80
                        QComboBox* standardBible;
 
81
                        QComboBox* standardCommentary;
 
82
                        QComboBox* standardLexicon;
 
83
                        QComboBox* standardDailyDevotional;
 
84
                        QComboBox* standardHebrewStrong;
 
85
                        QComboBox* standardGreekStrong;
 
86
                        QComboBox* standardHebrewMorph;
 
87
                        QComboBox* standardGreekMorph;
 
88
                        QCheckBox* lineBreaks;
 
89
                        QCheckBox* verseNumbers;
 
90
                        QCheckBox* headings;
 
91
                        QCheckBox* hebrewPoints;
 
92
                        QCheckBox* hebrewCantillation;
 
93
                        QCheckBox* morphSegmentation;
 
94
                        QCheckBox* greekAccents;
 
95
                        QCheckBox* textualVariants;
 
96
                        QCheckBox* scriptureReferences;
 
97
                }
 
98
                swords; // not: sword instead of sword -> namespace error
 
99
 
 
100
                struct KeySettings {
 
101
                        QComboBox* typeChooser;
 
102
                        QWidgetStack* keyChooserStack;
 
103
 
 
104
                        struct WindowType {
 
105
                                QGuardedPtr<KKeyChooser> keyChooser;
 
106
                                KActionCollection* actionCollection;
 
107
                                QString title;
 
108
 
 
109
                                WindowType() {
 
110
                                        keyChooser = 0;
 
111
                                        actionCollection = 0;
 
112
                                };
 
113
                                WindowType(const QString& newTitle) {
 
114
                                        title = newTitle;
 
115
 
 
116
                                        keyChooser = 0;
 
117
                                        actionCollection = 0;
 
118
                                }
 
119
                        };
 
120
 
 
121
                        WindowType application;
 
122
                        WindowType general;
 
123
                        WindowType bible;
 
124
                        WindowType commentary;
 
125
                        WindowType lexicon;
 
126
                        WindowType book;
 
127
                }
 
128
                keys;
 
129
 
 
130
                struct DisplayStyleSettings {
 
131
                        QComboBox* styleChooser;
 
132
                        KHTMLPart* stylePreview;
 
133
                }
 
134
                displayStyle;
 
135
 
 
136
                struct FontSettings {
 
137
                        QComboBox* swordLocaleCombo;
 
138
                        KFontChooser* fontChooser;
 
139
                        QComboBox* usage;
 
140
                        QCheckBox* useOwnFontBox;
 
141
                        //the pair os to check whether the standard font (bool == false) or whether an own font should be used (true)
 
142
                        QMap<QString,CBTConfig::FontSettingsPair> fontMap;
 
143
                }
 
144
                fonts;
 
145
        }
 
146
        m_settings;
 
147
 
 
148
protected slots: // Protected slots
 
149
        /**
 
150
        * Called when a new font in the fonts page was selected.
 
151
        */
 
152
        void newDisplayWindowFontSelected(const QFont &);
 
153
        /**
 
154
        * Called when the combobox contents is changed
 
155
        */
 
156
        void newDisplayWindowFontAreaSelected(const QString&);
 
157
        /**
 
158
        * Called if the OK button was clicked
 
159
        */
 
160
        void slotOk();
 
161
        /**
 
162
        * Called if the Apply button was clicked
 
163
        * commented out for the time being.  ck
 
164
        */
 
165
        void slotApply();
 
166
        /**
 
167
        * This slot is called when the "Use own font for language" bo was clicked.
 
168
        */
 
169
        void useOwnFontClicked(bool);
 
170
        /**
 
171
        * Update the style preview widget
 
172
        */
 
173
        void updateStylePreview();
 
174
        /**
 
175
        * The type of the keyaccel area changed
 
176
        */
 
177
        void slotKeyChooserTypeChanged(const QString&);
 
178
 
 
179
protected: // Protected methods
 
180
        /**
 
181
        * Initializes the startup section of the OD.
 
182
        */
 
183
        void initDisplay();
 
184
        /**
 
185
        * Init Sword section.
 
186
        */
 
187
        void initSword();
 
188
        /**
 
189
        * Init accel key section.
 
190
        */
 
191
        void initAccelerators();
 
192
        /**
 
193
        * Init fonts section.
 
194
        */
 
195
        void initLanguages();
 
196
 
 
197
        /** Save the display settings.
 
198
        */
 
199
        void saveDisplay();
 
200
        /** Save the key accel settings.
 
201
        */
 
202
        void saveAccelerators();
 
203
        /** Save the font settings.
 
204
        */
 
205
        void saveLanguages();
 
206
        /** Save the Sword specific settings.
 
207
        */
 
208
        void saveSword();
 
209
 
 
210
signals: // Signals
 
211
        void signalSettingsChanged();
 
212
};
 
213
 
 
214
#endif