]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormPreferences.h
0dbc60d0487a1a77d28d19c8f98ba156f7cf78ce
[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
42 /** This class provides an XForms implementation of the FormPreferences Dialog.
43     The preferences dialog allows users to set/save their preferences.
44  */
45 class FormPreferences : public FormBaseBI {
46 public:
47         /// #FormPreferences x(LyXFunc ..., Dialogs ...);#
48         FormPreferences(LyXView *, Dialogs *);
49         ///
50         ~FormPreferences();
51 private:
52         ///
53         enum State {
54                 ///
55                 COLOURS,
56                 ///
57                 INPUTSMISC,
58                 ///
59                 INTERFACE,
60                 ///
61                 LANGUAGE,
62                 ///
63                 LOOKNFEELMISC,
64                 ///
65                 OUTPUTSMISC,
66                 ///
67                 PATHS,
68                 ///
69                 PRINTER,
70                 ///
71                 SCREENFONTS,
72                 ///
73                 SPELLCHECKER,
74                 ///
75                 TABS
76         };
77         /// Update the dialog.
78         virtual void update();
79         ///
80         virtual void hide();
81         /// OK from dialog
82         virtual void ok();
83         /// Apply from dialog
84         virtual void apply();
85         /// Restore from dialog
86         virtual void restore();
87         /// Filter the inputs -- return true if entries are valid
88         virtual bool input(FL_OBJECT *, long);
89         /// Build the dialog
90         virtual void build();
91         ///
92         virtual FL_FORM * form() const;
93         ///
94         void applyColours();
95         ///
96         void applyInputsMisc();
97         ///
98         void applyInterface();
99         ///
100         void applyLanguage();
101         ///
102         void applyLnFmisc();
103         ///
104         void applyOutputsMisc();
105         ///
106         void applyPaths();
107         ///
108         void applyPrinter();
109         ///
110         void applyScreenFonts();
111         ///
112         void applySpellChecker();
113         ///
114         void buildColours();
115         ///
116         void buildInputsMisc();
117         ///
118         void buildInterface();
119         ///
120         void buildLanguage();
121         ///
122         void buildLnFmisc();
123         ///
124         void buildOutputsMisc();
125         ///
126         void buildPaths();
127         ///
128         void buildPrinter();
129         ///
130         void buildScreenFonts();
131         ///
132         void buildSpellchecker();
133         ///
134         void feedbackColours(FL_OBJECT const * const);
135         ///
136         void feedbackInputsMisc(FL_OBJECT const * const);
137         ///
138         void feedbackInterface(FL_OBJECT const * const);
139         ///
140         void feedbackLanguage(FL_OBJECT const * const);
141         ///
142         void feedbackLnFmisc(FL_OBJECT const * const);
143         ///
144         void feedbackOutputsMisc(FL_OBJECT const * const);
145         ///
146         void feedbackPaths(FL_OBJECT const * const);
147         ///
148         void feedbackPrinter(FL_OBJECT const * const);
149         ///
150         void feedbackScreenFonts(FL_OBJECT const * const);
151         ///
152         void feedbackSpellChecker(FL_OBJECT const * const);
153         ///
154         bool inputLanguage(FL_OBJECT const * const);
155         ///
156         bool inputPaths(FL_OBJECT const * const);
157         ///
158         bool inputScreenFonts();
159         ///
160         bool inputSpellChecker(FL_OBJECT const * const);
161         ///
162         void updateColours();
163         ///
164         void updateInputsMisc();
165         ///
166         void updateInterface();
167         ///
168         void updateLanguage();
169         ///
170         void updateLnFmisc();
171         ///
172         void updateOutputsMisc();
173         ///
174         void updatePaths();
175         ///
176         void updatePrinter();
177         ///
178         void updateScreenFonts();
179         ///
180         void updateSpellChecker();
181
182         ///
183         bool WriteableDir( string const & ) const;
184         ///
185         bool ReadableDir( string const & ) const;
186         ///
187         bool WriteableFile( string const &, string const & = string() ) const;
188
189         ///
190         FD_form_preferences * build_preferences();
191         ///
192         FD_form_outer_tab * build_outer_tab();
193         ///
194         FD_form_colours * build_colours();
195         ///
196         FD_form_inputs_misc * build_inputs_misc();
197         ///
198         FD_form_interface * build_interface();
199         ///
200         FD_form_language * build_language();
201         ///
202         FD_form_lnf_misc * build_lnf_misc();
203         ///
204         FD_form_outputs_misc * build_outputs_misc();
205         ///
206         FD_form_paths * build_paths();
207         ///
208         FD_form_printer * build_printer();
209         ///
210         FD_form_screen_fonts * build_screen_fonts();
211         ///
212         FD_form_spellchecker * build_spellchecker();
213
214         /// Real GUI implementation.
215         FD_form_preferences * dialog_;
216         /// Outputs tabfolder
217         FD_form_outer_tab * outputs_tab_;
218         /// HCI configuration
219         FD_form_outer_tab * look_n_feel_tab_;
220         /// reLyX and other import/input stuff
221         FD_form_outer_tab * inputs_tab_;
222         /// Spellchecker, language stuff, etc
223         FD_form_outer_tab * usage_tab_;
224         ///
225         FD_form_colours * colours_;
226         ///
227         FD_form_inputs_misc * inputs_misc_;
228         ///
229         FD_form_interface * interface_;
230         ///
231         FD_form_language * language_;
232         ///
233         FD_form_lnf_misc * lnf_misc_;
234         ///
235         FD_form_outputs_misc * outputs_misc_;
236         ///
237         FD_form_paths * paths_;
238         ///
239         FD_form_printer * printer_;
240         ///
241         FD_form_screen_fonts * screen_fonts_;
242         ///
243         FD_form_spellchecker * spellchecker_;
244 };
245
246 #endif