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