]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlPrefs.h
Georg's add an editor to Formats / safe external_templates patch.
[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 "Dialog.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 Dialog::Controller {
27 public:
28         ControlPrefs(Dialog &);
29         ///
30         virtual bool initialiseParams(std::string const &);
31         ///
32         virtual void clearParams() {}
33         ///
34         virtual void dispatchParams();
35         ///
36         virtual bool isBufferDependent() const { return false; }
37
38         LyXRC & rc() { return rc_; }
39         LyXRC const & rc() const { return rc_; }
40
41         Converters & converters() { return converters_; }
42         Converters const & converters() const { return converters_; }
43
44         Formats & formats() { return formats_; }
45         Formats const & formats() const { return formats_; }
46
47         /// various file pickers
48         std::string const browsebind(std::string const & file) const;
49         std::string const browseUI(std::string const & file) const;
50         std::string const browsekbmap(std::string const & file) const;
51         std::string const browsedict(std::string const & file) const;
52
53         /// general browse
54         std::string const browse(std::string const & file,
55                                  std::string const & title) const;
56
57         /// browse directory
58         std::string const browsedir(std::string const & path,
59                                     std::string const & title) const;
60
61         /// redraw widgets (for xforms color change)
62         void redrawGUI();
63
64         /// set a color
65         void setColor(LColor_color col, std::string const & hex);
66
67         /// update the screen fonts after change
68         void updateScreenFonts();
69
70 private:
71         /// temporary lyxrc
72         LyXRC rc_;
73
74         /// temporary converters
75         Converters converters_;
76
77         /// temporary formats
78         Formats formats_;
79
80         /// A list of colors to be dispatched
81         std::vector<std::string> colors_;
82
83         bool redraw_gui_;
84         bool update_screen_font_;
85 };
86
87 #endif // CONTROLPREFS_H