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
15 #include "lyxserver.h"
16 #include "lyxsocket.h"
18 #include <boost/scoped_ptr.hpp>
33 /// The main application class
35 There should be only one instance of this class. No Qt object
36 initialisation should be done before the instanciation of this class.
38 \todo The work areas handling could be moved to a base virtual class
39 comon to all frontends.
45 Application(int & argc, char ** argv);
47 virtual ~Application() {}
49 int start(std::string const & batch);
51 virtual Gui & gui() = 0;
53 virtual int const exec() = 0;
55 virtual void exit(int status) = 0;
58 virtual Clipboard & clipboard() = 0;
60 virtual Selection & selection() = 0;
64 LyXFunc const & lyxFunc() const;
67 LyXServer const & server() const;
69 LyXServerSocket & socket();
70 LyXServerSocket const & socket() const;
72 void setBufferView(BufferView * buffer_view);
76 BufferView * buffer_view_;
78 // FIXME: lyxfunc_ should be private. But the actual construction is done in
79 // GuiApplication for now.
81 /// our function handler
82 boost::scoped_ptr<LyXFunc> lyxfunc_;
86 boost::scoped_ptr<LyXServer> lyx_server_;
88 boost::scoped_ptr<LyXServerSocket> lyx_socket_;
92 } // namespace frontend
95 extern lyx::frontend::Application * theApp;
98 #endif // LYX_APPLICATION_H