]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormPreferences.h
21fbb199767f805d6daa75b301ae8ca814008c32
[lyx.git] / src / frontends / xforms / FormPreferences.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ======================================================
4  * 
5  *           LyX, The Document Processor
6  *       
7  *          Copyright 1995 Matthias Ettrich
8  *          Copyright 1995-2000 The LyX Team.
9  *
10  *          This file copyright 1999-2000
11  *          Allan Rae
12  *======================================================*/
13 /* FormPreferences.h
14  * FormPreferences Interface Class
15  */
16
17 #ifndef FORMPREFERENCES_H
18 #define FORMPREFERENCES_H
19
20 #include "FormBase.h"
21
22 #ifdef __GNUG_
23 #pragma interface
24 #endif
25
26 class LyXView;
27 class Dialogs;
28
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;
34 struct FD_form_paths;
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;
41 class  Combox;
42
43 /** This class provides an XForms implementation of the FormPreferences Dialog.
44     The preferences dialog allows users to set/save their preferences.
45  */
46 class FormPreferences : public FormBaseBI {
47 public:
48         /// #FormPreferences x(LyXFunc ..., Dialogs ...);#
49         FormPreferences(LyXView *, Dialogs *);
50         ///
51         ~FormPreferences();
52         ///
53         static void ComboLanguageCB(int, void *, Combox *);
54         ///
55         static void FeedbackCB(FL_OBJECT *, long);
56         ///
57         void feedbackPost(FL_OBJECT *, int);
58
59 private:
60         /// Update the dialog.
61         virtual void update();
62         ///
63         virtual void hide();
64         /// OK from dialog
65         virtual void ok();
66         /// Apply from dialog
67         virtual void apply();
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);
72         /// Build the dialog
73         virtual void build();
74         /// control which feedback message is output
75         void feedback( FL_OBJECT * );
76         ///
77         virtual FL_FORM * form() const;
78         ///
79         void applyColours() const;
80         ///
81         void applyInputsMisc() const;
82         ///
83         void applyInterface() const;
84         ///
85         void applyLanguage() const;
86         ///
87         void applyLnFmisc() const;
88         ///
89         void applyOutputsMisc() const;
90         ///
91         void applyPaths(); // not const because calls updatePaths!
92         ///
93         void applyPrinter() const;
94         ///
95         void applyScreenFonts() const;
96         ///
97         void applySpellChecker(); // not const because calls updateSpellChecker!
98         ///
99         void buildColours();
100         ///
101         void buildInputsMisc();
102         ///
103         void buildInterface();
104         ///
105         void buildLanguage();
106         ///
107         void addLanguages( Combox & ) const;
108         ///
109         void buildLnFmisc();
110         ///
111         void buildOutputsMisc();
112         ///
113         void buildPaths();
114         ///
115         void buildPrinter();
116         ///
117         void buildScreenFonts();
118         ///
119         void buildSpellchecker();
120         ///
121         string feedbackColours(FL_OBJECT const * const) const;
122         ///
123         string feedbackInputsMisc(FL_OBJECT const * const) const;
124         ///
125         string feedbackInterface(FL_OBJECT const * const) const;
126         ///
127         string feedbackLanguage(FL_OBJECT const * const) const;
128         ///
129         string feedbackLnFmisc(FL_OBJECT const * const) const;
130         ///
131         string feedbackOutputsMisc(FL_OBJECT const * const) const;
132         ///
133         string feedbackPaths(FL_OBJECT const * const) const;
134         ///
135         string feedbackPrinter(FL_OBJECT const * const) const;
136         ///
137         string feedbackScreenFonts(FL_OBJECT const * const) const;
138         ///
139         string feedbackSpellChecker(FL_OBJECT const * const) const;
140         ///
141         bool inputLanguage(FL_OBJECT const * const);
142         ///
143         bool inputPaths(FL_OBJECT const * const);
144         ///
145         bool inputScreenFonts();
146         ///
147         bool inputSpellChecker(FL_OBJECT const * const);
148         ///
149         void updateColours();
150         ///
151         void updateInputsMisc();
152         ///
153         void updateInterface();
154         ///
155         void updateLanguage();
156         ///
157         void updateLnFmisc();
158         ///
159         void updateOutputsMisc();
160         ///
161         void updatePaths();
162         ///
163         void updatePrinter();
164         ///
165         void updateScreenFonts();
166         ///
167         void updateSpellChecker();
168
169         ///
170         bool WriteableDir( string const & ) const;
171         ///
172         bool ReadableDir( string const & ) const;
173         ///
174         bool WriteableFile( string const &, string const & = string() ) const;
175         ///
176         void setPostHandler( FL_OBJECT * ) const;
177
178         ///
179         FD_form_preferences * build_preferences();
180         ///
181         FD_form_outer_tab * build_outer_tab();
182         ///
183         FD_form_colours * build_colours();
184         ///
185         FD_form_inputs_misc * build_inputs_misc();
186         ///
187         FD_form_interface * build_interface();
188         ///
189         FD_form_language * build_language();
190         ///
191         FD_form_lnf_misc * build_lnf_misc();
192         ///
193         FD_form_outputs_misc * build_outputs_misc();
194         ///
195         FD_form_paths * build_paths();
196         ///
197         FD_form_printer * build_printer();
198         ///
199         FD_form_screen_fonts * build_screen_fonts();
200         ///
201         FD_form_spellchecker * build_spellchecker();
202
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_;
213         ///
214         FD_form_colours * colours_;
215         ///
216         FD_form_inputs_misc * inputs_misc_;
217         ///
218         FD_form_interface * interface_;
219         ///
220         FD_form_language * language_;
221         ///
222         FD_form_lnf_misc * lnf_misc_;
223         ///
224         FD_form_outputs_misc * outputs_misc_;
225         ///
226         FD_form_paths * paths_;
227         ///
228         FD_form_printer * printer_;
229         ///
230         FD_form_screen_fonts * screen_fonts_;
231         ///
232         FD_form_spellchecker * spellchecker_;
233         ///
234         Combox * combo_default_lang;
235         ///
236         Combox * combo_kbmap_1;
237         ///
238         Combox * combo_kbmap_2;
239         ///
240         FL_OBJECT * feedbackObj;
241 };
242
243 #endif