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