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"
29 /// This contains the runtime configuration of LyX
30 class LyXRC //: public noncopyable {
31 // after 1.1.6 I will use a LyXRCStruct here and then this can be made
32 // noncopyable again. For now I want to minimise changes. ARRae 20001010
36 RC_ACCEPT_COMPOUND = 1,
51 RC_CURSOR_FOLLOWS_SCROLLBAR,
52 RC_CUSTOM_EXPORT_COMMAND,
53 RC_CUSTOM_EXPORT_FORMAT,
54 RC_DATE_INSERT_FORMAT,
57 RC_DIALOGS_ICONIFY_WITH_MAIN,
69 RC_LANGUAGE_AUTO_BEGIN,
71 RC_LANGUAGE_COMMAND_BEGIN,
72 RC_LANGUAGE_COMMAND_END,
73 RC_LANGUAGE_COMMAND_LOCAL,
74 RC_LANGUAGE_GLOBAL_OPTIONS,
76 RC_LANGUAGE_USE_BABEL,
80 RC_MARK_FOREIGN_LANGUAGE,
85 RC_POPUP_FONT_ENCODING,
88 RC_PREVIEW_HASHED_LABELS,
89 RC_PREVIEW_SCALE_FACTOR,
90 RC_PRINTCOLLCOPIESFLAG,
94 RC_PRINTEXSTRAOPTIONS,
95 RC_PRINTFILEEXTENSION,
96 RC_PRINTLANDSCAPEFLAG,
98 RC_PRINTPAGERANGEFLAG,
99 RC_PRINTPAPERDIMENSIONFLAG,
102 RC_PRINTSPOOL_COMMAND,
103 RC_PRINTSPOOL_PRINTERPREFIX,
106 RC_PRINT_ADAPTOUTPUT,
110 RC_SCREEN_FONT_ENCODING,
111 RC_SCREEN_FONT_ROMAN,
112 RC_SCREEN_FONT_ROMAN_FOUNDRY,
114 RC_SCREEN_FONT_SANS_FOUNDRY,
115 RC_SCREEN_FONT_SCALABLE,
116 RC_SCREEN_FONT_SIZES,
117 RC_SCREEN_FONT_TYPEWRITER,
118 RC_SCREEN_FONT_TYPEWRITER_FOUNDRY,
119 RC_SCREEN_GEOMETRY_HEIGHT,
120 RC_SCREEN_GEOMETRY_WIDTH,
121 RC_SCREEN_GEOMETRY_XYSAVED,
129 RC_TEX_ALLOWS_SPACES,
130 RC_TEX_EXPECTS_WINDOWS_PATHS,
140 RC_VIEWDVI_PAPEROPTION,
150 int read(std::string const & filename);
152 int read(std::istream &);
158 void write(std::string const & filename,
159 bool ignore_system_lyxrc) const;
161 void write(std::ostream & os,
162 bool ignore_system_lyxrc) const;
166 static std::string const getDescription(LyXRCTags);
168 std::string bind_file;
174 std::string print_command;
176 std::string print_evenpage_flag;
178 std::string print_oddpage_flag;
180 std::string print_pagerange_flag;
182 std::string print_copies_flag;
184 std::string print_collcopies_flag;
186 std::string print_reverse_flag;
188 std::string print_landscape_flag;
190 std::string print_to_printer;
192 bool print_adapt_output;
194 std::string print_to_file;
196 std::string print_file_extension;
198 std::string print_extra_options;
200 std::string print_spool_command;
202 std::string print_spool_printerprefix;
204 std::string print_paper_flag;
206 std::string print_paper_dimension_flag;
208 std::string custom_export_command;
210 std::string custom_export_format;
211 /// option for telling the dvi viewer about the paper size
212 std::string view_dvi_paper_option;
213 /// default paper size for local xdvi/dvips/ghostview/whatever
214 PAPER_SIZE default_papersize;
215 /// command to run chktex incl. options
216 std::string chktex_command;
217 /// command to run bibtex incl. options
218 std::string bibtex_command;
219 /// command to run makeindex incl. options or other index programs
220 std::string index_command;
222 std::string document_path;
224 std::string template_path;
226 std::string tempdir_path;
228 bool auto_region_delete;
229 /// flag telling whether lastfiles should be checked for existance
230 bool auto_reset_options;
232 bool check_lastfiles;
233 /// maximal number of lastfiles
234 unsigned int num_lastfiles;
235 /// whether or not go to saved position when opening a file
236 bool use_lastfilepos;
237 /// load files from last session automatically
239 /// shall a backup file be created
241 /// A directory for storing backup files
242 std::string backupdir_path;
243 /// Width of MainWindow. if 0, value from last session will be used
245 /// Height of MainWindow, if 0, value from last session will be used
247 /// Whether or not save/restore windows position as session info
248 bool geometry_xysaved;
249 /// Zoom factor for screen fonts
251 /// Screen font sizes in points for each font size
252 std::string font_sizes[10];
253 /// Allow the use of scalable fonts? Default is yes.
254 bool use_scalable_fonts;
260 std::string roman_font_name;
262 std::string sans_font_name;
264 std::string typewriter_font_name;
266 std::string roman_font_foundry;
268 std::string sans_font_foundry;
270 std::string typewriter_font_foundry;
272 std::string popup_bold_font;
274 std::string popup_normal_font;
276 std::string font_norm;
297 FontEncoding font_norm_type;
299 void set_font_norm_type();
301 std::string popup_font_encoding;
303 unsigned int autosave;
305 std::string ascii_roff_command;
307 unsigned int ascii_linelen;
308 /// use library instead of process
311 std::string isp_command;
312 /// Accept compound words in spellchecker?
313 bool isp_accept_compound;
314 /// Pass input encoding switch to ispell?
315 bool isp_use_input_encoding;
316 /// Use alternate language?
317 bool isp_use_alt_lang;
318 /// Use personal dictionary?
319 bool isp_use_pers_dict;
320 /// Use escape chars?
321 bool isp_use_esc_chars;
322 /// Alternate language for ispell
323 std::string isp_alt_lang;
324 /// Alternate personal dictionary file for ispell
325 std::string isp_pers_dict;
326 /// Escape characters
327 std::string isp_esc_chars;
331 std::string primary_kbmap;
333 std::string secondary_kbmap;
335 std::string lyxpipes;
337 std::string date_insert_format;
339 std::string language_package;
341 bool language_auto_begin;
343 bool language_auto_end;
345 std::string language_command_begin;
347 std::string language_command_end;
349 std::string language_command_local;
351 bool language_global_options;
353 bool language_use_babel;
359 bool mark_foreign_language;
361 std::string default_language;
363 bool cursor_follows_scrollbar;
365 bool dialogs_iconify_with_main;
367 int label_init_length;
369 lyx::graphics::DisplayType display_graphics;
379 PreviewStatus preview;
381 bool preview_hashed_labels;
383 std::string preview_scale_factor;
385 std::string user_name;
387 std::string user_email;
388 /// True if the TeX engine cannot handle posix paths
389 bool windows_style_tex_paths;
390 /// True if the TeX engine can handle file names containing spaces
391 bool tex_allows_spaces;
392 /** Prepend paths to the PATH environment variable.
393 * The string is input, stored and output in native format.
395 std::string path_prefix;
399 /** \c LyXRC_PreviewStatus is a wrapper for LyXRC::PreviewStatus.
400 * It can be forward-declared and passed as a function argument without
401 * having to expose lyxrc.h.
403 class LyXRC_PreviewStatus {
404 LyXRC::PreviewStatus val_;
406 LyXRC_PreviewStatus(LyXRC::PreviewStatus val) : val_(val) {}
407 operator LyXRC::PreviewStatus() const{ return val_; }
414 extern LyXRC system_lyxrc;