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.
6 * \author Abdelrazak Younes
8 * Full author contact details are available in file CREDITS.
11 #ifndef LYX_APPLICATION_H
12 #define LYX_APPLICATION_H
14 #include "bufferlist.h"
16 #include "lyxserver.h"
17 #include "lyxsocket.h"
19 #include <boost/scoped_ptr.hpp>
34 /// The main application class
36 There should be only one instance of this class. No Qt object
37 initialisation should be done before the instanciation of this class.
39 \todo The work areas handling could be moved to a base virtual class
40 comon to all frontends.
46 Application(int & argc, char ** argv);
48 virtual ~Application() {}
50 int start(std::string const & batch);
52 virtual Gui & gui() = 0;
54 virtual int const exec() = 0;
56 virtual void exit(int status) = 0;
59 virtual Clipboard & clipboard() = 0;
61 virtual Selection & selection() = 0;
65 LyXFunc const & lyxFunc() const;
68 LyXServer const & server() const;
70 LyXServerSocket & socket();
71 LyXServerSocket const & socket() const;
73 BufferList & bufferList();
74 BufferList const & bufferList() const;
76 void setBufferView(BufferView * buffer_view);
80 BufferView * buffer_view_;
82 // FIXME: lyxfunc_ should be private. But the actual construction is done in
83 // GuiApplication for now.
85 /// our function handler
86 boost::scoped_ptr<LyXFunc> lyxfunc_;
90 boost::scoped_ptr<LyXServer> lyx_server_;
92 boost::scoped_ptr<LyXServerSocket> lyx_socket_;
94 BufferList buffer_list_;
98 } // namespace frontend
101 extern lyx::frontend::Application * theApp;
104 #endif // LYX_APPLICATION_H