]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlPrefs.h
enable Font cache only for MacOSX and inline width() for other platform.
[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 #include "mover.h"
20
21 #include <string>
22 #include <vector>
23
24 class LColor_color;
25
26 namespace lyx {
27 namespace frontend {
28
29 class ControlPrefs : public Dialog::Controller {
30 public:
31         ControlPrefs(Dialog &);
32         ///
33         virtual bool initialiseParams(std::string const &);
34         ///
35         virtual void clearParams() {}
36         ///
37         virtual void dispatchParams();
38         ///
39         virtual bool isBufferDependent() const { return false; }
40
41         LyXRC & rc() { return rc_; }
42         LyXRC const & rc() const { return rc_; }
43
44         Converters & converters() { return converters_; }
45         Converters const & converters() const { return converters_; }
46
47         Formats & formats() { return formats_; }
48         Formats const & formats() const { return formats_; }
49
50         Movers & movers() { return movers_; }
51         Movers const & movers() const { return movers_; }
52
53         /// various file pickers
54         std::string const browsebind(std::string const & file) const;
55         std::string const browseUI(std::string const & file) const;
56         std::string const browsekbmap(std::string const & file) const;
57         std::string const browsedict(std::string const & file) const;
58
59         /// general browse
60         std::string const browse(std::string const & file,
61                                  std::string const & title) const;
62
63         /// browse directory
64         std::string const browsedir(std::string const & path,
65                                     std::string const & title) const;
66
67         /// set a color
68         void setColor(LColor_color col, std::string const & hex);
69
70         /// update the screen fonts after change
71         void updateScreenFonts();
72
73         /// adjust the prefs paper sizes
74         PAPER_SIZE const toPaperSize(int i) const;
75         /// adjust the prefs paper sizes
76         int const fromPaperSize(PAPER_SIZE papersize) const;
77
78 private:
79         /// temporary lyxrc
80         LyXRC rc_;
81
82         /// temporary converters
83         Converters converters_;
84
85         /// temporary formats
86         Formats formats_;
87
88         /// temporary movers
89         Movers movers_;
90
91         /// A list of colors to be dispatched
92         std::vector<std::string> colors_;
93
94         bool redraw_gui_;
95         bool update_screen_font_;
96 };
97
98 } // namespace frontend
99 } // namespace lyx
100
101 #endif // CONTROLPREFS_H