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"
30 namespace support { class FileName; }
34 /// This contains the runtime configuration of LyX
39 RC_ACCEPT_COMPOUND = 1,
41 RC_PLAINTEXT_ROFF_COMMAND,
52 RC_COMPLETION_CURSOR_TEXT,
53 RC_COMPLETION_INLINE_DELAY,
54 RC_COMPLETION_INLINE_MATH,
55 RC_COMPLETION_INLINE_TEXT,
56 RC_COMPLETION_INLINE_DOTS,
57 RC_COMPLETION_POPUP_DELAY,
58 RC_COMPLETION_POPUP_MATH,
59 RC_COMPLETION_POPUP_TEXT,
60 RC_COMPLETION_POPUP_AFTER_COMPLETE,
62 RC_CONVERTER_CACHE_MAXAGE,
64 RC_CURSOR_FOLLOWS_SCROLLBAR,
65 RC_CUSTOM_EXPORT_COMMAND,
66 RC_CUSTOM_EXPORT_FORMAT,
67 RC_DATE_INSERT_FORMAT,
71 RC_DIALOGS_ICONIFY_WITH_MAIN,
79 RC_FULL_SCREEN_SCROLLBAR,
80 RC_FULL_SCREEN_TABBAR,
81 RC_FULL_SCREEN_TOOLBARS,
91 RC_LANGUAGE_AUTO_BEGIN,
93 RC_LANGUAGE_COMMAND_BEGIN,
94 RC_LANGUAGE_COMMAND_END,
95 RC_LANGUAGE_COMMAND_LOCAL,
96 RC_LANGUAGE_GLOBAL_OPTIONS,
98 RC_LANGUAGE_USE_BABEL,
102 RC_MARK_FOREIGN_LANGUAGE,
103 RC_MOUSE_WHEEL_SPEED,
108 RC_PREVIEW_HASHED_LABELS,
109 RC_PREVIEW_SCALE_FACTOR,
110 RC_PRINTCOLLCOPIESFLAG,
113 RC_PRINTEVENPAGEFLAG,
114 RC_PRINTEXSTRAOPTIONS,
115 RC_PRINTFILEEXTENSION,
116 RC_PRINTLANDSCAPEFLAG,
118 RC_PRINTPAGERANGEFLAG,
119 RC_PRINTPAPERDIMENSIONFLAG,
122 RC_PRINTSPOOL_COMMAND,
123 RC_PRINTSPOOL_PRINTERPREFIX,
126 RC_PRINT_ADAPTOUTPUT,
130 RC_SCREEN_FONT_ROMAN,
131 RC_SCREEN_FONT_ROMAN_FOUNDRY,
133 RC_SCREEN_FONT_SANS_FOUNDRY,
134 RC_SCREEN_FONT_SCALABLE,
135 RC_SCREEN_FONT_SIZES,
136 RC_SCREEN_FONT_TYPEWRITER,
137 RC_SCREEN_FONT_TYPEWRITER_FOUNDRY,
142 RC_OPEN_BUFFERS_IN_TABS,
147 RC_TEX_ALLOWS_SPACES,
148 RC_TEX_EXPECTS_WINDOWS_PATHS,
155 RC_USE_BUNDLED_FORMAT,
156 RC_USE_CONVERTER_CACHE,
163 RC_VIEWDVI_PAPEROPTION,
174 int read(support::FileName const & filename);
176 int read(std::istream &);
182 void write(support::FileName const & filename,
183 bool ignore_system_lyxrc) const;
184 /// write rc. If a specific tag is given, only output that one.
185 void write(std::ostream & os,
186 bool ignore_system_lyxrc,
187 std::string const & tag = std::string()) const;
190 // FIXME unused (was used for xforms. Do we still need this?)
191 //static docstring const getDescription(LyXRCTags);
193 std::string bind_file;
195 std::string def_file;
201 std::string print_command;
203 std::string print_evenpage_flag;
205 std::string print_oddpage_flag;
207 std::string print_pagerange_flag;
209 std::string print_copies_flag;
211 std::string print_collcopies_flag;
213 std::string print_reverse_flag;
215 std::string print_landscape_flag;
217 std::string print_to_printer;
219 bool print_adapt_output;
221 std::string print_to_file;
223 std::string print_file_extension;
225 std::string print_extra_options;
227 std::string print_spool_command;
229 std::string print_spool_printerprefix;
231 std::string print_paper_flag;
233 std::string print_paper_dimension_flag;
235 std::string custom_export_command;
237 std::string custom_export_format;
238 /// option for telling the dvi viewer about the paper size
239 std::string view_dvi_paper_option;
240 /// default paper size for local xdvi/dvips/ghostview/whatever
241 PAPER_SIZE default_papersize;
242 /// command to run chktex incl. options
243 std::string chktex_command;
244 /// command to run bibtex incl. options
245 std::string bibtex_command;
246 /// command to run makeindex incl. options or other index programs
247 std::string index_command;
249 std::string document_path;
251 std::string example_path;
253 std::string template_path;
255 std::string tempdir_path;
257 bool auto_region_delete;
258 /// flag telling whether lastfiles should be checked for existance
259 bool auto_reset_options;
261 bool check_lastfiles;
262 /// maximal number of lastfiles
263 unsigned int num_lastfiles;
264 /// whether or not go to saved position when opening a file
265 bool use_lastfilepos;
266 /// load files from last session automatically
268 /// shall a backup file be created
270 /// A directory for storing backup files
271 std::string backupdir_path;
272 /// Whether or not save/restore session information
273 /// like windows position and geometry.
274 bool allow_geometry_session;
275 /// Scrolling speed of the mouse wheel
276 double mouse_wheel_speed;
277 /// Zoom factor for screen fonts
279 /// Screen font sizes in points for each font size
280 std::string font_sizes[10];
281 /// Allow the use of scalable fonts? Default is yes.
282 bool use_scalable_fonts;
288 std::string roman_font_name;
290 std::string sans_font_name;
292 std::string typewriter_font_name;
294 std::string roman_font_foundry;
296 std::string sans_font_foundry;
298 std::string typewriter_font_foundry;
300 unsigned int autosave;
302 std::string plaintext_roff_command;
304 unsigned int plaintext_linelen;
305 /// use library instead of process
308 std::string isp_command;
309 /// Accept compound words in spellchecker?
310 bool isp_accept_compound;
311 /// Pass input encoding switch to ispell?
312 bool isp_use_input_encoding;
313 /// Use alternate language?
314 bool isp_use_alt_lang;
315 /// Use personal dictionary?
316 bool isp_use_pers_dict;
319 /// Use pixmap cache?
320 bool use_pixmap_cache;
321 /// Use escape chars?
322 bool isp_use_esc_chars;
323 /// Alternate language for ispell
324 std::string isp_alt_lang;
325 /// Alternate personal dictionary file for ispell
326 std::string isp_pers_dict;
327 /// Escape characters
328 std::string isp_esc_chars;
332 std::string primary_kbmap;
334 std::string secondary_kbmap;
336 std::string lyxpipes;
338 std::string date_insert_format;
340 std::string language_package;
342 bool language_auto_begin;
344 bool language_auto_end;
346 std::string language_command_begin;
348 std::string language_command_end;
350 std::string language_command_local;
352 bool language_global_options;
354 bool language_use_babel;
357 /// bidi cursor movement: true = visual, false = logical
362 bool mark_foreign_language;
364 std::string default_language;
366 bool cursor_follows_scrollbar;
368 enum MacroEditStyle {
369 MACRO_EDIT_INLINE_BOX = 0,
374 MacroEditStyle macro_edit_style;
376 bool dialogs_iconify_with_main;
378 int label_init_length;
380 ///graphics::DisplayType
381 int display_graphics;
391 PreviewStatus preview;
393 bool preview_hashed_labels;
395 std::string preview_scale_factor;
397 std::string user_name;
399 std::string user_email;
400 /// True if the TeX engine cannot handle posix paths
401 bool windows_style_tex_paths;
402 /// True if the TeX engine can handle file names containing spaces
403 bool tex_allows_spaces;
404 /** Prepend paths to the PATH environment variable.
405 * The string is input, stored and output in native format.
407 std::string path_prefix;
408 /// Use the cache for file converters?
409 bool use_converter_cache;
410 /// The maximum age of cache files in seconds
411 unsigned int converter_cache_maxage;
412 /// Sort layouts alphabetically
414 /// Group layout by their category
416 /// Toggle toolbars in fullscreen mode?
417 bool full_screen_toolbars;
418 /// Toggle scrollbar in fullscreen mode?
419 bool full_screen_scrollbar;
420 /// Toggle tabbar in fullscreen mode?
421 bool full_screen_tabbar;
422 /// Limit the text width?
423 bool full_screen_limit;
424 /// Width of limited screen (in pixels) in fullscreen mode
425 int full_screen_width;
427 bool completion_cursor_text;
429 double completion_inline_delay;
431 bool completion_inline_math;
433 bool completion_inline_text;
435 int completion_inline_dots;
437 double completion_popup_delay;
439 bool completion_popup_math;
441 bool completion_popup_text;
443 bool completion_popup_after_complete;
445 bool open_buffers_in_tabs;
447 bool use_bundled_format;
451 /** \c LyXRC_PreviewStatus is a wrapper for LyXRC::PreviewStatus.
452 * It can be forward-declared and passed as a function argument without
453 * having to expose LyXRC.h.
455 class LyXRC_PreviewStatus {
456 LyXRC::PreviewStatus val_;
458 LyXRC_PreviewStatus(LyXRC::PreviewStatus val) : val_(val) {}
459 operator LyXRC::PreviewStatus() const { return val_; }
466 extern LyXRC system_lyxrc;