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