1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of
|
1999-11-15 12:01:38 +00:00
|
|
|
* ======================================================
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
1999-10-07 18:44:17 +00:00
|
|
|
* Copyright 1995 Matthias Ettrich
|
2001-05-30 13:53:44 +00:00
|
|
|
* Copyright 1995-2001 The LyX Team.
|
1999-09-27 18:44:28 +00:00
|
|
|
*
|
1999-11-15 12:01:38 +00:00
|
|
|
* ====================================================== */
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-10-02 16:21:10 +00:00
|
|
|
#ifndef LYXRC_H
|
|
|
|
#define LYXRC_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2001-07-29 15:34:18 +00:00
|
|
|
#include "bufferparams.h" // Just to get the enum BufferParams::PAPER_SIZE (sic)
|
|
|
|
|
|
|
|
// #include <boost/utility.hpp>
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// This contains the runtime configuration of LyX
|
2000-10-10 14:17:33 +00:00
|
|
|
class LyXRC //: public noncopyable {
|
|
|
|
// after 1.1.6 I will use a LyXRCStruct here and then this can be made
|
|
|
|
// noncopyable again. For now I want to minimise changes. ARRae 20001010
|
|
|
|
{
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
2000-10-30 21:53:29 +00:00
|
|
|
enum LyXRCTags {
|
|
|
|
RC_FONT_ENCODING = 1,
|
|
|
|
RC_PRINTER,
|
|
|
|
RC_PRINT_COMMAND,
|
|
|
|
RC_PRINTEVENPAGEFLAG,
|
|
|
|
RC_PRINTODDPAGEFLAG,
|
|
|
|
RC_PRINTPAGERANGEFLAG,
|
|
|
|
RC_PRINTCOPIESFLAG,
|
|
|
|
RC_PRINTCOLLCOPIESFLAG,
|
|
|
|
RC_PRINTREVERSEF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ELEN,
|
|
|
|
RC_NUMLASTFILES,
|
|
|
|
RC_CHECKLASTFILES,
|
|
|
|
RC_VIEWDVI_PAPEROPTION,
|
|
|
|
RC_DEFAULT_PAPERSIZE,
|
|
|
|
RC_PS_COMMAND,
|
|
|
|
RC_ACCEPT_COMPOUND,
|
|
|
|
RC_SPELL_COMMAND,
|
|
|
|
RC_USE_INP_ENC,
|
|
|
|
RC_USE_ALT_LANG,
|
|
|
|
RC_USE_PERS_DICT,
|
|
|
|
RC_USE_ESC_CHARS,
|
|
|
|
RC_SCREEN_FONT_SCALABLE,
|
|
|
|
RC_ALT_LANG,
|
|
|
|
RC_PERS_DICT,
|
|
|
|
RC_ESC_CHARS,
|
|
|
|
RC_CHKTEX_COMMAND,
|
|
|
|
RC_CURSOR_FOLLOWS_SCROLLBAR,
|
2001-09-07 10:11:02 +00:00
|
|
|
RC_DIALOGS_ICONIFY_WITH_MAIN,
|
2000-10-30 21:53:29 +00:00
|
|
|
RC_EXIT_CONFIRMATION,
|
|
|
|
RC_DISPLAY_SHORTCUTS,
|
|
|
|
RC_MAKE_BACKUP,
|
|
|
|
RC_BACKUPDIR_PATH,
|
|
|
|
RC_RTL_SUPPORT,
|
|
|
|
RC_AUTO_NUMBER,
|
|
|
|
RC_MARK_FOREIGN_LANGUAGE,
|
|
|
|
RC_LANGUAGE_PACKAGE,
|
|
|
|
RC_LANGUAGE_AUTO_BEGIN,
|
|
|
|
RC_LANGUAGE_AUTO_END,
|
|
|
|
RC_LANGUAGE_COMMAND_BEGIN,
|
|
|
|
RC_LANGUAGE_COMMAND_END,
|
2001-02-25 10:22:54 +00:00
|
|
|
RC_LANGUAGE_COMMAND_LOCAL,
|
|
|
|
RC_LANGUAGE_GLOBAL_OPTIONS,
|
|
|
|
RC_LANGUAGE_USE_BABEL,
|
2000-10-30 21:53:29 +00:00
|
|
|
RC_DATE_INSERT_FORMAT,
|
|
|
|
RC_SHOW_BANNER,
|
|
|
|
RC_WHEEL_JUMP,
|
|
|
|
RC_CONVERTER,
|
|
|
|
RC_VIEWER,
|
|
|
|
RC_FORMAT,
|
|
|
|
RC_NEW_ASK_FILENAME,
|
|
|
|
RC_DEFAULT_LANGUAGE,
|
2000-12-11 09:46:09 +00:00
|
|
|
RC_LABEL_INIT_LENGTH,
|
2001-07-16 10:03:38 +00:00
|
|
|
#ifdef USE_PSPELL
|
|
|
|
RC_USE_PSPELL,
|
|
|
|
#endif
|
2000-10-30 21:53:29 +00:00
|
|
|
RC_LAST
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
1999-09-27 18:44:28 +00:00
|
|
|
LyXRC();
|
|
|
|
///
|
2000-03-12 10:35:05 +00:00
|
|
|
void setDefaults();
|
|
|
|
///
|
1999-12-01 00:57:31 +00:00
|
|
|
int read (string const & filename);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-12-11 13:41:21 +00:00
|
|
|
void readBindFileIfNeeded();
|
|
|
|
///
|
1999-12-01 00:57:31 +00:00
|
|
|
void write(string const & filename) const;
|
|
|
|
///
|
|
|
|
void print() const;
|
|
|
|
///
|
2000-04-04 00:19:15 +00:00
|
|
|
void output(std::ostream & os) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-11-17 00:07:41 +00:00
|
|
|
static string const getDescription(LyXRCTags);
|
2000-10-30 21:53:29 +00:00
|
|
|
///
|
2000-06-12 11:27:15 +00:00
|
|
|
string bind_file;
|
|
|
|
///
|
2000-07-24 13:53:19 +00:00
|
|
|
string ui_file;
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string printer;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string print_command;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string print_evenpage_flag;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string print_oddpage_flag;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string print_pagerange_flag;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string print_copies_flag;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string print_collcopies_flag;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string print_reverse_flag;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string print_landscape_flag;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string print_to_printer;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
bool print_adapt_output;
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string print_to_file;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string print_file_extension;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string print_extra_options;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string print_spool_command;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string print_spool_printerprefix;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string print_paper_flag;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string print_paper_dimension_flag;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string custom_export_command;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string custom_export_format;
|
2000-01-11 01:59:00 +00:00
|
|
|
///
|
|
|
|
bool pdf_mode;
|
1999-09-27 18:44:28 +00:00
|
|
|
/// postscript interpreter (in general "gs", if it is installed)
|
1999-10-02 16:21:10 +00:00
|
|
|
string ps_command;
|
2000-02-15 13:30:49 +00:00
|
|
|
/// option for telling the dvi viewer about the paper size
|
|
|
|
string view_dvi_paper_option;
|
2001-04-26 17:47:40 +00:00
|
|
|
/// default paper size for local xdvi/dvips/ghostview/whatever
|
|
|
|
BufferParams::PAPER_SIZE default_papersize;
|
1999-09-27 18:44:28 +00:00
|
|
|
/// command to run chktex incl. options
|
1999-10-02 16:21:10 +00:00
|
|
|
string chktex_command;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string document_path;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string template_path;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string tempdir_path;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
bool use_tempdir;
|
|
|
|
///
|
|
|
|
bool auto_region_delete;
|
|
|
|
/// flag telling whether lastfiles should be checked for existance
|
|
|
|
bool check_lastfiles;
|
|
|
|
/// filename for lastfiles file
|
1999-10-02 16:21:10 +00:00
|
|
|
string lastfiles;
|
1999-09-27 18:44:28 +00:00
|
|
|
/// maximal number of lastfiles
|
|
|
|
unsigned int num_lastfiles;
|
2000-01-11 01:59:00 +00:00
|
|
|
/// shall a backup file be created
|
|
|
|
bool make_backup;
|
2000-03-20 14:49:54 +00:00
|
|
|
/// A directory for storing backup files
|
|
|
|
string backupdir_path;
|
1999-09-27 18:44:28 +00:00
|
|
|
/// Zoom factor for screen fonts
|
|
|
|
unsigned int zoom;
|
2000-07-04 20:32:37 +00:00
|
|
|
/// parameter for button_4 and button_5 (scrollwheel)
|
|
|
|
unsigned int wheel_jump;
|
1999-09-27 18:44:28 +00:00
|
|
|
/// Screen font sizes in points for each font size
|
|
|
|
float font_sizes[10];
|
|
|
|
/// Allow the use of scalable fonts? Default is yes.
|
|
|
|
bool use_scalable_fonts;
|
|
|
|
/// DPI of monitor
|
|
|
|
float dpi;
|
2000-05-10 11:50:11 +00:00
|
|
|
/// Whether lyx should handle deadkeys by itself
|
|
|
|
bool override_x_deadkeys;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string fontenc;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string roman_font_name;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string sans_font_name;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string typewriter_font_name;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string menu_font_name;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string popup_font_name;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string font_norm;
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
2000-07-04 20:32:37 +00:00
|
|
|
enum FontEncoding {
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
2000-07-04 20:32:37 +00:00
|
|
|
ISO_10646_1,
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
2000-10-30 21:53:29 +00:00
|
|
|
ISO_8859_1,
|
|
|
|
///
|
2000-07-04 20:32:37 +00:00
|
|
|
ISO_8859_6_8,
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
2000-10-30 21:53:29 +00:00
|
|
|
ISO_8859_9,
|
|
|
|
///
|
2001-07-18 16:33:26 +00:00
|
|
|
ISO_8859_15,
|
|
|
|
///
|
2000-07-04 20:32:37 +00:00
|
|
|
OTHER_ENCODING
|
|
|
|
};
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
2000-07-04 20:32:37 +00:00
|
|
|
FontEncoding font_norm_type;
|
|
|
|
///
|
|
|
|
void set_font_norm_type();
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-03-10 13:22:20 +00:00
|
|
|
string font_norm_menu;
|
|
|
|
///
|
1999-09-27 18:44:28 +00:00
|
|
|
unsigned int autosave;
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string ascii_roff_command;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
unsigned int ascii_linelen;
|
|
|
|
/// Ispell command
|
2001-07-16 10:03:38 +00:00
|
|
|
#ifdef USE_PSPELL
|
|
|
|
bool use_pspell;
|
|
|
|
#endif
|
1999-10-02 16:21:10 +00:00
|
|
|
string isp_command;
|
1999-09-27 18:44:28 +00:00
|
|
|
/// Accept compound words in spellchecker?
|
|
|
|
bool isp_accept_compound;
|
|
|
|
/// Pass input encoding switch to ispell?
|
|
|
|
bool isp_use_input_encoding;
|
|
|
|
/// Use alternate language?
|
|
|
|
bool isp_use_alt_lang;
|
|
|
|
/// Use personal dictionary?
|
|
|
|
bool isp_use_pers_dict;
|
|
|
|
/// Use escape chars?
|
|
|
|
bool isp_use_esc_chars;
|
|
|
|
/// Alternate language for ispell
|
1999-10-02 16:21:10 +00:00
|
|
|
string isp_alt_lang;
|
1999-09-27 18:44:28 +00:00
|
|
|
/// Alternate personal dictionary file for ispell
|
1999-10-02 16:21:10 +00:00
|
|
|
string isp_pers_dict;
|
1999-09-27 18:44:28 +00:00
|
|
|
/// Escape characters
|
1999-10-02 16:21:10 +00:00
|
|
|
string isp_esc_chars;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
bool use_kbmap;
|
|
|
|
/// Ask for confirmation of exit when there are unsaved documents?
|
|
|
|
bool exit_confirmation;
|
|
|
|
/// Should we display short-cut information in the minibuffer?
|
|
|
|
bool display_shortcuts;
|
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string primary_kbmap;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string secondary_kbmap;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-10-02 16:21:10 +00:00
|
|
|
string lyxpipes;
|
2000-02-01 11:32:33 +00:00
|
|
|
///
|
2000-02-01 13:58:06 +00:00
|
|
|
string date_insert_format;
|
2000-03-10 13:22:20 +00:00
|
|
|
///
|
|
|
|
string language_package;
|
|
|
|
///
|
2000-03-17 10:14:46 +00:00
|
|
|
bool language_auto_begin;
|
2000-03-10 13:22:20 +00:00
|
|
|
///
|
2000-03-17 10:14:46 +00:00
|
|
|
bool language_auto_end;
|
2000-03-10 13:22:20 +00:00
|
|
|
///
|
2000-03-17 10:14:46 +00:00
|
|
|
string language_command_begin;
|
2000-03-10 13:22:20 +00:00
|
|
|
///
|
2000-03-17 10:14:46 +00:00
|
|
|
string language_command_end;
|
2000-02-03 19:51:27 +00:00
|
|
|
///
|
2001-02-25 10:22:54 +00:00
|
|
|
string language_command_local;
|
|
|
|
///
|
|
|
|
bool language_global_options;
|
|
|
|
///
|
|
|
|
bool language_use_babel;
|
|
|
|
///
|
2000-02-03 19:51:27 +00:00
|
|
|
bool rtl_support;
|
2000-03-06 02:42:40 +00:00
|
|
|
///
|
2000-04-10 21:40:13 +00:00
|
|
|
bool auto_number;
|
2000-03-17 10:14:46 +00:00
|
|
|
///
|
2000-05-30 19:31:11 +00:00
|
|
|
bool mark_foreign_language;
|
|
|
|
///
|
2000-03-06 02:42:40 +00:00
|
|
|
bool show_banner;
|
2000-03-20 16:37:50 +00:00
|
|
|
/// Do we have to use a GUI?
|
|
|
|
bool use_gui;
|
2000-03-12 10:35:05 +00:00
|
|
|
///
|
2000-08-08 11:08:07 +00:00
|
|
|
bool new_ask_filename;
|
2000-09-27 15:23:24 +00:00
|
|
|
///
|
|
|
|
string default_language;
|
2000-10-10 14:17:33 +00:00
|
|
|
///
|
|
|
|
bool cursor_follows_scrollbar;
|
2000-12-11 09:46:09 +00:00
|
|
|
///
|
2001-09-07 10:11:02 +00:00
|
|
|
bool dialogs_iconify_with_main;
|
|
|
|
///
|
2000-12-11 09:46:09 +00:00
|
|
|
int label_init_length;
|
2000-12-11 13:41:21 +00:00
|
|
|
private:
|
|
|
|
/// Is a bind file already (or currently) read?
|
|
|
|
bool hasBindFile;
|
|
|
|
///
|
|
|
|
int ReadBindFile(string const & name);
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
2000-08-07 20:58:24 +00:00
|
|
|
///
|
2000-03-12 10:35:05 +00:00
|
|
|
extern LyXRC lyxrc;
|
2000-08-14 05:24:35 +00:00
|
|
|
///
|
2000-10-10 14:17:33 +00:00
|
|
|
extern LyXRC system_lyxrc;
|
1999-09-27 18:44:28 +00:00
|
|
|
#endif
|