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
41 RC_PRINTPAGERANGEFLAG,
43 RC_PRINTCOLLCOPIESFLAG,
45 RC_PRINTLANDSCAPEFLAG,
49 RC_PRINTFILEEXTENSION,
50 RC_PRINTEXSTRAOPTIONS,
51 RC_PRINTSPOOL_COMMAND,
52 RC_PRINTSPOOL_PRINTERPREFIX,
54 RC_PRINTPAPERDIMENSIONFLAG,
55 RC_CUSTOM_EXPORT_COMMAND,
56 RC_CUSTOM_EXPORT_FORMAT,
62 RC_SCREEN_FONT_TYPEWRITER,
63 RC_SCREEN_FONT_ROMAN_FOUNDRY,
64 RC_SCREEN_FONT_SANS_FOUNDRY,
65 RC_SCREEN_FONT_TYPEWRITER_FOUNDRY,
66 RC_SCREEN_FONT_ENCODING,
69 RC_POPUP_FONT_ENCODING,
90 RC_VIEWDVI_PAPEROPTION,
98 RC_SCREEN_FONT_SCALABLE,
104 RC_CURSOR_FOLLOWS_SCROLLBAR,
105 RC_DIALOGS_ICONIFY_WITH_MAIN,
110 RC_MARK_FOREIGN_LANGUAGE,
112 RC_LANGUAGE_AUTO_BEGIN,
113 RC_LANGUAGE_AUTO_END,
114 RC_LANGUAGE_COMMAND_BEGIN,
115 RC_LANGUAGE_COMMAND_END,
116 RC_LANGUAGE_COMMAND_LOCAL,
117 RC_LANGUAGE_GLOBAL_OPTIONS,
118 RC_LANGUAGE_USE_BABEL,
119 RC_DATE_INSERT_FORMAT,
127 RC_LABEL_INIT_LENGTH,
130 RC_PREVIEW_HASHED_LABELS,
131 RC_PREVIEW_SCALE_FACTOR,
146 int read(std::string const & filename);
148 int read(std::istream &);
154 void write(std::string const & filename,
155 bool ignore_system_lyxrc) const;
157 void write(std::ostream & os,
158 bool ignore_system_lyxrc) const;
162 static std::string const getDescription(LyXRCTags);
164 std::string bind_file;
170 std::string print_command;
172 std::string print_evenpage_flag;
174 std::string print_oddpage_flag;
176 std::string print_pagerange_flag;
178 std::string print_copies_flag;
180 std::string print_collcopies_flag;
182 std::string print_reverse_flag;
184 std::string print_landscape_flag;
186 std::string print_to_printer;
188 bool print_adapt_output;
190 std::string print_to_file;
192 std::string print_file_extension;
194 std::string print_extra_options;
196 std::string print_spool_command;
198 std::string print_spool_printerprefix;
200 std::string print_paper_flag;
202 std::string print_paper_dimension_flag;
204 std::string custom_export_command;
206 std::string custom_export_format;
207 /// option for telling the dvi viewer about the paper size
208 std::string view_dvi_paper_option;
209 /// default paper size for local xdvi/dvips/ghostview/whatever
210 PAPER_SIZE default_papersize;
211 /// command to run chktex incl. options
212 std::string chktex_command;
213 /// command to run bibtex incl. options
214 std::string bibtex_command;
215 /// command to run makeindex incl. options or other index programs
216 std::string index_command;
218 std::string document_path;
220 std::string template_path;
222 std::string tempdir_path;
224 bool auto_region_delete;
225 /// flag telling whether lastfiles should be checked for existance
226 bool auto_reset_options;
228 bool check_lastfiles;
229 /// filename for lastfiles file
230 std::string lastfiles;
231 /// maximal number of lastfiles
232 unsigned int num_lastfiles;
233 /// shall a backup file be created
235 /// A directory for storing backup files
236 std::string backupdir_path;
237 /// Zoom factor for screen fonts
239 /// parameter for button_4 and button_5 (scrollwheel)
240 unsigned int wheel_jump;
241 /// Screen font sizes in points for each font size
242 std::string font_sizes[10];
243 /// Allow the use of scalable fonts? Default is yes.
244 bool use_scalable_fonts;
250 std::string roman_font_name;
252 std::string sans_font_name;
254 std::string typewriter_font_name;
256 std::string roman_font_foundry;
258 std::string sans_font_foundry;
260 std::string typewriter_font_foundry;
262 std::string popup_bold_font;
264 std::string popup_normal_font;
266 std::string font_norm;
287 FontEncoding font_norm_type;
289 void set_font_norm_type();
291 std::string popup_font_encoding;
293 unsigned int autosave;
295 std::string ascii_roff_command;
297 unsigned int ascii_linelen;
298 /// use library instead of process
301 std::string isp_command;
302 /// Accept compound words in spellchecker?
303 bool isp_accept_compound;
304 /// Pass input encoding switch to ispell?
305 bool isp_use_input_encoding;
306 /// Use alternate language?
307 bool isp_use_alt_lang;
308 /// Use personal dictionary?
309 bool isp_use_pers_dict;
310 /// Use escape chars?
311 bool isp_use_esc_chars;
312 /// Alternate language for ispell
313 std::string isp_alt_lang;
314 /// Alternate personal dictionary file for ispell
315 std::string isp_pers_dict;
316 /// Escape characters
317 std::string isp_esc_chars;
321 std::string primary_kbmap;
323 std::string secondary_kbmap;
325 std::string lyxpipes;
327 std::string date_insert_format;
329 std::string language_package;
331 bool language_auto_begin;
333 bool language_auto_end;
335 std::string language_command_begin;
337 std::string language_command_end;
339 std::string language_command_local;
341 bool language_global_options;
343 bool language_use_babel;
349 bool mark_foreign_language;
351 std::string default_language;
353 bool cursor_follows_scrollbar;
355 bool dialogs_iconify_with_main;
357 int label_init_length;
359 lyx::graphics::DisplayType display_graphics;
369 PreviewStatus preview;
371 bool preview_hashed_labels;
373 std::string preview_scale_factor;
375 std::string user_name;
377 std::string user_email;
379 bool cygwin_path_fix;
383 /** \c LyXRC_PreviewStatus is a wrapper for LyXRC::PreviewStatus.
384 * It can be forward-declared and passed as a function argument without
385 * having to expose lyxrc.h.
387 class LyXRC_PreviewStatus {
388 LyXRC::PreviewStatus val_;
390 LyXRC_PreviewStatus(LyXRC::PreviewStatus val) : val_(val) {}
391 operator LyXRC::PreviewStatus() const{ return val_; }
398 extern LyXRC system_lyxrc;