]> git.lyx.org Git - lyx.git/blob - src/lyxrc.h
more cursor dispatch
[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_PS_COMMAND,
91         RC_ACCEPT_COMPOUND,
92         RC_SPELL_COMMAND,
93         RC_USE_INP_ENC,
94         RC_USE_ALT_LANG,
95         RC_USE_PERS_DICT,
96         RC_USE_ESC_CHARS,
97         RC_SCREEN_FONT_SCALABLE,
98         RC_ALT_LANG,
99         RC_PERS_DICT,
100         RC_ESC_CHARS,
101         RC_CHKTEX_COMMAND,
102         RC_CURSOR_FOLLOWS_SCROLLBAR,
103         RC_DIALOGS_ICONIFY_WITH_MAIN,
104         RC_MAKE_BACKUP,
105         RC_BACKUPDIR_PATH,
106         RC_RTL_SUPPORT,
107         RC_AUTO_NUMBER,
108         RC_MARK_FOREIGN_LANGUAGE,
109         RC_LANGUAGE_PACKAGE,
110         RC_LANGUAGE_AUTO_BEGIN,
111         RC_LANGUAGE_AUTO_END,
112         RC_LANGUAGE_COMMAND_BEGIN,
113         RC_LANGUAGE_COMMAND_END,
114         RC_LANGUAGE_COMMAND_LOCAL,
115         RC_LANGUAGE_GLOBAL_OPTIONS,
116         RC_LANGUAGE_USE_BABEL,
117         RC_DATE_INSERT_FORMAT,
118         RC_SHOW_BANNER,
119         RC_WHEEL_JUMP,
120         RC_CONVERTER,
121         RC_VIEWER,
122         RC_FORMAT,
123         RC_DEFAULT_LANGUAGE,
124         RC_LABEL_INIT_LENGTH,
125         RC_DISPLAY_GRAPHICS,
126         RC_PREVIEW,
127         RC_PREVIEW_HASHED_LABELS,
128         RC_PREVIEW_SCALE_FACTOR,
129         RC_USE_SPELL_LIB,
130         RC_USER_NAME,
131         RC_USER_EMAIL,
132         RC_LAST
133 };
134
135
136         ///
137         LyXRC();
138         ///
139         void setDefaults();
140         ///
141         int read(std::string const & filename);
142         ///
143         void write(std::string const & filename) const;
144         ///
145         void print() const;
146         ///
147         void output(std::ostream & os) const;
148         ///
149         static std::string const getDescription(LyXRCTags);
150         ///
151         std::string bind_file;
152         ///
153         std::string ui_file;
154         ///
155         std::string printer;
156         ///
157         std::string print_command;
158         ///
159         std::string print_evenpage_flag;
160         ///
161         std::string print_oddpage_flag;
162         ///
163         std::string print_pagerange_flag;
164         ///
165         std::string print_copies_flag;
166         ///
167         std::string print_collcopies_flag;
168         ///
169         std::string print_reverse_flag;
170         ///
171         std::string print_landscape_flag;
172         ///
173         std::string print_to_printer;
174         ///
175         bool print_adapt_output;
176         ///
177         std::string print_to_file;
178         ///
179         std::string print_file_extension;
180         ///
181         std::string print_extra_options;
182         ///
183         std::string print_spool_command;
184         ///
185         std::string print_spool_printerprefix;
186         ///
187         std::string print_paper_flag;
188         ///
189         std::string print_paper_dimension_flag;
190         ///
191         std::string custom_export_command;
192         ///
193         std::string custom_export_format;
194         /// postscript interpreter (in general "gs", if it is installed)
195         std::string ps_command;
196         /// option for telling the dvi viewer about the paper size
197         std::string view_dvi_paper_option;
198         /// default paper size for local xdvi/dvips/ghostview/whatever
199         PAPER_SIZE default_papersize;
200         /// command to run chktex incl. options
201         std::string chktex_command;
202         ///
203         std::string document_path;
204         ///
205         std::string template_path;
206         ///
207         std::string tempdir_path;
208         ///
209         bool use_tempdir;
210         ///
211         bool auto_region_delete;
212         /// flag telling whether lastfiles should be checked for existance
213         bool auto_reset_options;
214         ///
215         bool check_lastfiles;
216         /// filename for lastfiles file
217         std::string lastfiles;
218         /// maximal number of lastfiles
219         unsigned int num_lastfiles;
220         /// shall a backup file be created
221         bool make_backup;
222         /// A directory for storing backup files
223         std::string backupdir_path;
224         /// Zoom factor for screen fonts
225         unsigned int zoom;
226         /// parameter for button_4 and button_5 (scrollwheel)
227         unsigned int wheel_jump;
228         /// Screen font sizes in points for each font size
229         float font_sizes[10];
230         /// Allow the use of scalable fonts? Default is yes.
231         bool use_scalable_fonts;
232         /// DPI of monitor
233         float dpi;
234         ///
235         std::string fontenc;
236         ///
237         std::string roman_font_name;
238         ///
239         std::string sans_font_name;
240         ///
241         std::string typewriter_font_name;
242         ///
243         std::string roman_font_foundry;
244         ///
245         std::string sans_font_foundry;
246         ///
247         std::string typewriter_font_foundry;
248         ///
249         std::string popup_bold_font;
250         ///
251         std::string popup_normal_font;
252         ///
253         std::string font_norm;
254         ///
255         enum FontEncoding {
256                 ///
257                 ISO_10646_1,
258                 ///
259                 ISO_8859_1,
260                 ///
261                 ISO_8859_3,
262                 ///
263                 ISO_8859_4,
264                 ///
265                 ISO_8859_6_8,
266                 ///
267                 ISO_8859_9,
268                 ///
269                 ISO_8859_15,
270                 ///
271                 OTHER_ENCODING
272         };
273         ///
274         FontEncoding font_norm_type;
275         ///
276         void set_font_norm_type();
277         ///
278         std::string popup_font_encoding;
279         ///
280         unsigned int autosave;
281         ///
282         std::string ascii_roff_command;
283         ///
284         unsigned int ascii_linelen;
285         /// use library instead of process
286         bool use_spell_lib;
287         /// Ispell command
288         std::string isp_command;
289         /// Accept compound words in spellchecker?
290         bool isp_accept_compound;
291         /// Pass input encoding switch to ispell?
292         bool isp_use_input_encoding;
293         /// Use alternate language?
294         bool isp_use_alt_lang;
295         /// Use personal dictionary?
296         bool isp_use_pers_dict;
297         /// Use escape chars?
298         bool isp_use_esc_chars;
299         /// Alternate language for ispell
300         std::string isp_alt_lang;
301         /// Alternate personal dictionary file for ispell
302         std::string isp_pers_dict;
303         /// Escape characters
304         std::string isp_esc_chars;
305         ///
306         bool use_kbmap;
307         ///
308         std::string primary_kbmap;
309         ///
310         std::string secondary_kbmap;
311         ///
312         std::string lyxpipes;
313         ///
314         std::string date_insert_format;
315         ///
316         std::string language_package;
317         ///
318         bool language_auto_begin;
319         ///
320         bool language_auto_end;
321         ///
322         std::string language_command_begin;
323         ///
324         std::string language_command_end;
325         ///
326         std::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         std::string default_language;
339         ///
340         bool cursor_follows_scrollbar;
341         ///
342         bool dialogs_iconify_with_main;
343         ///
344         int label_init_length;
345         ///
346         lyx::graphics::DisplayType display_graphics;
347         ///
348         bool show_banner;
349         ///
350         bool preview;
351         ///
352         bool preview_hashed_labels;
353         ///
354         float preview_scale_factor;
355         /// user name
356         std::string user_name;
357         /// user email
358         std::string user_email;
359 };
360
361 ///
362 extern LyXRC lyxrc;
363 ///
364 extern LyXRC system_lyxrc;
365 #endif