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