]> git.lyx.org Git - lyx.git/blob - src/frontends/Application.h
64c34024735f2c62c76dd8e963b023570355f14c
[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 class LyXView;
24         
25 namespace lyx {
26 namespace frontend {
27
28 struct Application_pimpl;
29 class Clipboard;
30 class Gui;
31 class Selection;
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         BufferList & bufferList();
73         BufferList const & bufferList() const;
74
75         ///
76         LyXView & createView(unsigned int width, unsigned int height,
77                 int posx, int posy, bool maximize);
78         
79         ///
80         void setBufferView(BufferView * buffer_view);
81
82 protected:
83         /// This BufferView is the one receiving Clipboard and Selection
84         /// Events
85         /// FIXME: \todo use Gui::currentView() in the future
86         BufferView * buffer_view_;
87
88         /// Application private implementation.
89         /// FIXME: this should be private but LyXFunc construction
90         /// is still done in GuiApplication.
91         Application_pimpl * pimpl_;
92
93 }; // Application
94
95 } // namespace frontend
96 } // namespace lyx
97
98 extern lyx::frontend::Application * theApp;
99
100
101 #endif // LYX_APPLICATION_H