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 void feedbackPost(FL_OBJECT *, int);
60 /// Update the dialog.
61 virtual void update();
68 /// Restore from dialog
69 virtual void restore();
70 /// Filter the inputs -- return true if entries are valid
71 virtual bool input(FL_OBJECT *, long);
74 /// control which feedback message is output
75 void feedback( FL_OBJECT * );
77 virtual FL_FORM * form() const;
79 void applyColours() const;
81 void applyInputsMisc() const;
83 void applyInterface() const;
85 void applyLanguage() const;
87 void applyLnFmisc() const;
89 void applyOutputsMisc() const;
91 void applyPaths(); // not const because calls updatePaths!
93 void applyPrinter() const;
95 void applyScreenFonts() const;
97 void applySpellChecker(); // not const because calls updateSpellChecker!
101 void buildInputsMisc();
103 void buildInterface();
105 void buildLanguage();
107 void addLanguages( Combox & ) const;
111 void buildOutputsMisc();
117 void buildScreenFonts();
119 void buildSpellchecker();
121 string feedbackColours(FL_OBJECT const * const) const;
123 string feedbackInputsMisc(FL_OBJECT const * const) const;
125 string feedbackInterface(FL_OBJECT const * const) const;
127 string feedbackLanguage(FL_OBJECT const * const) const;
129 string feedbackLnFmisc(FL_OBJECT const * const) const;
131 string feedbackOutputsMisc(FL_OBJECT const * const) const;
133 string feedbackPaths(FL_OBJECT const * const) const;
135 string feedbackPrinter(FL_OBJECT const * const) const;
137 string feedbackScreenFonts(FL_OBJECT const * const) const;
139 string feedbackSpellChecker(FL_OBJECT const * const) const;
141 bool inputLanguage(FL_OBJECT const * const);
143 bool inputPaths(FL_OBJECT const * const);
145 bool inputScreenFonts();
147 bool inputSpellChecker(FL_OBJECT const * const);
149 void updateColours();
151 void updateInputsMisc();
153 void updateInterface();
155 void updateLanguage();
157 void updateLnFmisc();
159 void updateOutputsMisc();
163 void updatePrinter();
165 void updateScreenFonts();
167 void updateSpellChecker();
170 bool WriteableDir( string const & ) const;
172 bool ReadableDir( string const & ) const;
174 bool WriteableFile( string const &, string const & = string() ) const;
176 void setPostHandler( FL_OBJECT * ) const;
179 FD_form_preferences * build_preferences();
181 FD_form_outer_tab * build_outer_tab();
183 FD_form_colours * build_colours();
185 FD_form_inputs_misc * build_inputs_misc();
187 FD_form_interface * build_interface();
189 FD_form_language * build_language();
191 FD_form_lnf_misc * build_lnf_misc();
193 FD_form_outputs_misc * build_outputs_misc();
195 FD_form_paths * build_paths();
197 FD_form_printer * build_printer();
199 FD_form_screen_fonts * build_screen_fonts();
201 FD_form_spellchecker * build_spellchecker();
203 /// Real GUI implementation.
204 FD_form_preferences * dialog_;
205 /// Outputs tabfolder
206 FD_form_outer_tab * outputs_tab_;
207 /// HCI configuration
208 FD_form_outer_tab * look_n_feel_tab_;
209 /// reLyX and other import/input stuff
210 FD_form_outer_tab * inputs_tab_;
211 /// Spellchecker, language stuff, etc
212 FD_form_outer_tab * usage_tab_;
214 FD_form_colours * colours_;
216 FD_form_inputs_misc * inputs_misc_;
218 FD_form_interface * interface_;
220 FD_form_language * language_;
222 FD_form_lnf_misc * lnf_misc_;
224 FD_form_outputs_misc * outputs_misc_;
226 FD_form_paths * paths_;
228 FD_form_printer * printer_;
230 FD_form_screen_fonts * screen_fonts_;
232 FD_form_spellchecker * spellchecker_;
234 Combox * combo_default_lang;
236 Combox * combo_kbmap_1;
238 Combox * combo_kbmap_2;
240 FL_OBJECT * feedbackObj;