]> git.lyx.org Git - lyx.git/blob - src/lyxrc.h
Correct Andr�'s name
[lyx.git] / src / lyxrc.h
1 // -*- C++ -*-
2 /**
3  * \file lyxrc.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  * \author Jean-Marc Lasgouttes
9  * \author Angus Leeming
10  * \author John Levon
11  * \author André Pönitz
12  * \author Allan Rae
13  * \author Dekel Tsur
14  *
15  * Full author contact details are available in file CREDITS.
16  */
17
18 #ifndef LYXRC_H
19 #define LYXRC_H
20
21 #include "paper.h"
22 #include "graphics/GraphicsTypes.h"
23
24 #include "support/std_string.h"
25
26 /// This contains the runtime configuration of LyX
27 class LyXRC //: public noncopyable {
28 // after 1.1.6 I will use a LyXRCStruct here and then this can be made
29 // noncopyable again.  For now I want to minimise changes.  ARRae 20001010
30 {
31 public:
32 enum LyXRCTags {
33         RC_FONT_ENCODING = 1,
34         RC_PRINTER,
35         RC_PRINT_COMMAND,
36         RC_PRINTEVENPAGEFLAG,
37         RC_PRINTODDPAGEFLAG,
38         RC_PRINTPAGERANGEFLAG,
39         RC_PRINTCOPIESFLAG,
40         RC_PRINTCOLLCOPIESFLAG,
41         RC_PRINTREVERSEFLAG,
42         RC_PRINTLANDSCAPEFLAG,
43         RC_PRINTTOPRINTER,
44         RC_PRINT_ADAPTOUTPUT,
45         RC_PRINTTOFILE,
46         RC_PRINTFILEEXTENSION,
47         RC_PRINTEXSTRAOPTIONS,
48         RC_PRINTSPOOL_COMMAND,
49         RC_PRINTSPOOL_PRINTERPREFIX,
50         RC_PRINTPAPERFLAG,
51         RC_PRINTPAPERDIMENSIONFLAG,
52         RC_CUSTOM_EXPORT_COMMAND,
53         RC_CUSTOM_EXPORT_FORMAT,
54         RC_SCREEN_DPI,
55         RC_SCREEN_ZOOM,
56         RC_SCREEN_FONT_SIZES,
57         RC_SCREEN_FONT_ROMAN,
58         RC_SCREEN_FONT_SANS,
59         RC_SCREEN_FONT_TYPEWRITER,
60         RC_SCREEN_FONT_ROMAN_FOUNDRY,
61         RC_SCREEN_FONT_SANS_FOUNDRY,
62         RC_SCREEN_FONT_TYPEWRITER_FOUNDRY,
63         RC_SCREEN_FONT_ENCODING,
64         RC_POPUP_BOLD_FONT,
65         RC_POPUP_NORMAL_FONT,
66         RC_POPUP_FONT_ENCODING,
67         RC_SET_COLOR,
68         RC_AUTOSAVE,
69         RC_DOCUMENTPATH,
70         RC_TEMPLATEPATH,
71         RC_TEMPDIRPATH,
72         RC_USETEMPDIR,
73         RC_LASTFILES,
74         RC_AUTOREGIONDELETE,
75         RC_AUTORESET_OPTIONS,
76         RC_SERVERPIPE,
77         RC_INPUT,
78         RC_BINDFILE,
79         RC_UIFILE,
80         RC_KBMAP,
81         RC_KBMAP_PRIMARY,
82         RC_KBMAP_SECONDARY,
83         RC_ASCIIROFF_COMMAND,
84         RC_ASCII_LINELEN,
85         RC_NUMLASTFILES,
86         RC_CHECKLASTFILES,
87         RC_VIEWDVI_PAPEROPTION,
88         RC_DEFAULT_PAPERSIZE,
89         RC_PS_COMMAND,
90         RC_ACCEPT_COMPOUND,
91         RC_SPELL_COMMAND,
92         RC_USE_INP_ENC,
93         RC_USE_ALT_LANG,
94         RC_USE_PERS_DICT,
95         RC_USE_ESC_CHARS,
96         RC_SCREEN_FONT_SCALABLE,
97         RC_ALT_LANG,
98         RC_PERS_DICT,
99         RC_ESC_CHARS,
100         RC_CHKTEX_COMMAND,
101         RC_CURSOR_FOLLOWS_SCROLLBAR,
102         RC_DIALOGS_ICONIFY_WITH_MAIN,
103         RC_MAKE_BACKUP,
104         RC_BACKUPDIR_PATH,
105         RC_RTL_SUPPORT,
106         RC_AUTO_NUMBER,
107         RC_MARK_FOREIGN_LANGUAGE,
108         RC_LANGUAGE_PACKAGE,
109         RC_LANGUAGE_AUTO_BEGIN,
110         RC_LANGUAGE_AUTO_END,
111         RC_LANGUAGE_COMMAND_BEGIN,
112         RC_LANGUAGE_COMMAND_END,
113         RC_LANGUAGE_COMMAND_LOCAL,
114         RC_LANGUAGE_GLOBAL_OPTIONS,
115         RC_LANGUAGE_USE_BABEL,
116         RC_DATE_INSERT_FORMAT,
117         RC_SHOW_BANNER,
118         RC_WHEEL_JUMP,
119         RC_CONVERTER,
120         RC_VIEWER,
121         RC_FORMAT,
122         RC_DEFAULT_LANGUAGE,
123         RC_LABEL_INIT_LENGTH,
124         RC_DISPLAY_GRAPHICS,
125         RC_PREVIEW,
126         RC_PREVIEW_HASHED_LABELS,
127         RC_PREVIEW_SCALE_FACTOR,
128         RC_USE_SPELL_LIB,
129         RC_USER_NAME,
130         RC_USER_EMAIL,
131         RC_LAST
132 };
133
134
135         ///
136         LyXRC();
137         ///
138         void setDefaults();
139         ///
140         int read(string const & filename);
141         ///
142         void write(string const & filename) const;
143         ///
144         void print() const;
145         ///
146         void output(std::ostream & os) const;
147         ///
148         static string const getDescription(LyXRCTags);
149         ///
150         string bind_file;
151         ///
152         string ui_file;
153         ///
154         string printer;
155         ///
156         string print_command;
157         ///
158         string print_evenpage_flag;
159         ///
160         string print_oddpage_flag;
161         ///
162         string print_pagerange_flag;
163         ///
164         string print_copies_flag;
165         ///
166         string print_collcopies_flag;
167         ///
168         string print_reverse_flag;
169         ///
170         string print_landscape_flag;
171         ///
172         string print_to_printer;
173         ///
174         bool print_adapt_output;
175         ///
176         string print_to_file;
177         ///
178         string print_file_extension;
179         ///
180         string print_extra_options;
181         ///
182         string print_spool_command;
183         ///
184         string print_spool_printerprefix;
185         ///
186         string print_paper_flag;
187         ///
188         string print_paper_dimension_flag;
189         ///
190         string custom_export_command;
191         ///
192         string custom_export_format;
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         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         ///
234         string fontenc;
235         ///
236         string roman_font_name;
237         ///
238         string sans_font_name;
239         ///
240         string typewriter_font_name;
241         ///
242         string roman_font_foundry;
243         ///
244         string sans_font_foundry;
245         ///
246         string typewriter_font_foundry;
247         ///
248         string popup_bold_font;
249         ///
250         string popup_normal_font;
251         ///
252         string font_norm;
253         ///
254         enum FontEncoding {
255                 ///
256                 ISO_10646_1,
257                 ///
258                 ISO_8859_1,
259                 ///
260                 ISO_8859_3,
261                 ///
262                 ISO_8859_4,
263                 ///
264                 ISO_8859_6_8,
265                 ///
266                 ISO_8859_9,
267                 ///
268                 ISO_8859_15,
269                 ///
270                 OTHER_ENCODING
271         };
272         ///
273         FontEncoding font_norm_type;
274         ///
275         void set_font_norm_type();
276         ///
277         string popup_font_encoding;
278         ///
279         unsigned int autosave;
280         ///
281         string ascii_roff_command;
282         ///
283         unsigned int ascii_linelen;
284         /// use library instead of process
285         bool use_spell_lib;
286         /// Ispell command
287         string isp_command;
288         /// Accept compound words in spellchecker?
289         bool isp_accept_compound;
290         /// Pass input encoding switch to ispell?
291         bool isp_use_input_encoding;
292         /// Use alternate language?
293         bool isp_use_alt_lang;
294         /// Use personal dictionary?
295         bool isp_use_pers_dict;
296         /// Use escape chars?
297         bool isp_use_esc_chars;
298         /// Alternate language for ispell
299         string isp_alt_lang;
300         /// Alternate personal dictionary file for ispell
301         string isp_pers_dict;
302         /// Escape characters
303         string isp_esc_chars;
304         ///
305         bool use_kbmap;
306         ///
307         string primary_kbmap;
308         ///
309         string secondary_kbmap;
310         ///
311         string lyxpipes;
312         ///
313         string date_insert_format;
314         ///
315         string language_package;
316         ///
317         bool language_auto_begin;
318         ///
319         bool language_auto_end;
320         ///
321         string language_command_begin;
322         ///
323         string language_command_end;
324         ///
325         string language_command_local;
326         ///
327         bool language_global_options;
328         ///
329         bool language_use_babel;
330         ///
331         bool rtl_support;
332         ///
333         bool auto_number;
334         ///
335         bool mark_foreign_language;
336         ///
337         string default_language;
338         ///
339         bool cursor_follows_scrollbar;
340         ///
341         bool dialogs_iconify_with_main;
342         ///
343         int label_init_length;
344         ///
345         lyx::graphics::DisplayType display_graphics;
346         ///
347         bool show_banner;
348         ///
349         bool preview;
350         ///
351         bool preview_hashed_labels;
352         ///
353         float preview_scale_factor;
354         /// user name
355         string user_name;
356         /// user email
357         string user_email;
358 };
359
360 ///
361 extern LyXRC lyxrc;
362 ///
363 extern LyXRC system_lyxrc;
364 #endif