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,
81 RC_FORWARD_SEARCH_DVI,
82 RC_FORWARD_SEARCH_PDF,
84 RC_FULL_SCREEN_SCROLLBAR,
85 RC_FULL_SCREEN_TABBAR,
86 RC_FULL_SCREEN_MENUBAR,
87 RC_FULL_SCREEN_TOOLBARS,
93 RC_INDEX_ALTERNATIVES,
101 RC_LANGUAGE_AUTO_BEGIN,
102 RC_LANGUAGE_AUTO_END,
103 RC_LANGUAGE_COMMAND_BEGIN,
104 RC_LANGUAGE_COMMAND_END,
105 RC_LANGUAGE_COMMAND_LOCAL,
106 RC_LANGUAGE_GLOBAL_OPTIONS,
108 RC_LANGUAGE_USE_BABEL,
111 RC_MAC_LIKE_WORD_MOVEMENT,
113 RC_MARK_FOREIGN_LANGUAGE,
114 RC_MOUSE_WHEEL_SPEED,
117 RC_OPEN_BUFFERS_IN_TABS,
118 RC_PARAGRAPH_MARKERS,
121 RC_PLAINTEXT_LINELEN,
122 RC_PLAINTEXT_ROFF_COMMAND,
124 RC_PREVIEW_HASHED_LABELS,
125 RC_PREVIEW_SCALE_FACTOR,
126 RC_PRINTCOLLCOPIESFLAG,
129 RC_PRINTEVENPAGEFLAG,
130 RC_PRINTEXSTRAOPTIONS,
131 RC_PRINTFILEEXTENSION,
132 RC_PRINTLANDSCAPEFLAG,
134 RC_PRINTPAGERANGEFLAG,
135 RC_PRINTPAPERDIMENSIONFLAG,
138 RC_PRINTSPOOL_COMMAND,
139 RC_PRINTSPOOL_PRINTERPREFIX,
142 RC_PRINT_ADAPTOUTPUT,
147 RC_SCREEN_FONT_ROMAN,
148 RC_SCREEN_FONT_ROMAN_FOUNDRY,
150 RC_SCREEN_FONT_SANS_FOUNDRY,
151 RC_SCREEN_FONT_SCALABLE,
152 RC_SCREEN_FONT_SIZES,
153 RC_SCREEN_FONT_TYPEWRITER,
154 RC_SCREEN_FONT_TYPEWRITER_FOUNDRY,
156 RC_SCROLL_BELOW_DOCUMENT,
160 RC_SINGLE_CLOSE_TAB_BUTTON,
163 RC_SPELLCHECK_CONTINUOUSLY,
166 RC_SPLITINDEX_COMMAND,
169 RC_TEX_ALLOWS_SPACES,
170 RC_TEX_EXPECTS_WINDOWS_PATHS,
178 RC_USE_CONVERTER_CACHE,
185 RC_VIEWDVI_PAPEROPTION,
187 RC_VIEWER_ALTERNATIVES,
197 int read(support::FileName const & filename);
199 int read(std::istream &);
205 typedef std::set<std::string> CommandSet;
206 /// maps a format to a set of commands that can be used to
208 typedef std::map<std::string, CommandSet> Alternatives;
210 void write(support::FileName const & filename,
211 bool ignore_system_lyxrc) const;
212 /// write rc. If a specific tag is given, only output that one.
213 void write(std::ostream & os,
214 bool ignore_system_lyxrc,
215 std::string const & tag = std::string()) const;
218 // FIXME unused (was used for xforms. Do we still need this?)
219 //static docstring const getDescription(LyXRCTags);
221 std::string bind_file;
223 std::string def_file;
229 std::string print_command;
231 std::string print_evenpage_flag;
233 std::string print_oddpage_flag;
235 std::string print_pagerange_flag;
237 std::string print_copies_flag;
239 std::string print_collcopies_flag;
241 std::string print_reverse_flag;
243 std::string print_landscape_flag;
245 std::string print_to_printer;
247 bool print_adapt_output;
249 std::string print_to_file;
251 std::string print_file_extension;
253 std::string print_extra_options;
255 std::string print_spool_command;
257 std::string print_spool_printerprefix;
259 std::string print_paper_flag;
261 std::string print_paper_dimension_flag;
262 /// option for telling the dvi viewer about the paper size
263 std::string view_dvi_paper_option;
264 /// default paper size for local xdvi/dvips/ghostview/whatever
265 PAPER_SIZE default_papersize;
266 /// command to run chktex incl. options
267 std::string chktex_command;
268 /// all available commands to run bibtex incl. options
269 CommandSet bibtex_alternatives;
270 /// command to run bibtex incl. options
271 std::string bibtex_command;
272 /// command to run japanese bibtex incl. options
273 std::string jbibtex_command;
274 /// all available index commands incl. options
275 CommandSet index_alternatives;
276 /// command to run makeindex incl. options or other index programs
277 std::string index_command;
278 /// command to run japanese index program incl. options
279 std::string jindex_command;
280 /// command to generate multiple indices
281 std::string splitindex_command;
282 /// command to run makeindex incl. options for nomencl
283 std::string nomencl_command;
285 std::string document_path;
287 std::string example_path;
289 std::string template_path;
291 std::string tempdir_path;
293 std::string thesaurusdir_path;
295 std::string hunspelldir_path;
297 bool auto_region_delete;
298 /// flag telling whether lastfiles should be checked for existance
299 bool auto_reset_options;
301 bool check_lastfiles;
302 /// maximal number of lastfiles
303 unsigned int num_lastfiles;
304 /// whether or not go to saved position when opening a file
305 bool use_lastfilepos;
306 /// load files from last session automatically
308 /// do we save new documents as compressed by default
309 bool save_compressed;
310 /// shall a backup file be created
312 /// A directory for storing backup files
313 std::string backupdir_path;
314 /// Whether or not save/restore session information
315 /// like windows position and geometry.
316 bool allow_geometry_session;
317 /// Scrolling speed of the mouse wheel
318 double mouse_wheel_speed;
319 /// Zoom factor for screen fonts
321 /// Screen font sizes in points for each font size
322 std::string font_sizes[10];
323 /// Allow the use of scalable fonts? Default is yes.
324 bool use_scalable_fonts;
330 std::string roman_font_name;
332 std::string sans_font_name;
334 std::string typewriter_font_name;
336 std::string roman_font_foundry;
338 std::string sans_font_foundry;
340 std::string typewriter_font_foundry;
342 unsigned int autosave;
344 unsigned int plaintext_linelen;
345 /// Accept compound words in spellchecker?
346 bool spellchecker_accept_compound;
347 /// End of paragraph markers?
348 bool paragraph_markers;
351 /// Use pixmap cache?
352 bool use_pixmap_cache;
353 /// Spellchecker engine: aspell, hunspell, etc
354 std::string spellchecker;
355 /// Alternate language for spellchecker
356 std::string spellchecker_alt_lang;
357 /// Escape characters
358 std::string spellchecker_esc_chars;
359 /// spellcheck continuously?
360 bool spellcheck_continuously;
361 /// spellcheck notes and comments?
362 bool spellcheck_notes;
366 std::string primary_kbmap;
368 std::string secondary_kbmap;
370 std::string lyxpipes;
372 std::string date_insert_format;
374 std::string language_package;
376 bool language_auto_begin;
378 bool language_auto_end;
380 std::string language_command_begin;
382 std::string language_command_end;
384 std::string language_command_local;
386 bool language_global_options;
388 bool language_use_babel;
391 /// bidi cursor movement: true = visual, false = logical
396 bool mark_foreign_language;
398 std::string default_language;
400 std::string gui_language;
402 std::string default_view_format;
403 /// all available viewers
404 Alternatives viewer_alternatives;
405 /// all available editors
406 Alternatives editor_alternatives;
408 bool mac_like_word_movement;
410 bool cursor_follows_scrollbar;
412 bool scroll_below_document;
414 enum MacroEditStyle {
415 MACRO_EDIT_INLINE_BOX = 0,
420 MacroEditStyle macro_edit_style;
422 bool dialogs_iconify_with_main;
424 bool display_graphics;
434 PreviewStatus preview;
436 bool preview_hashed_labels;
438 double preview_scale_factor;
440 std::string user_name;
442 std::string user_email;
443 /// True if the TeX engine cannot handle posix paths
444 bool windows_style_tex_paths;
445 /// True if the TeX engine can handle file names containing spaces
446 bool tex_allows_spaces;
447 /** Prepend paths to the PATH environment variable.
448 * The string is input, stored and output in native format.
450 std::string path_prefix;
451 /// Use the cache for file converters?
452 bool use_converter_cache;
453 /// The maximum age of cache files in seconds
454 unsigned int converter_cache_maxage;
455 /// Sort layouts alphabetically
457 /// Group layout by their category
459 /// Toggle toolbars in fullscreen mode?
460 bool full_screen_toolbars;
461 /// Toggle scrollbar in fullscreen mode?
462 bool full_screen_scrollbar;
463 /// Toggle tabbar in fullscreen mode?
464 bool full_screen_tabbar;
465 /// Toggle menubar in fullscreen mode?
466 bool full_screen_menubar;
467 /// Limit the text width?
468 bool full_screen_limit;
469 /// Width of limited screen (in pixels) in fullscreen mode
470 int full_screen_width;
472 bool completion_cursor_text;
474 double completion_inline_delay;
476 bool completion_inline_math;
478 bool completion_inline_text;
480 int completion_inline_dots;
482 bool autocorrection_math;
484 double completion_popup_delay;
486 bool completion_popup_math;
488 bool completion_popup_text;
490 bool completion_popup_after_complete;
492 bool open_buffers_in_tabs;
494 bool single_close_tab_button;
496 std::string forward_search_dvi;
498 std::string forward_search_pdf;
502 /** \c LyXRC_PreviewStatus is a wrapper for LyXRC::PreviewStatus.
503 * It can be forward-declared and passed as a function argument without
504 * having to expose LyXRC.h.
506 class LyXRC_PreviewStatus {
507 LyXRC::PreviewStatus val_;
509 LyXRC_PreviewStatus(LyXRC::PreviewStatus val) : val_(val) {}
510 operator LyXRC::PreviewStatus() const { return val_; }
513 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new);
518 extern LyXRC system_lyxrc;
520 // used by at least frontends/qt4/GuiPref.cpp
521 const long maxlastfiles = 20;