]> git.lyx.org Git - lyx.git/blob - src/lyxrc.h
More fixes to insettabular/text (and some missing features added).
[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-2000 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"
20 #include <boost/utility.hpp>
21
22 /// This contains the runtime configuration of LyX
23 class LyXRC //: public noncopyable {
24 // after 1.1.6 I will use a LyXRCStruct here and then this can be made
25 // noncopyable again.  For now I want to minimise changes.  ARRae 20001010
26 {
27 public:
28 enum LyXRCTags {
29         RC_FONT_ENCODING = 1,
30         RC_PRINTER,
31         RC_PRINT_COMMAND,
32         RC_PRINTEVENPAGEFLAG,
33         RC_PRINTODDPAGEFLAG,
34         RC_PRINTPAGERANGEFLAG,
35         RC_PRINTCOPIESFLAG,
36         RC_PRINTCOLLCOPIESFLAG,
37         RC_PRINTREVERSEFLAG,
38         RC_PRINTLANDSCAPEFLAG,
39         RC_PRINTTOPRINTER,
40         RC_PRINT_ADAPTOUTPUT,
41         RC_PRINTTOFILE,
42         RC_PRINTFILEEXTENSION,
43         RC_PRINTEXSTRAOPTIONS,
44         RC_PRINTSPOOL_COMMAND,
45         RC_PRINTSPOOL_PRINTERPREFIX,
46         RC_PRINTPAPERFLAG,
47         RC_PRINTPAPERDIMENSIONFLAG,
48         RC_CUSTOM_EXPORT_COMMAND,
49         RC_CUSTOM_EXPORT_FORMAT,
50         RC_SCREEN_DPI,
51         RC_SCREEN_ZOOM,
52         RC_SCREEN_FONT_SIZES,
53         RC_SCREEN_FONT_ROMAN,
54         RC_SCREEN_FONT_SANS,
55         RC_SCREEN_FONT_TYPEWRITER,
56         RC_SCREEN_FONT_MENU,
57         RC_SCREEN_FONT_POPUP,
58         RC_SCREEN_FONT_ENCODING,
59         RC_SCREEN_FONT_ENCODING_MENU,
60         RC_SET_COLOR,
61         RC_AUTOSAVE,
62         RC_DOCUMENTPATH,
63         RC_TEMPLATEPATH,
64         RC_TEMPDIRPATH,
65         RC_USETEMPDIR,
66         RC_LASTFILES,
67         RC_AUTOREGIONDELETE,
68         RC_BIND,
69         RC_OVERRIDE_X_DEADKEYS,
70         RC_SERVERPIPE,
71         RC_INPUT,
72         RC_BINDFILE,
73         RC_UIFILE,
74         RC_KBMAP,
75         RC_KBMAP_PRIMARY,
76         RC_KBMAP_SECONDARY,
77 #if 0
78         RC_FAX_COMMAND,
79         RC_PHONEBOOK,
80         RC_FAXPROGRAM,
81 #endif
82         RC_ASCIIROFF_COMMAND,
83         RC_ASCII_LINELEN,
84         RC_NUMLASTFILES,
85         RC_CHECKLASTFILES,
86         RC_VIEWDVI_PAPEROPTION,
87         RC_DEFAULT_PAPERSIZE,
88         RC_PS_COMMAND,
89         RC_ACCEPT_COMPOUND,
90         RC_SPELL_COMMAND,
91         RC_USE_INP_ENC,
92         RC_USE_ALT_LANG,
93         RC_USE_PERS_DICT,
94         RC_USE_ESC_CHARS,
95         RC_SCREEN_FONT_SCALABLE,
96         RC_ALT_LANG,
97         RC_PERS_DICT,
98         RC_ESC_CHARS,
99         RC_CHKTEX_COMMAND,
100         RC_CURSOR_FOLLOWS_SCROLLBAR,
101         RC_EXIT_CONFIRMATION,
102         RC_DISPLAY_SHORTCUTS,
103         RC_MAKE_BACKUP,
104         RC_BACKUPDIR_PATH,
105         RC_RTL_SUPPORT,
106         RC_AUTO_NUMBER,
107         RC_MARK_FOREIGN_LANGUAGE,
108         RC_LANGUAGE_PACKAGE,
109         RC_LANGUAGE_AUTO_BEGIN,
110         RC_LANGUAGE_AUTO_END,
111         RC_LANGUAGE_COMMAND_BEGIN,
112         RC_LANGUAGE_COMMAND_END,
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         RC_LAST
123 };
124
125
126         ///
127         LyXRC();
128         ///
129         void setDefaults();
130         ///
131         int read (string const & filename);
132         ///
133         void readBindFileIfNeeded();
134         ///
135         void write(string const & filename) const;
136         ///
137         void print() const;
138         ///
139         void output(std::ostream & os) const;
140         ///
141         static string const getDescription(LyXRCTags);
142         ///
143         string bind_file;
144         ///
145         string ui_file;
146         ///
147         string printer;
148         ///
149         string print_command;
150         ///
151         string print_evenpage_flag;
152         ///
153         string print_oddpage_flag;
154         ///
155         string print_pagerange_flag;
156         ///
157         string print_copies_flag;
158         ///
159         string print_collcopies_flag;
160         ///
161         string print_reverse_flag;
162         ///
163         string print_landscape_flag;
164         ///
165         string print_to_printer;
166         ///
167         bool print_adapt_output;
168         ///
169         string print_to_file;
170         ///
171         string print_file_extension;
172         ///
173         string print_extra_options;
174         ///
175         string print_spool_command;
176         ///
177         string print_spool_printerprefix;
178         ///
179         string print_paper_flag;
180         ///
181         string print_paper_dimension_flag;
182         ///
183         string custom_export_command;
184         ///
185         string custom_export_format;
186         ///
187         bool pdf_mode;
188         /// postscript interpreter (in general "gs", if it is installed)
189         string ps_command;
190         /// option for telling the dvi viewer about the paper size
191         string view_dvi_paper_option;
192         /// default paper size for local xdvi/dvips/ghostview/whatever
193         BufferParams::PAPER_SIZE default_papersize;
194         /// command to run chktex incl. options
195         string chktex_command;
196         ///
197         string document_path;
198         ///
199         string template_path;
200         ///
201         string tempdir_path;
202         ///
203         bool use_tempdir;
204         ///
205         bool auto_region_delete;
206         /// flag telling whether lastfiles should be checked for existance
207         bool check_lastfiles;
208         /// filename for lastfiles file
209         string lastfiles;
210         /// maximal number of lastfiles
211         unsigned int num_lastfiles;
212         /// shall a backup file be created
213         bool make_backup;
214         /// A directory for storing backup files
215         string backupdir_path;
216         /// Zoom factor for screen fonts
217         unsigned int zoom;
218         /// parameter for button_4 and button_5 (scrollwheel)
219         unsigned int wheel_jump;
220         /// Screen font sizes in points for each font size
221         float font_sizes[10];
222         /// Allow the use of scalable fonts? Default is yes.
223         bool use_scalable_fonts;
224         /// DPI of monitor
225         float dpi;
226         /// Whether lyx should handle deadkeys by itself
227         bool override_x_deadkeys;
228         ///
229         string fontenc;
230         ///
231         string roman_font_name;
232         ///
233         string sans_font_name;
234         ///
235         string typewriter_font_name;
236         ///
237         string menu_font_name;
238         ///
239         string popup_font_name;
240         ///
241         string font_norm;
242         ///
243         enum FontEncoding {
244                 ///
245                 ISO_10646_1,
246                 ///
247                 ISO_8859_1,
248                 ///
249                 ISO_8859_6_8,
250                 ///
251                 ISO_8859_9,
252                 ///
253                 OTHER_ENCODING
254         };
255         ///
256         FontEncoding font_norm_type;
257         ///
258         void set_font_norm_type();
259         ///
260         string font_norm_menu;
261         ///
262         unsigned int autosave;
263 #if 0
264         ///
265         string fax_command;
266         ///
267         string phone_book;
268         ///
269         string fax_program;
270 #endif
271         ///
272         string ascii_roff_command;
273         ///
274         unsigned int ascii_linelen;
275         /// Ispell command
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         bool rtl_support;
319         ///
320         bool auto_number;
321         ///
322         bool mark_foreign_language;
323         ///
324         bool show_banner;
325         /// Do we have to use a GUI?
326         bool use_gui;
327         ///
328         bool new_ask_filename;
329         ///
330         string default_language;
331         ///
332         bool cursor_follows_scrollbar;
333         ///
334         int label_init_length;
335 private:
336         /// Is a bind file already (or currently) read?
337         bool hasBindFile;
338         ///
339         int ReadBindFile(string const & name);
340 };
341
342 ///
343 extern LyXRC lyxrc;
344 ///
345 extern LyXRC system_lyxrc;
346 #endif