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