]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlPrefs.h
A new LFUN_LYXRC_APPLY lfun, together with a bit of a clean-up of the
[lyx.git] / src / frontends / controllers / ControlPrefs.h
1 // -*- C++ -*-
2 /**
3  * \file ControlPrefs.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef CONTROLPREFS_H
13 #define CONTROLPREFS_H
14
15 #include "ControlDialog_impl.h"
16 #include "converter.h"
17 #include "format.h"
18 #include "lyxrc.h"
19
20 #include <string>
21 #include <vector>
22
23 class LColor_color;
24
25
26 class ControlPrefs : public ControlDialogBI {
27 public:
28         ControlPrefs(LyXView &, Dialogs &);
29
30         LyXRC & rc() { return rc_; }
31         LyXRC const & rc() const { return rc_; }
32
33         Converters & converters() { return converters_; }
34         Converters const & converters() const { return converters_; }
35
36         Formats & formats() { return formats_; }
37         Formats const & formats() const { return formats_; }
38
39         /// various file pickers
40         std::string const browsebind(std::string const & file) const;
41         std::string const browseUI(std::string const & file) const;
42         std::string const browsekbmap(std::string const & file) const;
43         std::string const browsedict(std::string const & file) const;
44
45         /// general browse
46         std::string const browse(std::string const & file,
47                                  std::string const & title) const;
48
49         /// browse directory
50         std::string const browsedir(std::string const & path,
51                                     std::string const & title) const;
52
53         /// redraw widgets (for xforms color change)
54         void redrawGUI();
55
56         /// set a color
57         void setColor(LColor_color col, std::string const & hex);
58
59         /// update the screen fonts after change
60         void updateScreenFonts();
61
62 private:
63         /// get current lyxrc
64         virtual void setParams();
65
66         /// apply current lyxrc
67         virtual void apply();
68
69         /// temporary lyxrc
70         LyXRC rc_;
71
72         /// temporary converters
73         Converters converters_;
74
75         /// temporary formats
76         Formats formats_;
77
78         /// A list of colors to be dispatched
79         std::vector<std::string> colors_;
80
81         bool redraw_gui_;
82         bool update_screen_font_;
83 };
84
85 #endif // CONTROLPREFS_H