2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2000 The LyX Team.
10 * This file copyright 1999-2000
12 *======================================================*/
14 * FormPreferences Interface Class
17 #ifndef FORMPREFERENCES_H
18 #define FORMPREFERENCES_H
29 struct FD_form_preferences;
30 struct FD_form_lnf_misc;
31 struct FD_form_screen_fonts;
32 struct FD_form_interface;
33 struct FD_form_printer;
35 struct FD_form_outer_tab;
36 struct FD_form_inputs_misc;
37 struct FD_form_outputs_misc;
38 struct FD_form_spellchecker;
39 struct FD_form_language;
40 struct FD_form_colours;
43 /** This class provides an XForms implementation of the FormPreferences Dialog.
44 The preferences dialog allows users to set/save their preferences.
46 class FormPreferences : public FormBaseBI {
48 /// #FormPreferences x(LyXFunc ..., Dialogs ...);#
49 FormPreferences(LyXView *, Dialogs *);
53 static void ComboLanguageCB(int, void *, Combox *);
55 static void FeedbackCB(FL_OBJECT *, long);
57 static int FeedbackPost(FL_OBJECT *ob, int, FL_Coord, FL_Coord,
85 /// Update the dialog.
86 virtual void update();
93 /// Restore from dialog
94 virtual void restore();
95 /// Filter the inputs -- return true if entries are valid
96 virtual bool input(FL_OBJECT *, long);
99 /// control which feedback message is output
100 void feedback( FL_OBJECT * ob );
102 virtual FL_FORM * form() const;
106 void applyInputsMisc();
108 void applyInterface();
110 void applyLanguage();
114 void applyOutputsMisc();
120 void applyScreenFonts();
122 void applySpellChecker();
126 void buildInputsMisc();
128 void buildInterface();
130 void buildLanguage();
132 void addLanguages( Combox & );
136 void buildOutputsMisc();
142 void buildScreenFonts();
144 void buildSpellchecker();
146 void feedbackColours(FL_OBJECT const * const);
148 void feedbackInputsMisc(FL_OBJECT const * const);
150 void feedbackInterface(FL_OBJECT const * const);
152 void feedbackLanguage(FL_OBJECT const * const);
154 void feedbackLnFmisc(FL_OBJECT const * const);
156 void feedbackOutputsMisc(FL_OBJECT const * const);
158 void feedbackPaths(FL_OBJECT const * const);
160 void feedbackPrinter(FL_OBJECT const * const);
162 void feedbackScreenFonts(FL_OBJECT const * const);
164 void feedbackSpellChecker(FL_OBJECT const * const);
166 bool inputLanguage(FL_OBJECT const * const);
168 bool inputPaths(FL_OBJECT const * const);
170 bool inputScreenFonts();
172 bool inputSpellChecker(FL_OBJECT const * const);
174 void updateColours();
176 void updateInputsMisc();
178 void updateInterface();
180 void updateLanguage();
182 void updateLnFmisc();
184 void updateOutputsMisc();
188 void updatePrinter();
190 void updateScreenFonts();
192 void updateSpellChecker();
195 bool WriteableDir( string const & ) const;
197 bool ReadableDir( string const & ) const;
199 bool WriteableFile( string const &, string const & = string() ) const;
201 void setPostHandler( FL_OBJECT * ) const;
204 FD_form_preferences * build_preferences();
206 FD_form_outer_tab * build_outer_tab();
208 FD_form_colours * build_colours();
210 FD_form_inputs_misc * build_inputs_misc();
212 FD_form_interface * build_interface();
214 FD_form_language * build_language();
216 FD_form_lnf_misc * build_lnf_misc();
218 FD_form_outputs_misc * build_outputs_misc();
220 FD_form_paths * build_paths();
222 FD_form_printer * build_printer();
224 FD_form_screen_fonts * build_screen_fonts();
226 FD_form_spellchecker * build_spellchecker();
228 /// Real GUI implementation.
229 FD_form_preferences * dialog_;
230 /// Outputs tabfolder
231 FD_form_outer_tab * outputs_tab_;
232 /// HCI configuration
233 FD_form_outer_tab * look_n_feel_tab_;
234 /// reLyX and other import/input stuff
235 FD_form_outer_tab * inputs_tab_;
236 /// Spellchecker, language stuff, etc
237 FD_form_outer_tab * usage_tab_;
239 FD_form_colours * colours_;
241 FD_form_inputs_misc * inputs_misc_;
243 FD_form_interface * interface_;
245 FD_form_language * language_;
247 FD_form_lnf_misc * lnf_misc_;
249 FD_form_outputs_misc * outputs_misc_;
251 FD_form_paths * paths_;
253 FD_form_printer * printer_;
255 FD_form_screen_fonts * screen_fonts_;
257 FD_form_spellchecker * spellchecker_;
259 Combox * combo_default_lang;
261 Combox * combo_kbmap_1;
263 Combox * combo_kbmap_2;