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