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)
20 #include "graphics/GraphicsTypes.h"
22 // #include <boost/utility.hpp>
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
36 RC_PRINTPAGERANGEFLAG,
38 RC_PRINTCOLLCOPIESFLAG,
40 RC_PRINTLANDSCAPEFLAG,
44 RC_PRINTFILEEXTENSION,
45 RC_PRINTEXSTRAOPTIONS,
46 RC_PRINTSPOOL_COMMAND,
47 RC_PRINTSPOOL_PRINTERPREFIX,
49 RC_PRINTPAPERDIMENSIONFLAG,
50 RC_CUSTOM_EXPORT_COMMAND,
51 RC_CUSTOM_EXPORT_FORMAT,
57 RC_SCREEN_FONT_TYPEWRITER,
58 RC_SCREEN_FONT_ENCODING,
61 RC_POPUP_FONT_ENCODING,
72 RC_OVERRIDE_X_DEADKEYS,
84 RC_VIEWDVI_PAPEROPTION,
93 RC_SCREEN_FONT_SCALABLE,
98 RC_CURSOR_FOLLOWS_SCROLLBAR,
99 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,
120 RC_LABEL_INIT_LENGTH,
123 RC_PREVIEW_HASHED_LABELS,
124 RC_PREVIEW_SCALE_FACTOR,
137 int read(string const & filename);
139 void readBindFileIfNeeded();
141 void write(string const & filename) const;
145 void output(std::ostream & os) const;
147 static string const getDescription(LyXRCTags);
155 string print_command;
157 string print_evenpage_flag;
159 string print_oddpage_flag;
161 string print_pagerange_flag;
163 string print_copies_flag;
165 string print_collcopies_flag;
167 string print_reverse_flag;
169 string print_landscape_flag;
171 string print_to_printer;
173 bool print_adapt_output;
175 string print_to_file;
177 string print_file_extension;
179 string print_extra_options;
181 string print_spool_command;
183 string print_spool_printerprefix;
185 string print_paper_flag;
187 string print_paper_dimension_flag;
189 string custom_export_command;
191 string custom_export_format;
194 /// postscript interpreter (in general "gs", if it is installed)
196 /// option for telling the dvi viewer about the paper size
197 string view_dvi_paper_option;
198 /// default paper size for local xdvi/dvips/ghostview/whatever
199 BufferParams::PAPER_SIZE default_papersize;
200 /// command to run chktex incl. options
201 string chktex_command;
203 string document_path;
205 string template_path;
211 bool auto_region_delete;
212 /// flag telling whether lastfiles should be checked for existance
213 bool auto_reset_options;
215 bool check_lastfiles;
216 /// filename for lastfiles file
218 /// maximal number of lastfiles
219 unsigned int num_lastfiles;
220 /// shall a backup file be created
222 /// A directory for storing backup files
223 string backupdir_path;
224 /// Zoom factor for screen fonts
226 /// parameter for button_4 and button_5 (scrollwheel)
227 unsigned int wheel_jump;
228 /// Screen font sizes in points for each font size
229 float font_sizes[10];
230 /// Allow the use of scalable fonts? Default is yes.
231 bool use_scalable_fonts;
234 /// Whether lyx should handle deadkeys by itself
235 bool override_x_deadkeys;
239 string roman_font_name;
241 string sans_font_name;
243 string typewriter_font_name;
245 string popup_bold_font;
247 string popup_normal_font;
270 FontEncoding font_norm_type;
272 void set_font_norm_type();
274 string popup_font_encoding;
276 unsigned int autosave;
278 string ascii_roff_command;
280 unsigned int ascii_linelen;
286 /// Accept compound words in spellchecker?
287 bool isp_accept_compound;
288 /// Pass input encoding switch to ispell?
289 bool isp_use_input_encoding;
290 /// Use alternate language?
291 bool isp_use_alt_lang;
292 /// Use personal dictionary?
293 bool isp_use_pers_dict;
294 /// Use escape chars?
295 bool isp_use_esc_chars;
296 /// Alternate language for ispell
298 /// Alternate personal dictionary file for ispell
299 string isp_pers_dict;
300 /// Escape characters
301 string isp_esc_chars;
305 string primary_kbmap;
307 string secondary_kbmap;
311 string date_insert_format;
313 string language_package;
315 bool language_auto_begin;
317 bool language_auto_end;
319 string language_command_begin;
321 string language_command_end;
323 string language_command_local;
325 bool language_global_options;
327 bool language_use_babel;
333 bool mark_foreign_language;
334 /// Do we have to use a GUI?
337 string default_language;
339 bool cursor_follows_scrollbar;
341 bool dialogs_iconify_with_main;
343 int label_init_length;
345 grfx::DisplayType display_graphics;
351 bool preview_hashed_labels;
353 float preview_scale_factor;
356 /// Is a bind file already (or currently) read?
359 int ReadBindFile(string const & name);
365 extern LyXRC system_lyxrc;