4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
8 * \author Jean-Marc Lasgouttes
9 * \author Angus Leeming
11 * \author André Pönitz
15 * Full author contact details are available in file CREDITS.
23 #include "support/strfwd.h"
33 namespace support { class FileName; }
37 /// This contains the runtime configuration of LyX
42 RC_ACCEPT_COMPOUND = 1,
44 RC_AUTOCORRECTION_MATH,
50 RC_BIBTEX_ALTERNATIVES,
55 RC_COMPLETION_CURSOR_TEXT,
56 RC_COMPLETION_INLINE_DELAY,
57 RC_COMPLETION_INLINE_MATH,
58 RC_COMPLETION_INLINE_TEXT,
59 RC_COMPLETION_INLINE_DOTS,
60 RC_COMPLETION_POPUP_DELAY,
61 RC_COMPLETION_POPUP_MATH,
62 RC_COMPLETION_POPUP_TEXT,
63 RC_COMPLETION_POPUP_AFTER_COMPLETE,
65 RC_CONVERTER_CACHE_MAXAGE,
67 RC_CURSOR_FOLLOWS_SCROLLBAR,
68 RC_DATE_INSERT_FORMAT,
70 RC_DEFAULT_VIEW_FORMAT,
73 RC_DIALOGS_ICONIFY_WITH_MAIN,
76 RC_EDITOR_ALTERNATIVES,
82 RC_FULL_SCREEN_SCROLLBAR,
83 RC_FULL_SCREEN_TABBAR,
84 RC_FULL_SCREEN_MENUBAR,
85 RC_FULL_SCREEN_TOOLBARS,
91 RC_INDEX_ALTERNATIVES,
100 RC_LANGUAGE_AUTO_BEGIN,
101 RC_LANGUAGE_AUTO_END,
102 RC_LANGUAGE_COMMAND_BEGIN,
103 RC_LANGUAGE_COMMAND_END,
104 RC_LANGUAGE_COMMAND_LOCAL,
105 RC_LANGUAGE_GLOBAL_OPTIONS,
107 RC_LANGUAGE_USE_BABEL,
110 RC_MAC_LIKE_WORD_MOVEMENT,
112 RC_MARK_FOREIGN_LANGUAGE,
113 RC_MOUSE_WHEEL_SPEED,
116 RC_OPEN_BUFFERS_IN_TABS,
117 RC_PARAGRAPH_MARKERS,
120 RC_PLAINTEXT_LINELEN,
121 RC_PLAINTEXT_ROFF_COMMAND,
123 RC_PREVIEW_HASHED_LABELS,
124 RC_PREVIEW_SCALE_FACTOR,
125 RC_PRINTCOLLCOPIESFLAG,
128 RC_PRINTEVENPAGEFLAG,
129 RC_PRINTEXSTRAOPTIONS,
130 RC_PRINTFILEEXTENSION,
131 RC_PRINTLANDSCAPEFLAG,
133 RC_PRINTPAGERANGEFLAG,
134 RC_PRINTPAPERDIMENSIONFLAG,
137 RC_PRINTSPOOL_COMMAND,
138 RC_PRINTSPOOL_PRINTERPREFIX,
141 RC_PRINT_ADAPTOUTPUT,
145 RC_SCREEN_FONT_ROMAN,
146 RC_SCREEN_FONT_ROMAN_FOUNDRY,
148 RC_SCREEN_FONT_SANS_FOUNDRY,
149 RC_SCREEN_FONT_SCALABLE,
150 RC_SCREEN_FONT_SIZES,
151 RC_SCREEN_FONT_TYPEWRITER,
152 RC_SCREEN_FONT_TYPEWRITER_FOUNDRY,
154 RC_SCROLL_BELOW_DOCUMENT,
158 RC_SINGLE_CLOSE_TAB_BUTTON,
161 RC_SPELLCHECK_CONTINUOUSLY,
164 RC_SPLITINDEX_COMMAND,
167 RC_TEX_ALLOWS_SPACES,
168 RC_TEX_EXPECTS_WINDOWS_PATHS,
176 RC_USE_CONVERTER_CACHE,
183 RC_VIEWDVI_PAPEROPTION,
185 RC_VIEWER_ALTERNATIVES,
195 int read(support::FileName const & filename);
197 int read(std::istream &);
203 typedef std::set<std::string> CommandSet;
204 /// maps a format to a set of commands that can be used to
206 typedef std::map<std::string, CommandSet> Alternatives;
208 void write(support::FileName const & filename,
209 bool ignore_system_lyxrc) const;
210 /// write rc. If a specific tag is given, only output that one.
211 void write(std::ostream & os,
212 bool ignore_system_lyxrc,
213 std::string const & tag = std::string()) const;
216 // FIXME unused (was used for xforms. Do we still need this?)
217 //static docstring const getDescription(LyXRCTags);
219 std::string bind_file;
221 std::string def_file;
227 std::string print_command;
229 std::string print_evenpage_flag;
231 std::string print_oddpage_flag;
233 std::string print_pagerange_flag;
235 std::string print_copies_flag;
237 std::string print_collcopies_flag;
239 std::string print_reverse_flag;
241 std::string print_landscape_flag;
243 std::string print_to_printer;
245 bool print_adapt_output;
247 std::string print_to_file;
249 std::string print_file_extension;
251 std::string print_extra_options;
253 std::string print_spool_command;
255 std::string print_spool_printerprefix;
257 std::string print_paper_flag;
259 std::string print_paper_dimension_flag;
260 /// option for telling the dvi viewer about the paper size
261 std::string view_dvi_paper_option;
262 /// default paper size for local xdvi/dvips/ghostview/whatever
263 PAPER_SIZE default_papersize;
264 /// command to run chktex incl. options
265 std::string chktex_command;
266 /// all available commands to run bibtex incl. options
267 CommandSet bibtex_alternatives;
268 /// command to run bibtex incl. options
269 std::string bibtex_command;
270 /// command to run japanese bibtex incl. options
271 std::string jbibtex_command;
272 /// all available index commands incl. options
273 CommandSet index_alternatives;
274 /// command to run makeindex incl. options or other index programs
275 std::string index_command;
276 /// command to run japanese index program incl. options
277 std::string jindex_command;
278 /// command to generate multiple indices
279 std::string splitindex_command;
280 /// command to run makeindex incl. options for nomencl
281 std::string nomencl_command;
283 std::string document_path;
285 std::string example_path;
287 std::string template_path;
289 std::string tempdir_path;
291 std::string thesaurusdir_path;
293 std::string hunspelldir_path;
295 bool auto_region_delete;
296 /// flag telling whether lastfiles should be checked for existance
297 bool auto_reset_options;
299 bool check_lastfiles;
300 /// maximal number of lastfiles
301 unsigned int num_lastfiles;
302 /// whether or not go to saved position when opening a file
303 bool use_lastfilepos;
304 /// load files from last session automatically
306 /// shall a backup file be created
308 /// A directory for storing backup files
309 std::string backupdir_path;
310 /// Whether or not save/restore session information
311 /// like windows position and geometry.
312 bool allow_geometry_session;
313 /// Scrolling speed of the mouse wheel
314 double mouse_wheel_speed;
315 /// Zoom factor for screen fonts
317 /// Screen font sizes in points for each font size
318 std::string font_sizes[10];
319 /// Allow the use of scalable fonts? Default is yes.
320 bool use_scalable_fonts;
326 std::string roman_font_name;
328 std::string sans_font_name;
330 std::string typewriter_font_name;
332 std::string roman_font_foundry;
334 std::string sans_font_foundry;
336 std::string typewriter_font_foundry;
338 unsigned int autosave;
340 unsigned int plaintext_linelen;
341 /// Accept compound words in spellchecker?
342 bool spellchecker_accept_compound;
343 /// End of paragraph markers?
344 bool paragraph_markers;
347 /// Use pixmap cache?
348 bool use_pixmap_cache;
349 /// Spellchecker engine: aspell, hunspell, etc
350 std::string spellchecker;
351 /// Alternate language for spellchecker
352 std::string spellchecker_alt_lang;
353 /// Escape characters
354 std::string spellchecker_esc_chars;
355 /// spellcheck continuously?
356 bool spellcheck_continuously;
357 /// spellcheck notes and comments?
358 bool spellcheck_notes;
362 std::string primary_kbmap;
364 std::string secondary_kbmap;
366 std::string lyxpipes;
368 std::string date_insert_format;
370 std::string language_package;
372 bool language_auto_begin;
374 bool language_auto_end;
376 std::string language_command_begin;
378 std::string language_command_end;
380 std::string language_command_local;
382 bool language_global_options;
384 bool language_use_babel;
387 /// bidi cursor movement: true = visual, false = logical
392 bool mark_foreign_language;
394 std::string default_language;
396 std::string gui_language;
398 std::string default_view_format;
399 /// all available viewers
400 Alternatives viewer_alternatives;
401 /// all available editors
402 Alternatives editor_alternatives;
404 bool mac_like_word_movement;
406 bool cursor_follows_scrollbar;
408 bool scroll_below_document;
410 enum MacroEditStyle {
411 MACRO_EDIT_INLINE_BOX = 0,
416 MacroEditStyle macro_edit_style;
418 bool dialogs_iconify_with_main;
420 int label_init_length;
422 bool display_graphics;
432 PreviewStatus preview;
434 bool preview_hashed_labels;
436 double preview_scale_factor;
438 std::string user_name;
440 std::string user_email;
441 /// True if the TeX engine cannot handle posix paths
442 bool windows_style_tex_paths;
443 /// True if the TeX engine can handle file names containing spaces
444 bool tex_allows_spaces;
445 /** Prepend paths to the PATH environment variable.
446 * The string is input, stored and output in native format.
448 std::string path_prefix;
449 /// Use the cache for file converters?
450 bool use_converter_cache;
451 /// The maximum age of cache files in seconds
452 unsigned int converter_cache_maxage;
453 /// Sort layouts alphabetically
455 /// Group layout by their category
457 /// Toggle toolbars in fullscreen mode?
458 bool full_screen_toolbars;
459 /// Toggle scrollbar in fullscreen mode?
460 bool full_screen_scrollbar;
461 /// Toggle tabbar in fullscreen mode?
462 bool full_screen_tabbar;
463 /// Toggle menubar in fullscreen mode?
464 bool full_screen_menubar;
465 /// Limit the text width?
466 bool full_screen_limit;
467 /// Width of limited screen (in pixels) in fullscreen mode
468 int full_screen_width;
470 bool completion_cursor_text;
472 double completion_inline_delay;
474 bool completion_inline_math;
476 bool completion_inline_text;
478 int completion_inline_dots;
480 bool autocorrection_math;
482 double completion_popup_delay;
484 bool completion_popup_math;
486 bool completion_popup_text;
488 bool completion_popup_after_complete;
490 bool open_buffers_in_tabs;
492 bool single_close_tab_button;
496 /** \c LyXRC_PreviewStatus is a wrapper for LyXRC::PreviewStatus.
497 * It can be forward-declared and passed as a function argument without
498 * having to expose LyXRC.h.
500 class LyXRC_PreviewStatus {
501 LyXRC::PreviewStatus val_;
503 LyXRC_PreviewStatus(LyXRC::PreviewStatus val) : val_(val) {}
504 operator LyXRC::PreviewStatus() const { return val_; }
507 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new);
512 extern LyXRC system_lyxrc;
514 // used by at least frontends/qt4/GuiPref.cpp
515 const long maxlastfiles = 20;