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