]> git.lyx.org Git - lyx.git/blob - src/lyxrc.h
Revoke change made the other day to make menus appear as bold.
[lyx.git] / src / lyxrc.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-2001 The LyX Team.
9  *
10  * ====================================================== */
11
12 #ifndef LYXRC_H
13 #define LYXRC_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "bufferparams.h" // Just to get the enum BufferParams::PAPER_SIZE (sic)
20
21 // #include <boost/utility.hpp>
22
23 /// This contains the runtime configuration of LyX
24 class LyXRC //: public noncopyable {
25 // after 1.1.6 I will use a LyXRCStruct here and then this can be made
26 // noncopyable again.  For now I want to minimise changes.  ARRae 20001010
27 {
28 public:
29 enum LyXRCTags {
30         RC_FONT_ENCODING = 1,
31         RC_PRINTER,
32         RC_PRINT_COMMAND,
33         RC_PRINTEVENPAGEFLAG,
34         RC_PRINTODDPAGEFLAG,
35         RC_PRINTPAGERANGEFLAG,
36         RC_PRINTCOPIESFLAG,
37         RC_PRINTCOLLCOPIESFLAG,
38         RC_PRINTREVERSEFLAG,
39         RC_PRINTLANDSCAPEFLAG,
40         RC_PRINTTOPRINTER,
41         RC_PRINT_ADAPTOUTPUT,
42         RC_PRINTTOFILE,
43         RC_PRINTFILEEXTENSION,
44         RC_PRINTEXSTRAOPTIONS,
45         RC_PRINTSPOOL_COMMAND,
46         RC_PRINTSPOOL_PRINTERPREFIX,
47         RC_PRINTPAPERFLAG,
48         RC_PRINTPAPERDIMENSIONFLAG,
49         RC_CUSTOM_EXPORT_COMMAND,
50         RC_CUSTOM_EXPORT_FORMAT,
51         RC_SCREEN_DPI,
52         RC_SCREEN_ZOOM,
53         RC_SCREEN_FONT_SIZES,
54         RC_SCREEN_FONT_ROMAN,
55         RC_SCREEN_FONT_SANS,
56         RC_SCREEN_FONT_TYPEWRITER,
57         RC_SCREEN_FONT_ENCODING,
58         RC_POPUP_BOLD_FONT,
59         RC_POPUP_NORMAL_FONT,
60         RC_POPUP_FONT_ENCODING,
61         RC_SET_COLOR,
62         RC_AUTOSAVE,
63         RC_DOCUMENTPATH,
64         RC_TEMPLATEPATH,
65         RC_TEMPDIRPATH,
66         RC_USETEMPDIR,
67         RC_LASTFILES,
68         RC_AUTOREGIONDELETE,
69         RC_AUTORESET_OPTIONS,
70         RC_BIND,
71         RC_OVERRIDE_X_DEADKEYS,
72         RC_SERVERPIPE,
73         RC_INPUT,
74         RC_BINDFILE,
75         RC_UIFILE,
76         RC_KBMAP,
77         RC_KBMAP_PRIMARY,
78         RC_KBMAP_SECONDARY,
79         RC_ASCIIROFF_COMMAND,
80         RC_ASCII_LINELEN,
81         RC_NUMLASTFILES,
82         RC_CHECKLASTFILES,
83         RC_VIEWDVI_PAPEROPTION,
84         RC_DEFAULT_PAPERSIZE,
85         RC_PS_COMMAND,
86         RC_ACCEPT_COMPOUND,
87         RC_SPELL_COMMAND,
88         RC_USE_INP_ENC,
89         RC_USE_ALT_LANG,
90         RC_USE_PERS_DICT,
91         RC_USE_ESC_CHARS,
92         RC_SCREEN_FONT_SCALABLE,
93         RC_ALT_LANG,
94         RC_PERS_DICT,
95         RC_ESC_CHARS,
96         RC_CHKTEX_COMMAND,
97         RC_CURSOR_FOLLOWS_SCROLLBAR,
98         RC_DIALOGS_ICONIFY_WITH_MAIN,
99         RC_EXIT_CONFIRMATION,
100         RC_DISPLAY_SHORTCUTS,
101         RC_MAKE_BACKUP,
102         RC_BACKUPDIR_PATH,
103         RC_RTL_SUPPORT,
104         RC_AUTO_NUMBER,
105         RC_MARK_FOREIGN_LANGUAGE,
106         RC_LANGUAGE_PACKAGE,
107         RC_LANGUAGE_AUTO_BEGIN,
108         RC_LANGUAGE_AUTO_END,
109         RC_LANGUAGE_COMMAND_BEGIN,
110         RC_LANGUAGE_COMMAND_END,
111         RC_LANGUAGE_COMMAND_LOCAL,
112         RC_LANGUAGE_GLOBAL_OPTIONS,
113         RC_LANGUAGE_USE_BABEL,
114         RC_DATE_INSERT_FORMAT,
115         RC_SHOW_BANNER,
116         RC_WHEEL_JUMP,
117         RC_CONVERTER,
118         RC_VIEWER,
119         RC_FORMAT,
120         RC_NEW_ASK_FILENAME,
121         RC_DEFAULT_LANGUAGE,
122         RC_LABEL_INIT_LENGTH,
123         RC_DISPLAY_GRAPHICS,
124 #ifdef USE_PSPELL       
125         RC_USE_PSPELL,
126 #endif
127         RC_LAST
128 };
129
130
131         ///
132         LyXRC();
133         ///
134         void setDefaults();
135         ///
136         int read (string const & filename);
137         ///
138         void readBindFileIfNeeded();
139         ///
140         void write(string const & filename) const;
141         ///
142         void print() const;
143         ///
144         void output(std::ostream & os) const;
145         ///
146         static string const getDescription(LyXRCTags);
147         ///
148         string bind_file;
149         ///
150         string ui_file;
151         ///
152         string printer;
153         ///
154         string print_command;
155         ///
156         string print_evenpage_flag;
157         ///
158         string print_oddpage_flag;
159         ///
160         string print_pagerange_flag;
161         ///
162         string print_copies_flag;
163         ///
164         string print_collcopies_flag;
165         ///
166         string print_reverse_flag;
167         ///
168         string print_landscape_flag;
169         ///
170         string print_to_printer;
171         ///
172         bool print_adapt_output;
173         ///
174         string print_to_file;
175         ///
176         string print_file_extension;
177         ///
178         string print_extra_options;
179         ///
180         string print_spool_command;
181         ///
182         string print_spool_printerprefix;
183         ///
184         string print_paper_flag;
185         ///
186         string print_paper_dimension_flag;
187         ///
188         string custom_export_command;
189         ///
190         string custom_export_format;
191         ///
192         bool pdf_mode;
193         /// postscript interpreter (in general "gs", if it is installed)
194         string ps_command;
195         /// option for telling the dvi viewer about the paper size
196         string view_dvi_paper_option;
197         /// default paper size for local xdvi/dvips/ghostview/whatever
198         BufferParams::PAPER_SIZE default_papersize;
199         /// command to run chktex incl. options
200         string chktex_command;
201         ///
202         string document_path;
203         ///
204         string template_path;
205         ///
206         string tempdir_path;
207         ///
208         bool use_tempdir;
209         ///
210         bool auto_region_delete;
211         /// flag telling whether lastfiles should be checked for existance
212         bool auto_reset_options;
213         ///
214         bool check_lastfiles;
215         /// filename for lastfiles file
216         string lastfiles;
217         /// maximal number of lastfiles
218         unsigned int num_lastfiles;
219         /// shall a backup file be created
220         bool make_backup;
221         /// A directory for storing backup files
222         string backupdir_path;
223         /// Zoom factor for screen fonts
224         unsigned int zoom;
225         /// parameter for button_4 and button_5 (scrollwheel)
226         unsigned int wheel_jump;
227         /// Screen font sizes in points for each font size
228         float font_sizes[10];
229         /// Allow the use of scalable fonts? Default is yes.
230         bool use_scalable_fonts;
231         /// DPI of monitor
232         float dpi;
233         /// Whether lyx should handle deadkeys by itself
234         bool override_x_deadkeys;
235         ///
236         string fontenc;
237         ///
238         string roman_font_name;
239         ///
240         string sans_font_name;
241         ///
242         string typewriter_font_name;
243         ///
244         string popup_bold_font;
245         ///
246         string popup_normal_font;
247         ///
248         string font_norm;
249         ///
250         enum FontEncoding {
251                 ///
252                 ISO_10646_1,
253                 ///
254                 ISO_8859_1,
255                 ///
256                 ISO_8859_3,
257                 ///
258                 ISO_8859_4,
259                 ///
260                 ISO_8859_6_8,
261                 ///
262                 ISO_8859_9,
263                 ///
264                 ISO_8859_15,
265                 ///
266                 OTHER_ENCODING
267         };
268         ///
269         FontEncoding font_norm_type;
270         ///
271         void set_font_norm_type();
272         ///
273         string popup_font_encoding;
274         ///
275         unsigned int autosave;
276         ///
277         string ascii_roff_command;
278         ///
279         unsigned int ascii_linelen;
280         /// Ispell command
281 #ifdef USE_PSPELL       
282         bool use_pspell;
283 #endif
284         string isp_command;
285         /// Accept compound words in spellchecker?
286         bool isp_accept_compound;
287         /// Pass input encoding switch to ispell?
288         bool isp_use_input_encoding;
289         /// Use alternate language?
290         bool isp_use_alt_lang;
291         /// Use personal dictionary?
292         bool isp_use_pers_dict;
293         /// Use escape chars?
294         bool isp_use_esc_chars;
295         /// Alternate language for ispell
296         string isp_alt_lang;
297         /// Alternate personal dictionary file for ispell
298         string isp_pers_dict;
299         /// Escape characters
300         string isp_esc_chars;
301         ///
302         bool use_kbmap;
303         /// Ask for confirmation of exit when there are unsaved documents?
304         bool exit_confirmation;
305         /// Should we display short-cut information in the minibuffer?
306         bool display_shortcuts;
307         ///
308         string primary_kbmap;
309         ///
310         string secondary_kbmap;
311         ///
312         string lyxpipes;
313         ///
314         string date_insert_format;
315         ///
316         string language_package;
317         ///
318         bool language_auto_begin;
319         ///
320         bool language_auto_end;
321         ///
322         string language_command_begin;
323         ///
324         string language_command_end;
325         ///
326         string language_command_local;
327         ///
328         bool language_global_options; 
329         ///
330         bool language_use_babel;
331         ///
332         bool rtl_support;
333         ///
334         bool auto_number;
335         ///
336         bool mark_foreign_language;
337         ///
338         bool show_banner;
339         /// Do we have to use a GUI?
340         bool use_gui;
341         ///
342         bool new_ask_filename;
343         ///
344         string default_language;
345         ///
346         bool cursor_follows_scrollbar;
347         ///
348         bool dialogs_iconify_with_main;
349         ///
350         int label_init_length;
351         ///
352         string display_graphics;
353 private:
354         /// Is a bind file already (or currently) read?
355         bool hasBindFile;
356         ///
357         int ReadBindFile(string const & name);
358 };
359
360 ///
361 extern LyXRC lyxrc;
362 ///
363 extern LyXRC system_lyxrc;
364 #endif