summaryrefslogtreecommitdiffstats
path: root/kspread/dialogs/kspread_dlg_preference.h
blob: bdd2af09688bd12308405957cc4ee8cc1c11d913 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
/* This file is part of the KDE project
   Copyright (C) 2002-2004 Ariya Hidayat <ariya@kde.org>
             (C) 2002-2003 Norbert Andres <nandres@web.de>
             (C) 2000-2003 Laurent Montel <montel@kde.org>
             (C) 2002 John Dailey <dailey@vt.edu>
             (C) 2002 Philipp Mueller <philipp.mueller@gmx.de>
             (C) 2001-2002 David Faure <faure@kde.org>
             (C) 2001 Werner Trobin <trobin@kde.org>
             (C) 2000 Bernd Johannes Wuebben <wuebben@kde.org>

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public License
   along with this library; see the file COPYING.LIB.  If not, write to
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
*/

#ifndef __kspread_dlg_preference__
#define __kspread_dlg_preference__

#include <kdialogbase.h>

class TDEConfig;
class KIntNumInput;
class KDoubleNumInput;
class KSpellConfig;
class TQCheckBox;
class TQComboBox;
class TQVGroupBox;
class TQPushButton;
class KColorButton;

namespace KSpread
{
class Sheet;
class View;

class parameterLocale :  public TQObject
{
 Q_OBJECT
  
public:
   parameterLocale( View* _view,TQVBox *box, char *name = 0);
 void apply();
public slots:
   void updateDefaultSystemConfig();
 protected:
   /**
    * Updates the GUI widgets to match the specified locale.  
    */
   void updateToMatchLocale(KLocale* locale);

   TQLabel *m_shortDate,*m_time,*m_money,*m_date,*m_language,*m_number;
   TQPushButton *m_updateButton;
   View* m_pView;
   bool m_bUpdateLocale;
};

class configure : public TQObject
{
  Q_OBJECT
  
public:
  configure( View* _view,TQVBox *box, char *name = 0 );
  void apply();
  void slotDefault();
protected:
  View* m_pView;
  KIntNumInput  *nbPage;
  KIntNumInput* nbRecentFile;
  KIntNumInput* autoSaveDelay;
  TQCheckBox *showVScrollBar;
  TQCheckBox *showHScrollBar;
  TQCheckBox *showColHeader;
  TQCheckBox *showRowHeader;
  TQCheckBox *showTabBar;
  TQCheckBox *showFormulaBar;
    TQCheckBox *showStatusBar;
    TQCheckBox *m_createBackupFile;
  bool m_oldBackupFile;

  TDEConfig* config;
  int oldRecent;
  int oldAutoSaveValue;
} ;


class miscParameters : public TQObject
{
  Q_OBJECT
  
public:
  miscParameters( View* _view, TQVBox *box, char *name = 0 );
  void apply();
  void slotDefault();

  void initComboBox();

public slots:
  void slotTextComboChanged(const TQString &);

protected:
  View* m_pView;
  KDoubleNumInput  *valIndent;
  
  /**
   * Needed to ensure the same unit for loading and saving.
   */
  KoUnit::Unit indentUnit;
  TDEConfig* config;
  TQComboBox *typeCompletion;
  TQComboBox *typeCalc;
  TQComboBox *typeOfMove;
  TQCheckBox *msgError;
  KIntNumInput* m_undoRedoLimit;
  bool comboChanged;
  int m_oldNbRedo;
} ;

class colorParameters : public TQObject
{
  Q_OBJECT
  
public:
  colorParameters( View* _view, TQVBox *box, char *name = 0 );
  void apply();
  void slotDefault();
protected:
  View* m_pView;
  KColorButton* gridColor;
  KColorButton* pageBorderColor;
  TDEConfig* config;
} ;

class configureLayoutPage : public TQObject
{
  Q_OBJECT
  
public:
  configureLayoutPage( View* _view,TQVBox *box, char *name = 0 );
  void apply();
  void slotDefault();
  void initCombo();
protected:
  View* m_pView;
  TQComboBox *defaultOrientationPage;
  TQComboBox *defaultSizePage;
  TQComboBox *defaultUnit;
  //store old config
  int paper;
  int orientation;
  int unit;

  TDEConfig* config;
} ;

class configureSpellPage : public TQObject
{
  Q_OBJECT
  
public:
  configureSpellPage( View* _view, TQVBox *box, char *name = 0 );
  void apply();
  void slotDefault();
protected:
  View * m_pView;
  TDEConfig * config;
    KSpellConfig *m_spellConfigWidget;
    TQCheckBox *dontCheckUpperWord;
    TQCheckBox *dontCheckTitleCase;
} ;

class configureTTSPage : public TQObject
{
  Q_OBJECT
  
public:
  configureTTSPage( View *_view, TQVBox *box, char *name = 0 );
  void slotDefault();
  void apply();
private slots:
  void screenReaderOptionChanged();
private:
  TDEConfig* config;
  TQCheckBox* m_cbSpeakPointerWidget;
  TQCheckBox* m_cbSpeakFocusWidget;
  TQVGroupBox* m_gbScreenReaderOptions;
  TQCheckBox* m_cbSpeakTooltips;
  TQCheckBox* m_cbSpeakWhatsThis;
  TQCheckBox* m_cbSpeakDisabled;
  TQCheckBox* m_cbSpeakAccelerators;
  TQLabel* m_lblAcceleratorPrefix;
  TQLineEdit* m_leAcceleratorPrefixWord;
  KIntNumInput* m_iniPollingInterval;
};

class PreferenceDialog : public KDialogBase
{
  Q_OBJECT
  
public:
  enum { KS_PREFERENCES = 1, KS_LOCALE = 2, KS_INTERFACE = 4,
         KS_MISC = 8, KS_COLOR = 16, KS_LAYOUT = 32, KS_SPELLING = 64 };
  PreferenceDialog( View* parent, const char* name);
public slots:
  void slotApply();
  void slotDefault();
  void openPage(int flags);
private :
  View* m_pView;
  configure * _configure;
  miscParameters *_miscParameter;
  colorParameters *_colorParameter;
  configureLayoutPage *_layoutPage;
  configureSpellPage *_spellPage;
  parameterLocale *_localePage;
  configureTTSPage *_ttsPage;
};

} // namespace KSpread

#endif