]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormPreferences.h
0f8e806681494919ee409accc7dc7e6c5457194a
[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 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;
36 struct FD_form_paths;
37 struct FD_form_preferences;
38 struct FD_form_printer;
39 struct FD_form_screen_fonts;
40 struct FD_form_spellchecker;
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         /// Filter the inputs -- return true if entries are valid
69         virtual bool input(FL_OBJECT *, long);
70         /// Build the dialog
71         virtual void build();
72         /// control which feedback message is output
73         void feedback( FL_OBJECT * );
74         ///
75         virtual FL_FORM * form() const;
76         ///
77         void applyColours() const;
78         ///
79         void applyFormats() 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         bool loadColourBrowser( string const & );
102         ///
103         int searchColourEntry(std::vector<int> const & ) const;
104         ///
105         void buildFormats();
106         ///
107         void buildInputsMisc();
108         ///
109         void buildInterface();
110         ///
111         void buildLanguage();
112         ///
113         void addLanguages( Combox & ) const;
114         ///
115         void buildLnFmisc();
116         ///
117         void buildOutputsMisc();
118         ///
119         void buildPaths();
120         ///
121         void buildPrinter();
122         ///
123         void buildScreenFonts();
124         ///
125         void buildSpellchecker();
126         ///
127         string feedbackColours(FL_OBJECT const * const) const;
128         ///
129         string feedbackFormats( FL_OBJECT const * const ) const;
130         ///
131         string feedbackInputsMisc(FL_OBJECT const * const) const;
132         ///
133         string feedbackInterface(FL_OBJECT const * const) const;
134         ///
135         string feedbackLanguage(FL_OBJECT const * const) const;
136         ///
137         string feedbackLnFmisc(FL_OBJECT const * const) const;
138         ///
139         string feedbackOutputsMisc(FL_OBJECT const * const) const;
140         ///
141         string feedbackPaths(FL_OBJECT const * const) const;
142         ///
143         string feedbackPrinter(FL_OBJECT const * const) const;
144         ///
145         string feedbackScreenFonts(FL_OBJECT const * const) const;
146         ///
147         string feedbackSpellChecker(FL_OBJECT const * const) const;
148         ///
149         bool inputColours(FL_OBJECT const * const);
150         ///
151         bool inputFormats( FL_OBJECT const * const );
152         ///
153         bool inputLanguage(FL_OBJECT const * const);
154         ///
155         bool inputPaths(FL_OBJECT const * const);
156         ///
157         bool inputScreenFonts();
158         ///
159         bool inputSpellChecker(FL_OBJECT const * const);
160         ///
161         void updateColours();
162         ///
163         void updateColoursBrowser( int );
164         ///
165         void updateColoursRGB();
166         ///
167         void updateFormats();
168         ///
169         void updateInputsMisc();
170         ///
171         void updateInterface();
172         ///
173         void updateLanguage();
174         ///
175         void updateLnFmisc();
176         ///
177         void updateOutputsMisc();
178         ///
179         void updatePaths();
180         ///
181         void updatePrinter();
182         ///
183         void updateScreenFonts();
184         ///
185         void updateSpellChecker();
186
187         ///
188         bool WriteableDir( string const & ) const;
189         ///
190         bool ReadableDir( string const & ) const;
191         ///
192         bool WriteableFile( string const &, string const & = string() ) const;
193         ///
194         void setPostHandler( FL_OBJECT * ) const;
195
196         ///
197         FD_form_preferences * build_preferences();
198         ///
199         FD_form_outer_tab * build_outer_tab();
200         ///
201         FD_form_colours * build_colours();
202         ///
203         FD_form_formats * build_formats();
204         ///
205         FD_form_inputs_misc * build_inputs_misc();
206         ///
207         FD_form_interface * build_interface();
208         ///
209         FD_form_language * build_language();
210         ///
211         FD_form_lnf_misc * build_lnf_misc();
212         ///
213         FD_form_outputs_misc * build_outputs_misc();
214         ///
215         FD_form_paths * build_paths();
216         ///
217         FD_form_printer * build_printer();
218         ///
219         FD_form_screen_fonts * build_screen_fonts();
220         ///
221         FD_form_spellchecker * build_spellchecker();
222
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_;
233         ///
234         FD_form_colours * colours_;
235         ///
236         FD_form_formats * formats_;
237         ///
238         FD_form_inputs_misc * inputs_misc_;
239         ///
240         FD_form_interface * interface_;
241         ///
242         FD_form_language * language_;
243         ///
244         FD_form_lnf_misc * lnf_misc_;
245         ///
246         FD_form_outputs_misc * outputs_misc_;
247         ///
248         FD_form_paths * paths_;
249         ///
250         FD_form_printer * printer_;
251         ///
252         FD_form_screen_fonts * screen_fonts_;
253         ///
254         FD_form_spellchecker * spellchecker_;
255         ///
256         Combox * combo_default_lang;
257         ///
258         Combox * combo_kbmap_1;
259         ///
260         Combox * combo_kbmap_2;
261         ///
262         FL_OBJECT * feedbackObj;
263 };
264
265 #endif