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,
151 int read(std::string const & filename);
153 int read(std::istream &);
159 void write(std::string const & filename,
160 bool ignore_system_lyxrc) const;
162 void write(std::ostream & os,
163 bool ignore_system_lyxrc) const;
167 static std::string const getDescription(LyXRCTags);
169 std::string bind_file;
175 std::string print_command;
177 std::string print_evenpage_flag;
179 std::string print_oddpage_flag;
181 std::string print_pagerange_flag;
183 std::string print_copies_flag;
185 std::string print_collcopies_flag;
187 std::string print_reverse_flag;
189 std::string print_landscape_flag;
191 std::string print_to_printer;
193 bool print_adapt_output;
195 std::string print_to_file;
197 std::string print_file_extension;
199 std::string print_extra_options;
201 std::string print_spool_command;
203 std::string print_spool_printerprefix;
205 std::string print_paper_flag;
207 std::string print_paper_dimension_flag;
209 std::string custom_export_command;
211 std::string custom_export_format;
212 /// option for telling the dvi viewer about the paper size
213 std::string view_dvi_paper_option;
214 /// default paper size for local xdvi/dvips/ghostview/whatever
215 PAPER_SIZE default_papersize;
216 /// command to run chktex incl. options
217 std::string chktex_command;
218 /// command to run bibtex incl. options
219 std::string bibtex_command;
220 /// command to run makeindex incl. options or other index programs
221 std::string index_command;
223 std::string document_path;
225 std::string template_path;
227 std::string tempdir_path;
229 bool auto_region_delete;
230 /// flag telling whether lastfiles should be checked for existance
231 bool auto_reset_options;
233 bool check_lastfiles;
234 /// maximal number of lastfiles
235 unsigned int num_lastfiles;
236 /// whether or not go to saved position when opening a file
237 bool use_lastfilepos;
238 /// load files from last session automatically
240 /// shall a backup file be created
242 /// A directory for storing backup files
243 std::string backupdir_path;
244 /// Width of MainWindow. if 0, value from last session will be used
246 /// Height of MainWindow, if 0, value from last session will be used
248 /// Whether or not save/restore windows position as session info
249 bool geometry_xysaved;
250 /// Zoom factor for screen fonts
252 /// Screen font sizes in points for each font size
253 std::string font_sizes[10];
254 /// Allow the use of scalable fonts? Default is yes.
255 bool use_scalable_fonts;
261 std::string roman_font_name;
263 std::string sans_font_name;
265 std::string typewriter_font_name;
267 std::string roman_font_foundry;
269 std::string sans_font_foundry;
271 std::string typewriter_font_foundry;
273 std::string popup_bold_font;
275 std::string popup_normal_font;
277 std::string font_norm;
298 FontEncoding font_norm_type;
300 void set_font_norm_type();
302 std::string popup_font_encoding;
304 unsigned int autosave;
306 std::string ascii_roff_command;
308 unsigned int ascii_linelen;
309 /// use library instead of process
312 std::string isp_command;
313 /// Accept compound words in spellchecker?
314 bool isp_accept_compound;
315 /// Pass input encoding switch to ispell?
316 bool isp_use_input_encoding;
317 /// Use alternate language?
318 bool isp_use_alt_lang;
319 /// Use personal dictionary?
320 bool isp_use_pers_dict;
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;
360 bool mark_foreign_language;
362 std::string default_language;
364 bool cursor_follows_scrollbar;
366 bool dialogs_iconify_with_main;
368 int label_init_length;
370 lyx::graphics::DisplayType display_graphics;
380 PreviewStatus preview;
382 bool preview_hashed_labels;
384 std::string preview_scale_factor;
386 std::string user_name;
388 std::string user_email;
389 /// True if the TeX engine cannot handle posix paths
390 bool windows_style_tex_paths;
391 /// True if the TeX engine can handle file names containing spaces
392 bool tex_allows_spaces;
393 /** Prepend paths to the PATH environment variable.
394 * The string is input, stored and output in native format.
396 std::string path_prefix;
400 /** \c LyXRC_PreviewStatus is a wrapper for LyXRC::PreviewStatus.
401 * It can be forward-declared and passed as a function argument without
402 * having to expose lyxrc.h.
404 class LyXRC_PreviewStatus {
405 LyXRC::PreviewStatus val_;
407 LyXRC_PreviewStatus(LyXRC::PreviewStatus val) : val_(val) {}
408 operator LyXRC::PreviewStatus() const{ return val_; }
415 extern LyXRC system_lyxrc;