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"
20 #include <boost/utility.hpp>
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
34 RC_PRINTPAGERANGEFLAG,
36 RC_PRINTCOLLCOPIESFLAG,
38 RC_PRINTLANDSCAPEFLAG,
42 RC_PRINTFILEEXTENSION,
43 RC_PRINTEXSTRAOPTIONS,
44 RC_PRINTSPOOL_COMMAND,
45 RC_PRINTSPOOL_PRINTERPREFIX,
47 RC_PRINTPAPERDIMENSIONFLAG,
48 RC_CUSTOM_EXPORT_COMMAND,
49 RC_CUSTOM_EXPORT_FORMAT,
55 RC_SCREEN_FONT_TYPEWRITER,
58 RC_SCREEN_FONT_ENCODING,
59 RC_SCREEN_FONT_ENCODING_MENU,
69 RC_OVERRIDE_X_DEADKEYS,
81 RC_VIEWDVI_PAPEROPTION,
90 RC_SCREEN_FONT_SCALABLE,
95 RC_CURSOR_FOLLOWS_SCROLLBAR,
102 RC_MARK_FOREIGN_LANGUAGE,
104 RC_LANGUAGE_AUTO_BEGIN,
105 RC_LANGUAGE_AUTO_END,
106 RC_LANGUAGE_COMMAND_BEGIN,
107 RC_LANGUAGE_COMMAND_END,
108 RC_LANGUAGE_COMMAND_LOCAL,
109 RC_LANGUAGE_GLOBAL_OPTIONS,
110 RC_LANGUAGE_USE_BABEL,
111 RC_DATE_INSERT_FORMAT,
119 RC_LABEL_INIT_LENGTH,
132 int read (string const & filename);
134 void readBindFileIfNeeded();
136 void write(string const & filename) const;
140 void output(std::ostream & os) const;
142 static string const getDescription(LyXRCTags);
150 string print_command;
152 string print_evenpage_flag;
154 string print_oddpage_flag;
156 string print_pagerange_flag;
158 string print_copies_flag;
160 string print_collcopies_flag;
162 string print_reverse_flag;
164 string print_landscape_flag;
166 string print_to_printer;
168 bool print_adapt_output;
170 string print_to_file;
172 string print_file_extension;
174 string print_extra_options;
176 string print_spool_command;
178 string print_spool_printerprefix;
180 string print_paper_flag;
182 string print_paper_dimension_flag;
184 string custom_export_command;
186 string custom_export_format;
189 /// postscript interpreter (in general "gs", if it is installed)
191 /// option for telling the dvi viewer about the paper size
192 string view_dvi_paper_option;
193 /// default paper size for local xdvi/dvips/ghostview/whatever
194 BufferParams::PAPER_SIZE default_papersize;
195 /// command to run chktex incl. options
196 string chktex_command;
198 string document_path;
200 string template_path;
206 bool auto_region_delete;
207 /// flag telling whether lastfiles should be checked for existance
208 bool check_lastfiles;
209 /// filename for lastfiles file
211 /// maximal number of lastfiles
212 unsigned int num_lastfiles;
213 /// shall a backup file be created
215 /// A directory for storing backup files
216 string backupdir_path;
217 /// Zoom factor for screen fonts
219 /// parameter for button_4 and button_5 (scrollwheel)
220 unsigned int wheel_jump;
221 /// Screen font sizes in points for each font size
222 float font_sizes[10];
223 /// Allow the use of scalable fonts? Default is yes.
224 bool use_scalable_fonts;
227 /// Whether lyx should handle deadkeys by itself
228 bool override_x_deadkeys;
232 string roman_font_name;
234 string sans_font_name;
236 string typewriter_font_name;
238 string menu_font_name;
240 string popup_font_name;
257 FontEncoding font_norm_type;
259 void set_font_norm_type();
261 string font_norm_menu;
263 unsigned int autosave;
265 string ascii_roff_command;
267 unsigned int ascii_linelen;
273 /// Accept compound words in spellchecker?
274 bool isp_accept_compound;
275 /// Pass input encoding switch to ispell?
276 bool isp_use_input_encoding;
277 /// Use alternate language?
278 bool isp_use_alt_lang;
279 /// Use personal dictionary?
280 bool isp_use_pers_dict;
281 /// Use escape chars?
282 bool isp_use_esc_chars;
283 /// Alternate language for ispell
285 /// Alternate personal dictionary file for ispell
286 string isp_pers_dict;
287 /// Escape characters
288 string isp_esc_chars;
291 /// Ask for confirmation of exit when there are unsaved documents?
292 bool exit_confirmation;
293 /// Should we display short-cut information in the minibuffer?
294 bool display_shortcuts;
296 string primary_kbmap;
298 string secondary_kbmap;
302 string date_insert_format;
304 string language_package;
306 bool language_auto_begin;
308 bool language_auto_end;
310 string language_command_begin;
312 string language_command_end;
314 string language_command_local;
316 bool language_global_options;
318 bool language_use_babel;
324 bool mark_foreign_language;
327 /// Do we have to use a GUI?
330 bool new_ask_filename;
332 string default_language;
334 bool cursor_follows_scrollbar;
336 int label_init_length;
338 /// Is a bind file already (or currently) read?
341 int ReadBindFile(string const & name);
347 extern LyXRC system_lyxrc;