kword

KWConfig.h
1/* This file is part of the KDE project
2 Copyright (C) 2001 Montel Laurent <lmontel@mandrakesoft.com>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef __kwconfig__
21#define __kwconfig__
22
23#include <kdialogbase.h>
24
25namespace KFormula {
26 class ConfigurePage;
27}
28
29class KWView;
30class TQCheckBox;
31class KIntNumInput;
32class KoUnitDoubleSpinBox;
33class TDEConfig;
34class TQComboBox;
35class KIntNumInput;
36class KCommand;
37class KWDocument;
38class TDEListView;
39class TQVGroupBox;
40class TQLabel;
41
42namespace KSpell2 {
43 class ConfigWidget;
44}
45
46class ConfigureSpellPage : public TQObject
47{
48 TQ_OBJECT
49
50public:
51 ConfigureSpellPage( KWView *view, TQVBox *box, char *name = 0 );
52 void apply();
53 void slotDefault();
54private:
55 KWView* m_pView;
56 TDEConfig* config;
57 KSpell2::ConfigWidget *m_spellConfigWidget;
58};
59
60class ConfigureInterfacePage : public TQObject
61{
62 TQ_OBJECT
63
64public:
65 ConfigureInterfacePage( KWView *view, TQVBox *box, char *name = 0 );
66 void apply();
67 void slotDefault();
68 void setUnit( KoUnit::Unit unit );
69
70signals:
71 // For KWConfig
72 void unitChanged( int );
73private:
74 KWView* m_pView;
75 TDEConfig* config;
76 TQComboBox *m_unitCombo;
77 KoUnitDoubleSpinBox* gridX,*gridY;
78 KoUnitDoubleSpinBox* indent;
79 KIntNumInput* recentFiles;
80 TQCheckBox *showStatusBar, *showScrollBar, *pgUpDownMovesCaret;
81 int oldNbRecentFiles;
82 KIntNumInput *m_nbPagePerRow;
83};
84
85class ConfigureMiscPage : public TQObject
86{
87 TQ_OBJECT
88
89public:
90 ConfigureMiscPage( KWView *view, TQVBox *box, char *name = 0 );
91 KCommand* apply();
92 void slotDefault();
93 void setUnit( KoUnit::Unit unit );
94private:
95 KWView* m_pView;
96 TDEConfig* config;
97 KIntNumInput* m_undoRedoLimit;
98 int m_oldNbRedo;
99 bool m_oldFormattingEndParag, m_oldFormattingSpace, m_oldFormattingTabs, m_oldFormattingBreak;
100 TQCheckBox* m_displayLink, *m_displayComment, *m_underlineLink, *m_displayFieldCode;
101 TQCheckBox* m_cbViewFormattingEndParag, *m_cbViewFormattingSpace;
102 TQCheckBox* m_cbViewFormattingTabs, *m_cbViewFormattingBreak;
103};
104
105class ConfigureDefaultDocPage : public TQObject
106{
107 TQ_OBJECT
108
109public:
110 ConfigureDefaultDocPage( KWView *view, TQVBox *box, char *name = 0 );
111 ~ConfigureDefaultDocPage();
112 KCommand* apply();
113 void slotDefault();
114 void setUnit( KoUnit::Unit unit );
115public slots:
116 void selectNewDefaultFont();
117private:
118 KWView* m_pView;
119 TDEConfig* config;
120 TQFont *font;
121 TQLabel *fontName;
122 TQLabel *tabStop;
123
124 KoUnitDoubleSpinBox* m_columnSpacing;
125
126 KIntNumInput* autoSave;
127 int oldAutoSaveValue;
128 double m_oldTabStopWidth;
129
130 int m_oldStartingPage;
131 bool m_oldBackupFile;
132 KIntNumInput* m_variableNumberOffset;
133 KoUnitDoubleSpinBox *m_tabStopWidth;
134 TQCheckBox *m_cursorInProtectedArea;
135 TQCheckBox *m_createBackupFile;
136// TQCheckBox *m_directInsertCursor;
137 TQCheckBox *m_autoHyphenation;
138 TQComboBox *m_globalLanguage;
139 TQString m_oldLanguage;
140 bool m_oldHyphenation;
141};
142
143class ConfigurePathPage : public TQObject
144{
145 TQ_OBJECT
146
147public:
148 ConfigurePathPage( KWView *view, TQVBox *box, char *name = 0 );
149 void slotDefault();
150 void apply();
151private slots:
152 void slotModifyPath();
153 void slotSelectionChanged(TQListViewItem *);
154private:
155 KWView* m_pView;
156 TDEConfig* config;
157 TDEListView* m_pPathView;
158 TQPushButton *m_modifyPath;
159};
160
161class ConfigureTTSPage : public TQObject
162{
163 TQ_OBJECT
164
165public:
166 ConfigureTTSPage( KWView *view, TQVBox *box, char *name = 0 );
167 void slotDefault();
168 void apply();
169private slots:
170 void screenReaderOptionChanged();
171private:
172 TDEConfig* config;
173 TQCheckBox* m_cbSpeakPointerWidget;
174 TQCheckBox* m_cbSpeakFocusWidget;
175 TQVGroupBox* m_gbScreenReaderOptions;
176 TQCheckBox* m_cbSpeakTooltips;
177 TQCheckBox* m_cbSpeakWhatsThis;
178 TQCheckBox* m_cbSpeakDisabled;
179 TQCheckBox* m_cbSpeakAccelerators;
180 TQLabel* m_lblAcceleratorPrefix;
181 TQLineEdit* m_leAcceleratorPrefixWord;
182 KIntNumInput* m_iniPollingInterval;
183};
184
185class KWConfig : public KDialogBase
186{
187 TQ_OBJECT
188
189public:
190 enum { KW_TDESPELL=1,KP_INTERFACE=2,KP_MISC=4, KP_DOCUMENT=8, KP_FORMULA=16, KP_PATH = 32};
191 KWConfig( KWView* parent );
192 void openPage(int flags);
193public slots:
194 void slotApply();
195 void slotDefault();
196 void unitChanged( int );
197private:
198 ConfigureSpellPage *m_spellPage;
199 ConfigureInterfacePage *m_interfacePage;
200 ConfigureMiscPage *m_miscPage;
201 ConfigureDefaultDocPage *m_defaultDocPage;
202 KFormula::ConfigurePage *m_formulaPage;
203 ConfigurePathPage *m_pathPage;
204 ConfigureTTSPage *m_ttsPage;
205 KWDocument *m_doc;
206};
207
208
209
210#endif