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"
32 /// This contains the runtime configuration of LyX
33 class LyXRC //: public noncopyable
34 // after 1.1.6 I will use a LyXRCStruct here and then this can be made
35 // noncopyable again. For now I want to minimise changes. ARRae 20001010
39 RC_ACCEPT_COMPOUND = 1,
54 RC_CURSOR_FOLLOWS_SCROLLBAR,
55 RC_CUSTOM_EXPORT_COMMAND,
56 RC_CUSTOM_EXPORT_FORMAT,
57 RC_DATE_INSERT_FORMAT,
60 RC_DIALOGS_ICONIFY_WITH_MAIN,
72 RC_LANGUAGE_AUTO_BEGIN,
74 RC_LANGUAGE_COMMAND_BEGIN,
75 RC_LANGUAGE_COMMAND_END,
76 RC_LANGUAGE_COMMAND_LOCAL,
77 RC_LANGUAGE_GLOBAL_OPTIONS,
79 RC_LANGUAGE_USE_BABEL,
83 RC_MARK_FOREIGN_LANGUAGE,
88 RC_POPUP_FONT_ENCODING,
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,
143 RC_VIEWDVI_PAPEROPTION,
153 int read(std::string const & filename);
155 int read(std::istream &);
161 void write(std::string const & filename,
162 bool ignore_system_lyxrc) const;
164 void write(std::ostream & os,
165 bool ignore_system_lyxrc) const;
168 // FIXME unused (was used for xforms. Do we still need this?)
169 //static docstring const getDescription(LyXRCTags);
171 std::string bind_file;
177 std::string print_command;
179 std::string print_evenpage_flag;
181 std::string print_oddpage_flag;
183 std::string print_pagerange_flag;
185 std::string print_copies_flag;
187 std::string print_collcopies_flag;
189 std::string print_reverse_flag;
191 std::string print_landscape_flag;
193 std::string print_to_printer;
195 bool print_adapt_output;
197 std::string print_to_file;
199 std::string print_file_extension;
201 std::string print_extra_options;
203 std::string print_spool_command;
205 std::string print_spool_printerprefix;
207 std::string print_paper_flag;
209 std::string print_paper_dimension_flag;
211 std::string custom_export_command;
213 std::string custom_export_format;
214 /// option for telling the dvi viewer about the paper size
215 std::string view_dvi_paper_option;
216 /// default paper size for local xdvi/dvips/ghostview/whatever
217 PAPER_SIZE default_papersize;
218 /// command to run chktex incl. options
219 std::string chktex_command;
220 /// command to run bibtex incl. options
221 std::string bibtex_command;
222 /// command to run makeindex incl. options or other index programs
223 std::string index_command;
225 std::string document_path;
227 std::string template_path;
229 std::string tempdir_path;
231 bool auto_region_delete;
232 /// flag telling whether lastfiles should be checked for existance
233 bool auto_reset_options;
235 bool check_lastfiles;
236 /// maximal number of lastfiles
237 unsigned int num_lastfiles;
238 /// whether or not go to saved position when opening a file
239 bool use_lastfilepos;
240 /// load files from last session automatically
242 /// shall a backup file be created
244 /// A directory for storing backup files
245 std::string backupdir_path;
246 /// Width of MainWindow. if 0, value from last session will be used
248 /// Height of MainWindow, if 0, value from last session will be used
250 /// Whether or not save/restore windows position as session info
251 bool geometry_xysaved;
252 /// Zoom factor for screen fonts
254 /// Screen font sizes in points for each font size
255 std::string font_sizes[10];
256 /// Allow the use of scalable fonts? Default is yes.
257 bool use_scalable_fonts;
263 std::string roman_font_name;
265 std::string sans_font_name;
267 std::string typewriter_font_name;
269 std::string roman_font_foundry;
271 std::string sans_font_foundry;
273 std::string typewriter_font_foundry;
275 std::string popup_bold_font;
277 std::string popup_normal_font;
279 std::string font_norm;
300 FontEncoding font_norm_type;
302 void set_font_norm_type();
304 std::string popup_font_encoding;
306 unsigned int autosave;
308 std::string ascii_roff_command;
310 unsigned int ascii_linelen;
311 /// use library instead of process
314 std::string isp_command;
315 /// Accept compound words in spellchecker?
316 bool isp_accept_compound;
317 /// Pass input encoding switch to ispell?
318 bool isp_use_input_encoding;
319 /// Use alternate language?
320 bool isp_use_alt_lang;
321 /// Use personal dictionary?
322 bool isp_use_pers_dict;
323 /// Use escape chars?
324 bool isp_use_esc_chars;
325 /// Alternate language for ispell
326 std::string isp_alt_lang;
327 /// Alternate personal dictionary file for ispell
328 std::string isp_pers_dict;
329 /// Escape characters
330 std::string isp_esc_chars;
334 std::string primary_kbmap;
336 std::string secondary_kbmap;
338 std::string lyxpipes;
340 std::string date_insert_format;
342 std::string language_package;
344 bool language_auto_begin;
346 bool language_auto_end;
348 std::string language_command_begin;
350 std::string language_command_end;
352 std::string language_command_local;
354 bool language_global_options;
356 bool language_use_babel;
362 bool mark_foreign_language;
364 std::string default_language;
366 bool cursor_follows_scrollbar;
368 bool dialogs_iconify_with_main;
370 int label_init_length;
372 graphics::DisplayType display_graphics;
382 PreviewStatus preview;
384 bool preview_hashed_labels;
386 std::string preview_scale_factor;
388 std::string user_name;
390 std::string user_email;
391 /// True if the TeX engine cannot handle posix paths
392 bool windows_style_tex_paths;
393 /// True if the TeX engine can handle file names containing spaces
394 bool tex_allows_spaces;
395 /** Prepend paths to the PATH environment variable.
396 * The string is input, stored and output in native format.
398 std::string path_prefix;
402 /** \c LyXRC_PreviewStatus is a wrapper for LyXRC::PreviewStatus.
403 * It can be forward-declared and passed as a function argument without
404 * having to expose lyxrc.h.
406 class LyXRC_PreviewStatus {
407 LyXRC::PreviewStatus val_;
409 LyXRC_PreviewStatus(LyXRC::PreviewStatus val) : val_(val) {}
410 operator LyXRC::PreviewStatus() const{ return val_; }
417 extern LyXRC system_lyxrc;