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