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
28 struct FD_form_colours;
29 struct FD_form_formats;
30 struct FD_form_inputs_misc;
31 struct FD_form_interface;
32 struct FD_form_language;
33 struct FD_form_lnf_misc;
34 struct FD_form_outer_tab;
35 struct FD_form_outputs_misc;
37 struct FD_form_preferences;
38 struct FD_form_printer;
39 struct FD_form_screen_fonts;
40 struct FD_form_spellchecker;
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 /// Filter the inputs -- return true if entries are valid
69 virtual bool input(FL_OBJECT *, long);
72 /// control which feedback message is output
73 void feedback( FL_OBJECT * );
75 virtual FL_FORM * form() const;
77 void applyColours() const;
79 void applyFormats() 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 bool loadColourBrowser( string const & );
103 int searchColourEntry(std::vector<int> const & ) const;
107 void buildInputsMisc();
109 void buildInterface();
111 void buildLanguage();
113 void addLanguages( Combox & ) const;
117 void buildOutputsMisc();
123 void buildScreenFonts();
125 void buildSpellchecker();
127 string feedbackColours(FL_OBJECT const * const) const;
129 string feedbackFormats( FL_OBJECT const * const ) const;
131 string feedbackInputsMisc(FL_OBJECT const * const) const;
133 string feedbackInterface(FL_OBJECT const * const) const;
135 string feedbackLanguage(FL_OBJECT const * const) const;
137 string feedbackLnFmisc(FL_OBJECT const * const) const;
139 string feedbackOutputsMisc(FL_OBJECT const * const) const;
141 string feedbackPaths(FL_OBJECT const * const) const;
143 string feedbackPrinter(FL_OBJECT const * const) const;
145 string feedbackScreenFonts(FL_OBJECT const * const) const;
147 string feedbackSpellChecker(FL_OBJECT const * const) const;
149 bool inputColours(FL_OBJECT const * const);
151 bool inputFormats( FL_OBJECT const * const );
153 bool inputLanguage(FL_OBJECT const * const);
155 bool inputPaths(FL_OBJECT const * const);
157 bool inputScreenFonts();
159 bool inputSpellChecker(FL_OBJECT const * const);
161 void updateColours();
163 void updateColoursBrowser( int );
165 void updateColoursRGB();
167 void updateFormats();
169 void updateInputsMisc();
171 void updateInterface();
173 void updateLanguage();
175 void updateLnFmisc();
177 void updateOutputsMisc();
181 void updatePrinter();
183 void updateScreenFonts();
185 void updateSpellChecker();
188 bool WriteableDir( string const & ) const;
190 bool ReadableDir( string const & ) const;
192 bool WriteableFile( string const &, string const & = string() ) const;
194 void setPostHandler( FL_OBJECT * ) const;
197 FD_form_preferences * build_preferences();
199 FD_form_outer_tab * build_outer_tab();
201 FD_form_colours * build_colours();
203 FD_form_formats * build_formats();
205 FD_form_inputs_misc * build_inputs_misc();
207 FD_form_interface * build_interface();
209 FD_form_language * build_language();
211 FD_form_lnf_misc * build_lnf_misc();
213 FD_form_outputs_misc * build_outputs_misc();
215 FD_form_paths * build_paths();
217 FD_form_printer * build_printer();
219 FD_form_screen_fonts * build_screen_fonts();
221 FD_form_spellchecker * build_spellchecker();
223 /// Real GUI implementation.
224 FD_form_preferences * dialog_;
225 /// Outputs tabfolder
226 FD_form_outer_tab * outputs_tab_;
227 /// HCI configuration
228 FD_form_outer_tab * look_n_feel_tab_;
229 /// reLyX and other import/input stuff
230 FD_form_outer_tab * inputs_tab_;
231 /// Spellchecker, language stuff, etc
232 FD_form_outer_tab * usage_tab_;
234 FD_form_colours * colours_;
236 FD_form_formats * formats_;
238 FD_form_inputs_misc * inputs_misc_;
240 FD_form_interface * interface_;
242 FD_form_language * language_;
244 FD_form_lnf_misc * lnf_misc_;
246 FD_form_outputs_misc * outputs_misc_;
248 FD_form_paths * paths_;
250 FD_form_printer * printer_;
252 FD_form_screen_fonts * screen_fonts_;
254 FD_form_spellchecker * spellchecker_;
256 Combox * combo_default_lang;
258 Combox * combo_kbmap_1;
260 Combox * combo_kbmap_2;
262 FL_OBJECT * feedbackObj;