]> git.lyx.org Git - lyx.git/blob - src/frontends/Application.h
3b2fefe0bc96c021d3477bc9d812fa95defc11bc
[lyx.git] / src / frontends / Application.h
1 /**\r
2  * \file frontend/Application.h\r
3  * This file is part of LyX, the document processor.\r
4  * Licence details can be found in the file COPYING.\r
5  *\r
6  * \author Abdelrazak Younes\r
7  *\r
8  * Full author contact details are available in file CREDITS.\r
9  */\r
10 \r
11 #ifndef LYX_APPLICATION_H\r
12 #define LYX_APPLICATION_H\r
13 \r
14 #include "lyxfunc.h"\r
15 #include "lyxserver.h"\r
16 #include "lyxsocket.h"\r
17 \r
18 #include <boost/scoped_ptr.hpp>\r
19 \r
20 #include <string>\r
21 \r
22 class BufferView;\r
23 class LyXView;\r
24 \r
25 namespace lyx {\r
26 namespace frontend {\r
27 \r
28 class Clipboard;\r
29 class Gui;\r
30 class Selection;\r
31 \r
32 \r
33 /// The main application class\r
34 /**\r
35 There should be only one instance of this class. No Qt object\r
36 initialisation should be done before the instanciation of this class.\r
37 \r
38 \todo The work areas handling could be moved to a base virtual class\r
39 comon to all frontends.\r
40 */\r
41 class Application\r
42 {\r
43 public:\r
44         Application(int & argc, char ** argv);\r
45 \r
46         int start(std::string const & batch);\r
47         ///\r
48         virtual Gui & gui() = 0;\r
49         ///\r
50         virtual int const exec() = 0;\r
51         ///\r
52         virtual void exit(int status) = 0;\r
53 \r
54         ///\r
55         virtual Clipboard & clipboard() = 0;\r
56         ///\r
57         virtual Selection & selection() = 0;\r
58 \r
59         ///\r
60         LyXFunc & lyxFunc();\r
61         LyXFunc const & lyxFunc() const;\r
62         ///\r
63         LyXServer & server();\r
64         LyXServer const & server() const;\r
65         ///\r
66         LyXServerSocket & socket();\r
67         LyXServerSocket const & socket() const;\r
68         ///\r
69         void setBufferView(BufferView * buffer_view);\r
70 \r
71 protected:\r
72         ///\r
73         BufferView * buffer_view_;\r
74 \r
75         // FIXME: lyxfunc_ should be private. But the actual construction is done in\r
76         // GuiApplication for now.\r
77 \r
78         /// our function handler\r
79         boost::scoped_ptr<LyXFunc> lyxfunc_;\r
80 \r
81 private:\r
82         ///\r
83         boost::scoped_ptr<LyXServer> lyx_server_;\r
84         ///\r
85         boost::scoped_ptr<LyXServerSocket> lyx_socket_;\r
86 \r
87 }; // Application\r
88 \r
89 } // namespace frontend\r
90 } // namespace lyx\r
91 \r
92 extern lyx::frontend::Application * theApp;\r
93 \r
94 \r
95 #endif // LYX_APPLICATION_H\r