2006-09-22 17:50:33 +00:00
|
|
|
/**
|
|
|
|
* \file frontend/Application.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Abdelrazak Younes
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LYX_APPLICATION_H
|
|
|
|
#define LYX_APPLICATION_H
|
|
|
|
|
|
|
|
#include <boost/scoped_ptr.hpp>
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2006-09-29 22:06:28 +00:00
|
|
|
class BufferList;
|
2006-09-22 17:50:33 +00:00
|
|
|
class BufferView;
|
2006-09-29 22:06:28 +00:00
|
|
|
class LyXFunc;
|
|
|
|
class LyXServer;
|
|
|
|
class LyXServerSocket;
|
|
|
|
|
2006-09-22 17:50:33 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2006-09-29 22:06:28 +00:00
|
|
|
struct Application_pimpl;
|
2006-09-22 17:50:33 +00:00
|
|
|
class Clipboard;
|
|
|
|
class Gui;
|
|
|
|
class Selection;
|
|
|
|
|
|
|
|
/// The main application class
|
|
|
|
/**
|
|
|
|
There should be only one instance of this class. No Qt object
|
|
|
|
initialisation should be done before the instanciation of this class.
|
|
|
|
|
|
|
|
\todo The work areas handling could be moved to a base virtual class
|
|
|
|
comon to all frontends.
|
|
|
|
*/
|
|
|
|
class Application
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
Application(int & argc, char ** argv);
|
|
|
|
///
|
|
|
|
virtual ~Application() {}
|
|
|
|
|
|
|
|
int start(std::string const & batch);
|
|
|
|
///
|
|
|
|
virtual Gui & gui() = 0;
|
|
|
|
///
|
|
|
|
virtual int const exec() = 0;
|
|
|
|
///
|
|
|
|
virtual void exit(int status) = 0;
|
|
|
|
|
|
|
|
///
|
|
|
|
virtual Clipboard & clipboard() = 0;
|
|
|
|
///
|
|
|
|
virtual Selection & selection() = 0;
|
|
|
|
|
|
|
|
///
|
|
|
|
LyXFunc & lyxFunc();
|
|
|
|
LyXFunc const & lyxFunc() const;
|
|
|
|
///
|
|
|
|
LyXServer & server();
|
|
|
|
LyXServer const & server() const;
|
|
|
|
///
|
|
|
|
LyXServerSocket & socket();
|
|
|
|
LyXServerSocket const & socket() const;
|
|
|
|
///
|
2006-09-27 10:24:13 +00:00
|
|
|
BufferList & bufferList();
|
|
|
|
BufferList const & bufferList() const;
|
|
|
|
|
2006-09-22 17:50:33 +00:00
|
|
|
void setBufferView(BufferView * buffer_view);
|
|
|
|
|
|
|
|
protected:
|
2006-09-29 22:06:28 +00:00
|
|
|
/// This BufferView is the one receiving Clipboard and Selection
|
|
|
|
/// Events
|
|
|
|
/// FIXME: \todo use Gui::currentView() in the future
|
2006-09-22 17:50:33 +00:00
|
|
|
BufferView * buffer_view_;
|
|
|
|
|
2006-09-29 22:06:28 +00:00
|
|
|
/// Application private implementation.
|
|
|
|
/// FIXME: this should be private but LyXFunc construction
|
|
|
|
/// is still done in GuiApplication.
|
|
|
|
Application_pimpl * pimpl_;
|
2006-09-22 17:50:33 +00:00
|
|
|
|
|
|
|
}; // Application
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
extern lyx::frontend::Application * theApp;
|
|
|
|
|
|
|
|
|
|
|
|
#endif // LYX_APPLICATION_H
|