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,
55 RC_DATE_INSERT_FORMAT,
58 RC_DIALOGS_ICONIFY_WITH_MAIN,
70 RC_LANGUAGE_AUTO_BEGIN,
72 RC_LANGUAGE_COMMAND_BEGIN,
73 RC_LANGUAGE_COMMAND_END,
74 RC_LANGUAGE_COMMAND_LOCAL,
75 RC_LANGUAGE_GLOBAL_OPTIONS,
77 RC_LANGUAGE_USE_BABEL,
81 RC_MARK_FOREIGN_LANGUAGE,
86 RC_POPUP_FONT_ENCODING,
89 RC_PREVIEW_HASHED_LABELS,
90 RC_PREVIEW_SCALE_FACTOR,
91 RC_PRINTCOLLCOPIESFLAG,
95 RC_PRINTEXSTRAOPTIONS,
96 RC_PRINTFILEEXTENSION,
97 RC_PRINTLANDSCAPEFLAG,
99 RC_PRINTPAGERANGEFLAG,
100 RC_PRINTPAPERDIMENSIONFLAG,
103 RC_PRINTSPOOL_COMMAND,
104 RC_PRINTSPOOL_PRINTERPREFIX,
107 RC_PRINT_ADAPTOUTPUT,
111 RC_SCREEN_FONT_ENCODING,
112 RC_SCREEN_FONT_ROMAN,
113 RC_SCREEN_FONT_ROMAN_FOUNDRY,
115 RC_SCREEN_FONT_SANS_FOUNDRY,
116 RC_SCREEN_FONT_SCALABLE,
117 RC_SCREEN_FONT_SIZES,
118 RC_SCREEN_FONT_TYPEWRITER,
119 RC_SCREEN_FONT_TYPEWRITER_FOUNDRY,
120 RC_SCREEN_GEOMETRY_HEIGHT,
121 RC_SCREEN_GEOMETRY_WIDTH,
122 RC_SCREEN_GEOMETRY_XYSAVED,
130 RC_TEX_ALLOWS_SPACES,
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 /// parameter for button_4 and button_5 (scrollwheel)
253 /// Only used by the xforms frontend
254 unsigned int wheel_jump;
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 popup_bold_font;
278 std::string popup_normal_font;
280 std::string font_norm;
301 FontEncoding font_norm_type;
303 void set_font_norm_type();
305 std::string popup_font_encoding;
307 unsigned int autosave;
309 std::string ascii_roff_command;
311 unsigned int ascii_linelen;
312 /// use library instead of process
315 std::string isp_command;
316 /// Accept compound words in spellchecker?
317 bool isp_accept_compound;
318 /// Pass input encoding switch to ispell?
319 bool isp_use_input_encoding;
320 /// Use alternate language?
321 bool isp_use_alt_lang;
322 /// Use personal dictionary?
323 bool isp_use_pers_dict;
324 /// Use escape chars?
325 bool isp_use_esc_chars;
326 /// Alternate language for ispell
327 std::string isp_alt_lang;
328 /// Alternate personal dictionary file for ispell
329 std::string isp_pers_dict;
330 /// Escape characters
331 std::string isp_esc_chars;
335 std::string primary_kbmap;
337 std::string secondary_kbmap;
339 std::string lyxpipes;
341 std::string date_insert_format;
343 std::string language_package;
345 bool language_auto_begin;
347 bool language_auto_end;
349 std::string language_command_begin;
351 std::string language_command_end;
353 std::string language_command_local;
355 bool language_global_options;
357 bool language_use_babel;
363 bool mark_foreign_language;
365 std::string default_language;
367 bool cursor_follows_scrollbar;
369 bool dialogs_iconify_with_main;
371 int label_init_length;
373 lyx::graphics::DisplayType display_graphics;
383 PreviewStatus preview;
385 bool preview_hashed_labels;
387 std::string preview_scale_factor;
389 std::string user_name;
391 std::string user_email;
393 bool cygwin_path_fix;
394 /// True if the TeX engine can handle file names containing spaces
395 bool tex_allows_spaces;
396 /** Prepend paths to the PATH environment variable.
397 * The string is input, stored and output in native format.
399 std::string path_prefix;
403 /** \c LyXRC_PreviewStatus is a wrapper for LyXRC::PreviewStatus.
404 * It can be forward-declared and passed as a function argument without
405 * having to expose lyxrc.h.
407 class LyXRC_PreviewStatus {
408 LyXRC::PreviewStatus val_;
410 LyXRC_PreviewStatus(LyXRC::PreviewStatus val) : val_(val) {}
411 operator LyXRC::PreviewStatus() const{ return val_; }
418 extern LyXRC system_lyxrc;