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.
22 #include "graphics/GraphicsTypes.h"
30 namespace support { class FileName; }
34 /// This contains the runtime configuration of LyX
35 class LyXRC //: public noncopyable
36 // after 1.1.6 I will use a LyXRCStruct here and then this can be made
37 // noncopyable again. For now I want to minimise changes. ARRae 20001010
41 RC_ACCEPT_COMPOUND = 1,
43 RC_PLAINTEXT_ROFF_COMMAND,
55 RC_CONVERTER_CACHE_MAXAGE,
57 RC_CURSOR_FOLLOWS_SCROLLBAR,
58 RC_CUSTOM_EXPORT_COMMAND,
59 RC_CUSTOM_EXPORT_FORMAT,
60 RC_DATE_INSERT_FORMAT,
63 RC_DIALOGS_ICONIFY_WITH_MAIN,
75 RC_LANGUAGE_AUTO_BEGIN,
77 RC_LANGUAGE_COMMAND_BEGIN,
78 RC_LANGUAGE_COMMAND_END,
79 RC_LANGUAGE_COMMAND_LOCAL,
80 RC_LANGUAGE_GLOBAL_OPTIONS,
82 RC_LANGUAGE_USE_BABEL,
86 RC_MARK_FOREIGN_LANGUAGE,
91 RC_PREVIEW_HASHED_LABELS,
92 RC_PREVIEW_SCALE_FACTOR,
93 RC_PRINTCOLLCOPIESFLAG,
97 RC_PRINTEXSTRAOPTIONS,
98 RC_PRINTFILEEXTENSION,
99 RC_PRINTLANDSCAPEFLAG,
101 RC_PRINTPAGERANGEFLAG,
102 RC_PRINTPAPERDIMENSIONFLAG,
105 RC_PRINTSPOOL_COMMAND,
106 RC_PRINTSPOOL_PRINTERPREFIX,
109 RC_PRINT_ADAPTOUTPUT,
113 RC_SCREEN_FONT_ENCODING,
114 RC_SCREEN_FONT_ROMAN,
115 RC_SCREEN_FONT_ROMAN_FOUNDRY,
117 RC_SCREEN_FONT_SANS_FOUNDRY,
118 RC_SCREEN_FONT_SCALABLE,
119 RC_SCREEN_FONT_SIZES,
120 RC_SCREEN_FONT_TYPEWRITER,
121 RC_SCREEN_FONT_TYPEWRITER_FOUNDRY,
122 RC_SCREEN_GEOMETRY_HEIGHT,
123 RC_SCREEN_GEOMETRY_WIDTH,
124 RC_SCREEN_GEOMETRY_XYSAVED,
132 RC_TEX_ALLOWS_SPACES,
133 RC_TEX_EXPECTS_WINDOWS_PATHS,
139 RC_USE_CONVERTER_CACHE,
144 RC_VIEWDVI_PAPEROPTION,
154 int read(support::FileName const & filename);
156 int read(std::istream &);
162 void write(support::FileName const & filename,
163 bool ignore_system_lyxrc) const;
165 void write(std::ostream & os,
166 bool ignore_system_lyxrc) const;
169 // FIXME unused (was used for xforms. Do we still need this?)
170 //static docstring const getDescription(LyXRCTags);
172 std::string bind_file;
178 std::string print_command;
180 std::string print_evenpage_flag;
182 std::string print_oddpage_flag;
184 std::string print_pagerange_flag;
186 std::string print_copies_flag;
188 std::string print_collcopies_flag;
190 std::string print_reverse_flag;
192 std::string print_landscape_flag;
194 std::string print_to_printer;
196 bool print_adapt_output;
198 std::string print_to_file;
200 std::string print_file_extension;
202 std::string print_extra_options;
204 std::string print_spool_command;
206 std::string print_spool_printerprefix;
208 std::string print_paper_flag;
210 std::string print_paper_dimension_flag;
212 std::string custom_export_command;
214 std::string custom_export_format;
215 /// option for telling the dvi viewer about the paper size
216 std::string view_dvi_paper_option;
217 /// default paper size for local xdvi/dvips/ghostview/whatever
218 PAPER_SIZE default_papersize;
219 /// command to run chktex incl. options
220 std::string chktex_command;
221 /// command to run bibtex incl. options
222 std::string bibtex_command;
223 /// command to run makeindex incl. options or other index programs
224 std::string index_command;
226 std::string document_path;
228 std::string template_path;
230 std::string tempdir_path;
232 bool auto_region_delete;
233 /// flag telling whether lastfiles should be checked for existance
234 bool auto_reset_options;
236 bool check_lastfiles;
237 /// maximal number of lastfiles
238 unsigned int num_lastfiles;
239 /// whether or not go to saved position when opening a file
240 bool use_lastfilepos;
241 /// load files from last session automatically
243 /// shall a backup file be created
245 /// A directory for storing backup files
246 std::string backupdir_path;
247 /// Width of MainWindow. if 0, value from last session will be used
249 /// Height of MainWindow, if 0, value from last session will be used
251 /// Whether or not save/restore windows position as session info
252 bool geometry_xysaved;
253 /// Zoom factor for screen fonts
255 /// Screen font sizes in points for each font size
256 std::string font_sizes[10];
257 /// Allow the use of scalable fonts? Default is yes.
258 bool use_scalable_fonts;
264 std::string roman_font_name;
266 std::string sans_font_name;
268 std::string typewriter_font_name;
270 std::string roman_font_foundry;
272 std::string sans_font_foundry;
274 std::string typewriter_font_foundry;
276 std::string font_norm;
297 FontEncoding font_norm_type;
299 void set_font_norm_type();
301 unsigned int autosave;
303 std::string plaintext_roff_command;
305 unsigned int plaintext_linelen;
306 /// use library instead of process
309 std::string isp_command;
310 /// Accept compound words in spellchecker?
311 bool isp_accept_compound;
312 /// Pass input encoding switch to ispell?
313 bool isp_use_input_encoding;
314 /// Use alternate language?
315 bool isp_use_alt_lang;
316 /// Use personal dictionary?
317 bool isp_use_pers_dict;
318 /// Use escape chars?
319 bool isp_use_esc_chars;
320 /// Alternate language for ispell
321 std::string isp_alt_lang;
322 /// Alternate personal dictionary file for ispell
323 std::string isp_pers_dict;
324 /// Escape characters
325 std::string isp_esc_chars;
329 std::string primary_kbmap;
331 std::string secondary_kbmap;
333 std::string lyxpipes;
335 std::string date_insert_format;
337 std::string language_package;
339 bool language_auto_begin;
341 bool language_auto_end;
343 std::string language_command_begin;
345 std::string language_command_end;
347 std::string language_command_local;
349 bool language_global_options;
351 bool language_use_babel;
357 bool mark_foreign_language;
359 std::string default_language;
361 bool cursor_follows_scrollbar;
363 bool dialogs_iconify_with_main;
365 int label_init_length;
367 graphics::DisplayType display_graphics;
377 PreviewStatus preview;
379 bool preview_hashed_labels;
381 std::string preview_scale_factor;
383 std::string user_name;
385 std::string user_email;
386 /// True if the TeX engine cannot handle posix paths
387 bool windows_style_tex_paths;
388 /// True if the TeX engine can handle file names containing spaces
389 bool tex_allows_spaces;
390 /** Prepend paths to the PATH environment variable.
391 * The string is input, stored and output in native format.
393 std::string path_prefix;
394 /// Use the cache for file converters?
395 bool use_converter_cache;
396 /// The maximum age of cache files in seconds
397 unsigned int converter_cache_maxage;
401 /** \c LyXRC_PreviewStatus is a wrapper for LyXRC::PreviewStatus.
402 * It can be forward-declared and passed as a function argument without
403 * having to expose lyxrc.h.
405 class LyXRC_PreviewStatus {
406 LyXRC::PreviewStatus val_;
408 LyXRC_PreviewStatus(LyXRC::PreviewStatus val) : val_(val) {}
409 operator LyXRC::PreviewStatus() const{ return val_; }
416 extern LyXRC system_lyxrc;