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