]> git.lyx.org Git - lyx.git/blob - src/lyxrc.h
In the Document dialog, enable the "Author-Year/Numerical" citation choice
[lyx.git] / src / lyxrc.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ====================================================== 
4  * 
5  *           LyX, The Document Processor
6  *       
7  *           Copyright 1995 Matthias Ettrich
8  *           Copyright 1995-2001 The LyX Team.
9  *
10  * ====================================================== */
11
12 #ifndef LYXRC_H
13 #define LYXRC_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "bufferparams.h" // Just to get the enum BufferParams::PAPER_SIZE (sic)
20
21 // #include <boost/utility.hpp>
22
23 /// This contains the runtime configuration of LyX
24 class LyXRC //: public noncopyable {
25 // after 1.1.6 I will use a LyXRCStruct here and then this can be made
26 // noncopyable again.  For now I want to minimise changes.  ARRae 20001010
27 {
28 public:
29 enum LyXRCTags {
30         RC_FONT_ENCODING = 1,
31         RC_PRINTER,
32         RC_PRINT_COMMAND,
33         RC_PRINTEVENPAGEFLAG,
34         RC_PRINTODDPAGEFLAG,
35         RC_PRINTPAGERANGEFLAG,
36         RC_PRINTCOPIESFLAG,
37         RC_PRINTCOLLCOPIESFLAG,
38         RC_PRINTREVERSEFLAG,
39         RC_PRINTLANDSCAPEFLAG,
40         RC_PRINTTOPRINTER,
41         RC_PRINT_ADAPTOUTPUT,
42         RC_PRINTTOFILE,
43         RC_PRINTFILEEXTENSION,
44         RC_PRINTEXSTRAOPTIONS,
45         RC_PRINTSPOOL_COMMAND,
46         RC_PRINTSPOOL_PRINTERPREFIX,
47         RC_PRINTPAPERFLAG,
48         RC_PRINTPAPERDIMENSIONFLAG,
49         RC_CUSTOM_EXPORT_COMMAND,
50         RC_CUSTOM_EXPORT_FORMAT,
51         RC_SCREEN_DPI,
52         RC_SCREEN_ZOOM,
53         RC_SCREEN_FONT_SIZES,
54         RC_SCREEN_FONT_ROMAN,
55         RC_SCREEN_FONT_SANS,
56         RC_SCREEN_FONT_TYPEWRITER,
57         RC_SCREEN_FONT_MENU,
58         RC_SCREEN_FONT_POPUP,
59         RC_SCREEN_FONT_ENCODING,
60         RC_SCREEN_FONT_ENCODING_MENU,
61         RC_SET_COLOR,
62         RC_AUTOSAVE,
63         RC_DOCUMENTPATH,
64         RC_TEMPLATEPATH,
65         RC_TEMPDIRPATH,
66         RC_USETEMPDIR,
67         RC_LASTFILES,
68         RC_AUTOREGIONDELETE,
69         RC_BIND,
70         RC_OVERRIDE_X_DEADKEYS,
71         RC_SERVERPIPE,
72         RC_INPUT,
73         RC_BINDFILE,
74         RC_UIFILE,
75         RC_KBMAP,
76         RC_KBMAP_PRIMARY,
77         RC_KBMAP_SECONDARY,
78         RC_ASCIIROFF_COMMAND,
79         RC_ASCII_LINELEN,
80         RC_NUMLASTFILES,
81         RC_CHECKLASTFILES,
82         RC_VIEWDVI_PAPEROPTION,
83         RC_DEFAULT_PAPERSIZE,
84         RC_PS_COMMAND,
85         RC_ACCEPT_COMPOUND,
86         RC_SPELL_COMMAND,
87         RC_USE_INP_ENC,
88         RC_USE_ALT_LANG,
89         RC_USE_PERS_DICT,
90         RC_USE_ESC_CHARS,
91         RC_SCREEN_FONT_SCALABLE,
92         RC_ALT_LANG,
93         RC_PERS_DICT,
94         RC_ESC_CHARS,
95         RC_CHKTEX_COMMAND,
96         RC_CURSOR_FOLLOWS_SCROLLBAR,
97         RC_DIALOGS_ICONIFY_WITH_MAIN,
98         RC_EXIT_CONFIRMATION,
99         RC_DISPLAY_SHORTCUTS,
100         RC_MAKE_BACKUP,
101         RC_BACKUPDIR_PATH,
102         RC_RTL_SUPPORT,
103         RC_AUTO_NUMBER,
104         RC_MARK_FOREIGN_LANGUAGE,
105         RC_LANGUAGE_PACKAGE,
106         RC_LANGUAGE_AUTO_BEGIN,
107         RC_LANGUAGE_AUTO_END,
108         RC_LANGUAGE_COMMAND_BEGIN,
109         RC_LANGUAGE_COMMAND_END,
110         RC_LANGUAGE_COMMAND_LOCAL,
111         RC_LANGUAGE_GLOBAL_OPTIONS,
112         RC_LANGUAGE_USE_BABEL,
113         RC_DATE_INSERT_FORMAT,
114         RC_SHOW_BANNER,
115         RC_WHEEL_JUMP,
116         RC_CONVERTER,
117         RC_VIEWER,
118         RC_FORMAT,
119         RC_NEW_ASK_FILENAME,
120         RC_DEFAULT_LANGUAGE,
121         RC_LABEL_INIT_LENGTH,
122 #ifdef USE_PSPELL       
123         RC_USE_PSPELL,
124 #endif
125         RC_LAST
126 };
127
128
129         ///
130         LyXRC();
131         ///
132         void setDefaults();
133         ///
134         int read (string const & filename);
135         ///
136         void readBindFileIfNeeded();
137         ///
138         void write(string const & filename) const;
139         ///
140         void print() const;
141         ///
142         void output(std::ostream & os) const;
143         ///
144         static string const getDescription(LyXRCTags);
145         ///
146         string bind_file;
147         ///
148         string ui_file;
149         ///
150         string printer;
151         ///
152         string print_command;
153         ///
154         string print_evenpage_flag;
155         ///
156         string print_oddpage_flag;
157         ///
158         string print_pagerange_flag;
159         ///
160         string print_copies_flag;
161         ///
162         string print_collcopies_flag;
163         ///
164         string print_reverse_flag;
165         ///
166         string print_landscape_flag;
167         ///
168         string print_to_printer;
169         ///
170         bool print_adapt_output;
171         ///
172         string print_to_file;
173         ///
174         string print_file_extension;
175         ///
176         string print_extra_options;
177         ///
178         string print_spool_command;
179         ///
180         string print_spool_printerprefix;
181         ///
182         string print_paper_flag;
183         ///
184         string print_paper_dimension_flag;
185         ///
186         string custom_export_command;
187         ///
188         string custom_export_format;
189         ///
190         bool pdf_mode;
191         /// postscript interpreter (in general "gs", if it is installed)
192         string ps_command;
193         /// option for telling the dvi viewer about the paper size
194         string view_dvi_paper_option;
195         /// default paper size for local xdvi/dvips/ghostview/whatever
196         BufferParams::PAPER_SIZE default_papersize;
197         /// command to run chktex incl. options
198         string chktex_command;
199         ///
200         string document_path;
201         ///
202         string template_path;
203         ///
204         string tempdir_path;
205         ///
206         bool use_tempdir;
207         ///
208         bool auto_region_delete;
209         /// flag telling whether lastfiles should be checked for existance
210         bool check_lastfiles;
211         /// filename for lastfiles file
212         string lastfiles;
213         /// maximal number of lastfiles
214         unsigned int num_lastfiles;
215         /// shall a backup file be created
216         bool make_backup;
217         /// A directory for storing backup files
218         string backupdir_path;
219         /// Zoom factor for screen fonts
220         unsigned int zoom;
221         /// parameter for button_4 and button_5 (scrollwheel)
222         unsigned int wheel_jump;
223         /// Screen font sizes in points for each font size
224         float font_sizes[10];
225         /// Allow the use of scalable fonts? Default is yes.
226         bool use_scalable_fonts;
227         /// DPI of monitor
228         float dpi;
229         /// Whether lyx should handle deadkeys by itself
230         bool override_x_deadkeys;
231         ///
232         string fontenc;
233         ///
234         string roman_font_name;
235         ///
236         string sans_font_name;
237         ///
238         string typewriter_font_name;
239         ///
240         string menu_font_name;
241         ///
242         string popup_font_name;
243         ///
244         string font_norm;
245         ///
246         enum FontEncoding {
247                 ///
248                 ISO_10646_1,
249                 ///
250                 ISO_8859_1,
251                 ///
252                 ISO_8859_6_8,
253                 ///
254                 ISO_8859_9,
255                 ///
256                 ISO_8859_15,
257                 ///
258                 OTHER_ENCODING
259         };
260         ///
261         FontEncoding font_norm_type;
262         ///
263         void set_font_norm_type();
264         ///
265         string font_norm_menu;
266         ///
267         unsigned int autosave;
268         ///
269         string ascii_roff_command;
270         ///
271         unsigned int ascii_linelen;
272         /// Ispell command
273 #ifdef USE_PSPELL       
274         bool use_pspell;
275 #endif
276         string isp_command;
277         /// Accept compound words in spellchecker?
278         bool isp_accept_compound;
279         /// Pass input encoding switch to ispell?
280         bool isp_use_input_encoding;
281         /// Use alternate language?
282         bool isp_use_alt_lang;
283         /// Use personal dictionary?
284         bool isp_use_pers_dict;
285         /// Use escape chars?
286         bool isp_use_esc_chars;
287         /// Alternate language for ispell
288         string isp_alt_lang;
289         /// Alternate personal dictionary file for ispell
290         string isp_pers_dict;
291         /// Escape characters
292         string isp_esc_chars;
293         ///
294         bool use_kbmap;
295         /// Ask for confirmation of exit when there are unsaved documents?
296         bool exit_confirmation;
297         /// Should we display short-cut information in the minibuffer?
298         bool display_shortcuts;
299         ///
300         string primary_kbmap;
301         ///
302         string secondary_kbmap;
303         ///
304         string lyxpipes;
305         ///
306         string date_insert_format;
307         ///
308         string language_package;
309         ///
310         bool language_auto_begin;
311         ///
312         bool language_auto_end;
313         ///
314         string language_command_begin;
315         ///
316         string language_command_end;
317         ///
318         string language_command_local;
319         ///
320         bool language_global_options; 
321         ///
322         bool language_use_babel;
323         ///
324         bool rtl_support;
325         ///
326         bool auto_number;
327         ///
328         bool mark_foreign_language;
329         ///
330         bool show_banner;
331         /// Do we have to use a GUI?
332         bool use_gui;
333         ///
334         bool new_ask_filename;
335         ///
336         string default_language;
337         ///
338         bool cursor_follows_scrollbar;
339         ///
340         bool dialogs_iconify_with_main;
341         ///
342         int label_init_length;
343 private:
344         /// Is a bind file already (or currently) read?
345         bool hasBindFile;
346         ///
347         int ReadBindFile(string const & name);
348 };
349
350 ///
351 extern LyXRC lyxrc;
352 ///
353 extern LyXRC system_lyxrc;
354 #endif