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 <boost/scoped_ptr.hpp>
22 class LyXServerSocket;
28 struct Application_pimpl;
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 /// Start the main event loop, after executing the given batch
52 int start(std::string const & batch);
54 virtual Gui & gui() = 0;
56 virtual int const exec() = 0;
60 * This may either quit directly or record the exit status
61 * and only stop the event loop.
63 virtual void exit(int status) = 0;
66 virtual Clipboard & clipboard() = 0;
68 virtual Selection & selection() = 0;
70 virtual FontLoader & fontLoader() = 0;
72 /// return a suitable serif font name.
73 virtual std::string const romanFontName() = 0;
75 /// return a suitable sans serif font name.
76 virtual std::string const sansFontName() = 0;
78 /// return a suitable monospaced font name.
79 virtual std::string const typewriterFontName() = 0;
83 LyXFunc const & lyxFunc() const;
86 LyXServer const & server() const;
88 LyXServerSocket & socket();
89 LyXServerSocket const & socket() const;
91 /// Create the main window with given geometry settings.
92 LyXView & createView(unsigned int width, unsigned int height,
93 int posx, int posy, bool maximize);
96 void setBufferView(BufferView * buffer_view);
99 /// This BufferView is the one receiving Clipboard and Selection
101 /// FIXME: \todo use Gui::currentView() in the future
102 BufferView * buffer_view_;
105 /// Application private implementation.
106 Application_pimpl * pimpl_;
110 } // namespace frontend
113 extern lyx::frontend::Application * theApp;
116 #endif // LYX_APPLICATION_H