2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2000 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,
129 int read (string const & filename);
131 void readBindFileIfNeeded();
133 void write(string const & filename) const;
137 void output(std::ostream & os) const;
139 static string const getDescription(LyXRCTags);
147 string print_command;
149 string print_evenpage_flag;
151 string print_oddpage_flag;
153 string print_pagerange_flag;
155 string print_copies_flag;
157 string print_collcopies_flag;
159 string print_reverse_flag;
161 string print_landscape_flag;
163 string print_to_printer;
165 bool print_adapt_output;
167 string print_to_file;
169 string print_file_extension;
171 string print_extra_options;
173 string print_spool_command;
175 string print_spool_printerprefix;
177 string print_paper_flag;
179 string print_paper_dimension_flag;
181 string custom_export_command;
183 string custom_export_format;
186 /// postscript interpreter (in general "gs", if it is installed)
188 /// option for telling the dvi viewer about the paper size
189 string view_dvi_paper_option;
190 /// default paper size for local xdvi/dvips/ghostview/whatever
191 BufferParams::PAPER_SIZE default_papersize;
192 /// command to run chktex incl. options
193 string chktex_command;
195 string document_path;
197 string template_path;
203 bool auto_region_delete;
204 /// flag telling whether lastfiles should be checked for existance
205 bool check_lastfiles;
206 /// filename for lastfiles file
208 /// maximal number of lastfiles
209 unsigned int num_lastfiles;
210 /// shall a backup file be created
212 /// A directory for storing backup files
213 string backupdir_path;
214 /// Zoom factor for screen fonts
216 /// parameter for button_4 and button_5 (scrollwheel)
217 unsigned int wheel_jump;
218 /// Screen font sizes in points for each font size
219 float font_sizes[10];
220 /// Allow the use of scalable fonts? Default is yes.
221 bool use_scalable_fonts;
224 /// Whether lyx should handle deadkeys by itself
225 bool override_x_deadkeys;
229 string roman_font_name;
231 string sans_font_name;
233 string typewriter_font_name;
235 string menu_font_name;
237 string popup_font_name;
254 FontEncoding font_norm_type;
256 void set_font_norm_type();
258 string font_norm_menu;
260 unsigned int autosave;
262 string ascii_roff_command;
264 unsigned int ascii_linelen;
267 /// Accept compound words in spellchecker?
268 bool isp_accept_compound;
269 /// Pass input encoding switch to ispell?
270 bool isp_use_input_encoding;
271 /// Use alternate language?
272 bool isp_use_alt_lang;
273 /// Use personal dictionary?
274 bool isp_use_pers_dict;
275 /// Use escape chars?
276 bool isp_use_esc_chars;
277 /// Alternate language for ispell
279 /// Alternate personal dictionary file for ispell
280 string isp_pers_dict;
281 /// Escape characters
282 string isp_esc_chars;
285 /// Ask for confirmation of exit when there are unsaved documents?
286 bool exit_confirmation;
287 /// Should we display short-cut information in the minibuffer?
288 bool display_shortcuts;
290 string primary_kbmap;
292 string secondary_kbmap;
296 string date_insert_format;
298 string language_package;
300 bool language_auto_begin;
302 bool language_auto_end;
304 string language_command_begin;
306 string language_command_end;
308 string language_command_local;
310 bool language_global_options;
312 bool language_use_babel;
318 bool mark_foreign_language;
321 /// Do we have to use a GUI?
324 bool new_ask_filename;
326 string default_language;
328 bool cursor_follows_scrollbar;
330 int label_init_length;
332 /// Is a bind file already (or currently) read?
335 int ReadBindFile(string const & name);
341 extern LyXRC system_lyxrc;