]> git.lyx.org Git - lyx.git/blob - src/lyxrc.h
find correct ps and pdf previewers in win32 (bug 1508); remove lyxrc variable \ps_command
[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 <string>
25
26
27 /// This contains the runtime configuration of LyX
28 class LyXRC //: public noncopyable {
29 // after 1.1.6 I will use a LyXRCStruct here and then this can be made
30 // noncopyable again.  For now I want to minimise changes.  ARRae 20001010
31 {
32 public:
33 enum LyXRCTags {
34         RC_FONT_ENCODING = 1,
35         RC_PRINTER,
36         RC_PRINT_COMMAND,
37         RC_PRINTEVENPAGEFLAG,
38         RC_PRINTODDPAGEFLAG,
39         RC_PRINTPAGERANGEFLAG,
40         RC_PRINTCOPIESFLAG,
41         RC_PRINTCOLLCOPIESFLAG,
42         RC_PRINTREVERSEFLAG,
43         RC_PRINTLANDSCAPEFLAG,
44         RC_PRINTTOPRINTER,
45         RC_PRINT_ADAPTOUTPUT,
46         RC_PRINTTOFILE,
47         RC_PRINTFILEEXTENSION,
48         RC_PRINTEXSTRAOPTIONS,
49         RC_PRINTSPOOL_COMMAND,
50         RC_PRINTSPOOL_PRINTERPREFIX,
51         RC_PRINTPAPERFLAG,
52         RC_PRINTPAPERDIMENSIONFLAG,
53         RC_CUSTOM_EXPORT_COMMAND,
54         RC_CUSTOM_EXPORT_FORMAT,
55         RC_SCREEN_DPI,
56         RC_SCREEN_ZOOM,
57         RC_SCREEN_FONT_SIZES,
58         RC_SCREEN_FONT_ROMAN,
59         RC_SCREEN_FONT_SANS,
60         RC_SCREEN_FONT_TYPEWRITER,
61         RC_SCREEN_FONT_ROMAN_FOUNDRY,
62         RC_SCREEN_FONT_SANS_FOUNDRY,
63         RC_SCREEN_FONT_TYPEWRITER_FOUNDRY,
64         RC_SCREEN_FONT_ENCODING,
65         RC_POPUP_BOLD_FONT,
66         RC_POPUP_NORMAL_FONT,
67         RC_POPUP_FONT_ENCODING,
68         RC_SET_COLOR,
69         RC_AUTOSAVE,
70         RC_DOCUMENTPATH,
71         RC_TEMPLATEPATH,
72         RC_TEMPDIRPATH,
73         RC_USETEMPDIR,
74         RC_LASTFILES,
75         RC_AUTOREGIONDELETE,
76         RC_AUTORESET_OPTIONS,
77         RC_SERVERPIPE,
78         RC_INPUT,
79         RC_BINDFILE,
80         RC_UIFILE,
81         RC_KBMAP,
82         RC_KBMAP_PRIMARY,
83         RC_KBMAP_SECONDARY,
84         RC_ASCIIROFF_COMMAND,
85         RC_ASCII_LINELEN,
86         RC_NUMLASTFILES,
87         RC_CHECKLASTFILES,
88         RC_VIEWDVI_PAPEROPTION,
89         RC_DEFAULT_PAPERSIZE,
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(std::string const & filename);
141         ///
142         void write(std::string const & filename) const;
143         ///
144         void print() const;
145         ///
146         void output(std::ostream & os) const;
147         ///
148         static std::string const getDescription(LyXRCTags);
149         ///
150         std::string bind_file;
151         ///
152         std::string ui_file;
153         ///
154         std::string printer;
155         ///
156         std::string print_command;
157         ///
158         std::string print_evenpage_flag;
159         ///
160         std::string print_oddpage_flag;
161         ///
162         std::string print_pagerange_flag;
163         ///
164         std::string print_copies_flag;
165         ///
166         std::string print_collcopies_flag;
167         ///
168         std::string print_reverse_flag;
169         ///
170         std::string print_landscape_flag;
171         ///
172         std::string print_to_printer;
173         ///
174         bool print_adapt_output;
175         ///
176         std::string print_to_file;
177         ///
178         std::string print_file_extension;
179         ///
180         std::string print_extra_options;
181         ///
182         std::string print_spool_command;
183         ///
184         std::string print_spool_printerprefix;
185         ///
186         std::string print_paper_flag;
187         ///
188         std::string print_paper_dimension_flag;
189         ///
190         std::string custom_export_command;
191         ///
192         std::string custom_export_format;
193         /// option for telling the dvi viewer about the paper size
194         std::string view_dvi_paper_option;
195         /// default paper size for local xdvi/dvips/ghostview/whatever
196         PAPER_SIZE default_papersize;
197         /// command to run chktex incl. options
198         std::string chktex_command;
199         ///
200         std::string document_path;
201         ///
202         std::string template_path;
203         ///
204         std::string tempdir_path;
205         ///
206         bool auto_region_delete;
207         /// flag telling whether lastfiles should be checked for existance
208         bool auto_reset_options;
209         ///
210         bool check_lastfiles;
211         /// filename for lastfiles file
212         std::string lastfiles;
213         /// maximal number of lastfiles
214         unsigned int num_lastfiles;
215         /// shall a backup file be created
216         bool make_backup;
217         /// A directory for storing backup files
218         std::string backupdir_path;
219         /// Zoom factor for screen fonts
220         unsigned int zoom;
221         /// parameter for button_4 and button_5 (scrollwheel)
222         unsigned int wheel_jump;
223         /// Screen font sizes in points for each font size
224         float font_sizes[10];
225         /// Allow the use of scalable fonts? Default is yes.
226         bool use_scalable_fonts;
227         /// DPI of monitor
228         float dpi;
229         ///
230         std::string fontenc;
231         ///
232         std::string roman_font_name;
233         ///
234         std::string sans_font_name;
235         ///
236         std::string typewriter_font_name;
237         ///
238         std::string roman_font_foundry;
239         ///
240         std::string sans_font_foundry;
241         ///
242         std::string typewriter_font_foundry;
243         ///
244         std::string popup_bold_font;
245         ///
246         std::string popup_normal_font;
247         ///
248         std::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         std::string popup_font_encoding;
274         ///
275         unsigned int autosave;
276         ///
277         std::string ascii_roff_command;
278         ///
279         unsigned int ascii_linelen;
280         /// use library instead of process
281         bool use_spell_lib;
282         /// Ispell command
283         std::string isp_command;
284         /// Accept compound words in spellchecker?
285         bool isp_accept_compound;
286         /// Pass input encoding switch to ispell?
287         bool isp_use_input_encoding;
288         /// Use alternate language?
289         bool isp_use_alt_lang;
290         /// Use personal dictionary?
291         bool isp_use_pers_dict;
292         /// Use escape chars?
293         bool isp_use_esc_chars;
294         /// Alternate language for ispell
295         std::string isp_alt_lang;
296         /// Alternate personal dictionary file for ispell
297         std::string isp_pers_dict;
298         /// Escape characters
299         std::string isp_esc_chars;
300         ///
301         bool use_kbmap;
302         ///
303         std::string primary_kbmap;
304         ///
305         std::string secondary_kbmap;
306         ///
307         std::string lyxpipes;
308         ///
309         std::string date_insert_format;
310         ///
311         std::string language_package;
312         ///
313         bool language_auto_begin;
314         ///
315         bool language_auto_end;
316         ///
317         std::string language_command_begin;
318         ///
319         std::string language_command_end;
320         ///
321         std::string language_command_local;
322         ///
323         bool language_global_options;
324         ///
325         bool language_use_babel;
326         ///
327         bool rtl_support;
328         ///
329         bool auto_number;
330         ///
331         bool mark_foreign_language;
332         ///
333         std::string default_language;
334         ///
335         bool cursor_follows_scrollbar;
336         ///
337         bool dialogs_iconify_with_main;
338         ///
339         int label_init_length;
340         ///
341         lyx::graphics::DisplayType display_graphics;
342         ///
343         bool show_banner;
344         ///
345         bool preview;
346         ///
347         bool preview_hashed_labels;
348         ///
349         float preview_scale_factor;
350         /// user name
351         std::string user_name;
352         /// user email
353         std::string user_email;
354 };
355
356 ///
357 extern LyXRC lyxrc;
358 ///
359 extern LyXRC system_lyxrc;
360 #endif