]> git.lyx.org Git - lyx.git/blob - src/frontends/Application.h
d8cee6ca4b5e16ad3bd3265b15a4a3c4cc3555a4
[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 <boost/scoped_ptr.hpp>
15
16 #include <string>
17
18 class BufferList;
19 class BufferView;
20 class LyXFunc;
21 class LyXServer;
22 class LyXServerSocket;
23         
24 namespace lyx {
25 namespace frontend {
26
27 struct Application_pimpl;
28 class Clipboard;
29 class Gui;
30 class Selection;
31
32 /// The main application class
33 /**
34 There should be only one instance of this class. No Qt object
35 initialisation should be done before the instanciation of this class.
36
37 \todo The work areas handling could be moved to a base virtual class
38 comon to all frontends.
39 */
40 class Application
41 {
42 public:
43         ///
44         Application(int & argc, char ** argv);
45         ///
46         virtual ~Application() {}
47
48         int start(std::string const & batch);
49         ///
50         virtual Gui & gui() = 0;
51         ///
52         virtual int const exec() = 0;
53         ///
54         virtual void exit(int status) = 0;
55
56         ///
57         virtual Clipboard & clipboard() = 0;
58         ///
59         virtual Selection & selection() = 0;
60
61         ///
62         LyXFunc & lyxFunc();
63         LyXFunc const & lyxFunc() const;
64         ///
65         LyXServer & server();
66         LyXServer const & server() const;
67         ///
68         LyXServerSocket & socket();
69         LyXServerSocket const & socket() const;
70         ///
71         BufferList & bufferList();
72         BufferList const & bufferList() const;
73
74         void setBufferView(BufferView * buffer_view);
75
76 protected:
77         /// This BufferView is the one receiving Clipboard and Selection
78         /// Events
79         /// FIXME: \todo use Gui::currentView() in the future
80         BufferView * buffer_view_;
81
82         /// Application private implementation.
83         /// FIXME: this should be private but LyXFunc construction
84         /// is still done in GuiApplication.
85         Application_pimpl * pimpl_;
86
87 }; // Application
88
89 } // namespace frontend
90 } // namespace lyx
91
92 extern lyx::frontend::Application * theApp;
93
94
95 #endif // LYX_APPLICATION_H