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