2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2001 The LyX Team.
10 * ====================================================== */
19 #include "bufferparams.h" // Just to get the enum BufferParams::PAPER_SIZE (sic)
21 // #include <boost/utility.hpp>
23 /// This contains the runtime configuration of LyX
24 class LyXRC //: public noncopyable {
25 // after 1.1.6 I will use a LyXRCStruct here and then this can be made
26 // noncopyable again. For now I want to minimise changes. ARRae 20001010
35 RC_PRINTPAGERANGEFLAG,
37 RC_PRINTCOLLCOPIESFLAG,
39 RC_PRINTLANDSCAPEFLAG,
43 RC_PRINTFILEEXTENSION,
44 RC_PRINTEXSTRAOPTIONS,
45 RC_PRINTSPOOL_COMMAND,
46 RC_PRINTSPOOL_PRINTERPREFIX,
48 RC_PRINTPAPERDIMENSIONFLAG,
49 RC_CUSTOM_EXPORT_COMMAND,
50 RC_CUSTOM_EXPORT_FORMAT,
56 RC_SCREEN_FONT_TYPEWRITER,
57 RC_SCREEN_FONT_ENCODING,
60 RC_POPUP_FONT_ENCODING,
71 RC_OVERRIDE_X_DEADKEYS,
83 RC_VIEWDVI_PAPEROPTION,
92 RC_SCREEN_FONT_SCALABLE,
97 RC_CURSOR_FOLLOWS_SCROLLBAR,
98 RC_DIALOGS_ICONIFY_WITH_MAIN,
104 RC_MARK_FOREIGN_LANGUAGE,
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,
121 RC_LABEL_INIT_LENGTH,
124 RC_PREVIEW_HASHED_LABELS,
125 RC_PREVIEW_SCALE_FACTOR,
138 int read(string const & filename);
140 void readBindFileIfNeeded();
142 void write(string const & filename) const;
146 void output(std::ostream & os) const;
148 static string const getDescription(LyXRCTags);
156 string print_command;
158 string print_evenpage_flag;
160 string print_oddpage_flag;
162 string print_pagerange_flag;
164 string print_copies_flag;
166 string print_collcopies_flag;
168 string print_reverse_flag;
170 string print_landscape_flag;
172 string print_to_printer;
174 bool print_adapt_output;
176 string print_to_file;
178 string print_file_extension;
180 string print_extra_options;
182 string print_spool_command;
184 string print_spool_printerprefix;
186 string print_paper_flag;
188 string print_paper_dimension_flag;
190 string custom_export_command;
192 string custom_export_format;
195 /// postscript interpreter (in general "gs", if it is installed)
197 /// option for telling the dvi viewer about the paper size
198 string view_dvi_paper_option;
199 /// default paper size for local xdvi/dvips/ghostview/whatever
200 BufferParams::PAPER_SIZE default_papersize;
201 /// command to run chktex incl. options
202 string chktex_command;
204 string document_path;
206 string template_path;
212 bool auto_region_delete;
213 /// flag telling whether lastfiles should be checked for existance
214 bool auto_reset_options;
216 bool check_lastfiles;
217 /// filename for lastfiles file
219 /// maximal number of lastfiles
220 unsigned int num_lastfiles;
221 /// shall a backup file be created
223 /// A directory for storing backup files
224 string backupdir_path;
225 /// Zoom factor for screen fonts
227 /// parameter for button_4 and button_5 (scrollwheel)
228 unsigned int wheel_jump;
229 /// Screen font sizes in points for each font size
230 float font_sizes[10];
231 /// Allow the use of scalable fonts? Default is yes.
232 bool use_scalable_fonts;
235 /// Whether lyx should handle deadkeys by itself
236 bool override_x_deadkeys;
240 string roman_font_name;
242 string sans_font_name;
244 string typewriter_font_name;
246 string popup_bold_font;
248 string popup_normal_font;
271 FontEncoding font_norm_type;
273 void set_font_norm_type();
275 string popup_font_encoding;
277 unsigned int autosave;
279 string ascii_roff_command;
281 unsigned int ascii_linelen;
287 /// Accept compound words in spellchecker?
288 bool isp_accept_compound;
289 /// Pass input encoding switch to ispell?
290 bool isp_use_input_encoding;
291 /// Use alternate language?
292 bool isp_use_alt_lang;
293 /// Use personal dictionary?
294 bool isp_use_pers_dict;
295 /// Use escape chars?
296 bool isp_use_esc_chars;
297 /// Alternate language for ispell
299 /// Alternate personal dictionary file for ispell
300 string isp_pers_dict;
301 /// Escape characters
302 string isp_esc_chars;
305 /// Ask for confirmation of exit when there are unsaved documents?
306 bool exit_confirmation;
308 string primary_kbmap;
310 string secondary_kbmap;
314 string date_insert_format;
316 string language_package;
318 bool language_auto_begin;
320 bool language_auto_end;
322 string language_command_begin;
324 string language_command_end;
326 string language_command_local;
328 bool language_global_options;
330 bool language_use_babel;
336 bool mark_foreign_language;
337 /// Do we have to use a GUI?
340 string default_language;
342 bool cursor_follows_scrollbar;
344 bool dialogs_iconify_with_main;
346 int label_init_length;
348 string display_graphics;
354 bool preview_hashed_labels;
356 float preview_scale_factor;
359 /// Is a bind file already (or currently) read?
362 int ReadBindFile(string const & name);
368 extern LyXRC system_lyxrc;