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,
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_POPUP_FONT_ENCODING,
94 RC_PREVIEW_HASHED_LABELS,
95 RC_PREVIEW_SCALE_FACTOR,
96 RC_PRINTCOLLCOPIESFLAG,
100 RC_PRINTEXSTRAOPTIONS,
101 RC_PRINTFILEEXTENSION,
102 RC_PRINTLANDSCAPEFLAG,
104 RC_PRINTPAGERANGEFLAG,
105 RC_PRINTPAPERDIMENSIONFLAG,
108 RC_PRINTSPOOL_COMMAND,
109 RC_PRINTSPOOL_PRINTERPREFIX,
112 RC_PRINT_ADAPTOUTPUT,
116 RC_SCREEN_FONT_ENCODING,
117 RC_SCREEN_FONT_ROMAN,
118 RC_SCREEN_FONT_ROMAN_FOUNDRY,
120 RC_SCREEN_FONT_SANS_FOUNDRY,
121 RC_SCREEN_FONT_SCALABLE,
122 RC_SCREEN_FONT_SIZES,
123 RC_SCREEN_FONT_TYPEWRITER,
124 RC_SCREEN_FONT_TYPEWRITER_FOUNDRY,
125 RC_SCREEN_GEOMETRY_HEIGHT,
126 RC_SCREEN_GEOMETRY_WIDTH,
127 RC_SCREEN_GEOMETRY_XYSAVED,
135 RC_TEX_ALLOWS_SPACES,
136 RC_TEX_EXPECTS_WINDOWS_PATHS,
142 RC_USE_CONVERTER_CACHE,
147 RC_VIEWDVI_PAPEROPTION,
157 int read(support::FileName const & filename);
159 int read(std::istream &);
165 void write(support::FileName const & filename,
166 bool ignore_system_lyxrc) const;
168 void write(std::ostream & os,
169 bool ignore_system_lyxrc) const;
172 // FIXME unused (was used for xforms. Do we still need this?)
173 //static docstring const getDescription(LyXRCTags);
175 std::string bind_file;
181 std::string print_command;
183 std::string print_evenpage_flag;
185 std::string print_oddpage_flag;
187 std::string print_pagerange_flag;
189 std::string print_copies_flag;
191 std::string print_collcopies_flag;
193 std::string print_reverse_flag;
195 std::string print_landscape_flag;
197 std::string print_to_printer;
199 bool print_adapt_output;
201 std::string print_to_file;
203 std::string print_file_extension;
205 std::string print_extra_options;
207 std::string print_spool_command;
209 std::string print_spool_printerprefix;
211 std::string print_paper_flag;
213 std::string print_paper_dimension_flag;
215 std::string custom_export_command;
217 std::string custom_export_format;
218 /// option for telling the dvi viewer about the paper size
219 std::string view_dvi_paper_option;
220 /// default paper size for local xdvi/dvips/ghostview/whatever
221 PAPER_SIZE default_papersize;
222 /// command to run chktex incl. options
223 std::string chktex_command;
224 /// command to run bibtex incl. options
225 std::string bibtex_command;
226 /// command to run makeindex incl. options or other index programs
227 std::string index_command;
229 std::string document_path;
231 std::string template_path;
233 std::string tempdir_path;
235 bool auto_region_delete;
236 /// flag telling whether lastfiles should be checked for existance
237 bool auto_reset_options;
239 bool check_lastfiles;
240 /// maximal number of lastfiles
241 unsigned int num_lastfiles;
242 /// whether or not go to saved position when opening a file
243 bool use_lastfilepos;
244 /// load files from last session automatically
246 /// shall a backup file be created
248 /// A directory for storing backup files
249 std::string backupdir_path;
250 /// Width of MainWindow. if 0, value from last session will be used
252 /// Height of MainWindow, if 0, value from last session will be used
254 /// Whether or not save/restore windows position as session info
255 bool geometry_xysaved;
256 /// Zoom factor for screen fonts
258 /// Screen font sizes in points for each font size
259 std::string font_sizes[10];
260 /// Allow the use of scalable fonts? Default is yes.
261 bool use_scalable_fonts;
267 std::string roman_font_name;
269 std::string sans_font_name;
271 std::string typewriter_font_name;
273 std::string roman_font_foundry;
275 std::string sans_font_foundry;
277 std::string typewriter_font_foundry;
279 std::string popup_bold_font;
281 std::string popup_normal_font;
283 std::string font_norm;
304 FontEncoding font_norm_type;
306 void set_font_norm_type();
308 std::string popup_font_encoding;
310 unsigned int autosave;
312 std::string ascii_roff_command;
314 unsigned int ascii_linelen;
315 /// use library instead of process
318 std::string isp_command;
319 /// Accept compound words in spellchecker?
320 bool isp_accept_compound;
321 /// Pass input encoding switch to ispell?
322 bool isp_use_input_encoding;
323 /// Use alternate language?
324 bool isp_use_alt_lang;
325 /// Use personal dictionary?
326 bool isp_use_pers_dict;
327 /// Use escape chars?
328 bool isp_use_esc_chars;
329 /// Alternate language for ispell
330 std::string isp_alt_lang;
331 /// Alternate personal dictionary file for ispell
332 std::string isp_pers_dict;
333 /// Escape characters
334 std::string isp_esc_chars;
338 std::string primary_kbmap;
340 std::string secondary_kbmap;
342 std::string lyxpipes;
344 std::string date_insert_format;
346 std::string language_package;
348 bool language_auto_begin;
350 bool language_auto_end;
352 std::string language_command_begin;
354 std::string language_command_end;
356 std::string language_command_local;
358 bool language_global_options;
360 bool language_use_babel;
366 bool mark_foreign_language;
368 std::string default_language;
370 bool cursor_follows_scrollbar;
372 bool dialogs_iconify_with_main;
374 int label_init_length;
376 graphics::DisplayType display_graphics;
386 PreviewStatus preview;
388 bool preview_hashed_labels;
390 std::string preview_scale_factor;
392 std::string user_name;
394 std::string user_email;
395 /// True if the TeX engine cannot handle posix paths
396 bool windows_style_tex_paths;
397 /// True if the TeX engine can handle file names containing spaces
398 bool tex_allows_spaces;
399 /** Prepend paths to the PATH environment variable.
400 * The string is input, stored and output in native format.
402 std::string path_prefix;
403 /// Use the cache for file converters?
404 bool use_converter_cache;
405 /// The maximum age of cache files in seconds
406 unsigned int converter_cache_maxage;
410 /** \c LyXRC_PreviewStatus is a wrapper for LyXRC::PreviewStatus.
411 * It can be forward-declared and passed as a function argument without
412 * having to expose lyxrc.h.
414 class LyXRC_PreviewStatus {
415 LyXRC::PreviewStatus val_;
417 LyXRC_PreviewStatus(LyXRC::PreviewStatus val) : val_(val) {}
418 operator LyXRC::PreviewStatus() const{ return val_; }
425 extern LyXRC system_lyxrc;