]> git.lyx.org Git - lyx.git/blob - src/frontends/lyx_gui.h
The EnumLColor patch, free of macros.
[lyx.git] / src / frontends / lyx_gui.h
1 // -*- C++ -*-
2 /**
3  * \file lyx_gui.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 LYX_GUI_H
13 #define LYX_GUI_H
14
15 #include "support/std_string.h"
16 #include "FuncStatus.h"
17
18 #include <vector>
19
20 class Dialogs;
21 class EnumLColor;
22 class LyXFont;
23 class LyXComm;
24 class FuncRequest;
25
26 /// GUI interaction
27 namespace lyx_gui {
28
29 /// are we using the GUI at all
30 extern bool use_gui;
31
32 /// return a suitable serif font name (called from non-gui context too !)
33 string const roman_font_name();
34
35 /// return a suitable sans serif font name (called from non-gui context too !)
36 string const sans_font_name();
37
38 /// return a suitable monospaced font name (called from non-gui context too !)
39 string const typewriter_font_name();
40
41 /// parse command line and do basic initialisation
42 void parse_init(int & argc, char * argv[]);
43
44 /**
45  * set up GUI parameters. At this point lyxrc may
46  * be used.
47  */
48 void parse_lyxrc();
49
50 /**
51  * Start the main event loop, after executing the given
52  * batch commands, and loading the given documents
53  */
54 void start(string const & batch, std::vector<string> const & files);
55
56 /**
57  * Synchronise all pending events.
58  */
59 void sync_events();
60
61 /**
62  * quit running LyX
63  */
64 void exit();
65
66 /**
67  * return the status flag for a given action. This can be used to tell
68  * that a given lfun is not implemented by a frontend
69  */
70 FuncStatus getStatus(FuncRequest const & ev);
71
72 /** Eg, passing LColor::black returns "000000",
73  *      passing LColor::white returns "ffffff".
74  */
75 string const hexname(EnumLColor col);
76
77 /**
78  * update an altered GUI color
79  */
80 void update_color(EnumLColor col);
81
82 /**
83  * update the font cache
84  */
85 void update_fonts();
86
87 /**
88  * is the given font available ?
89  */
90 bool font_available(LyXFont const & font);
91
92 /**
93  * add a callback for I/O read notification
94  */
95 void set_read_callback(int fd, LyXComm * comm);
96
97 /**
98  * remove a I/O read callback
99  * @param fd file descriptor
100  */
101 void remove_read_callback(int fd);
102
103 } // namespace lyx_gui
104
105 #endif // LYX_GUI_H