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