mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-22 16:04:07 +00:00
205096733a
* frontends/FontLoader.h: new interface class. * frontends/Application.h: new FontLoader() pure virtual method * frontends/lyx_gui: update_fonts() and font_available() methods deleted * [qt3/qt4/gtk]/GuiApplication: implement the new interface * qt4/GuiFontLoader: - renamed from FontLoader - now derives from FontLoader - now in the lyx::frontend namespace * qt3/qfont_loader - now derives from FontLoader * gtk/xftFontLoader - now derives from FontLoader git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15220 a592a061-630c-0410-9148-cb99ea01b6c8
120 lines
2.5 KiB
C++
120 lines
2.5 KiB
C++
/**
|
|
* \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>
|
|
|
|
class BufferList;
|
|
class BufferView;
|
|
class LyXFunc;
|
|
class LyXServer;
|
|
class LyXServerSocket;
|
|
class LyXView;
|
|
|
|
namespace lyx {
|
|
namespace frontend {
|
|
|
|
struct Application_pimpl;
|
|
class Clipboard;
|
|
class FontLoader;
|
|
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() {}
|
|
|
|
/// Start the main event loop, after executing the given batch
|
|
/// commands.
|
|
int start(std::string const & batch);
|
|
///
|
|
virtual Gui & gui() = 0;
|
|
///
|
|
virtual int const exec() = 0;
|
|
|
|
/// Quit running LyX.
|
|
/**
|
|
* This may either quit directly or record the exit status
|
|
* and only stop the event loop.
|
|
*/
|
|
virtual void exit(int status) = 0;
|
|
|
|
///
|
|
virtual Clipboard & clipboard() = 0;
|
|
///
|
|
virtual Selection & selection() = 0;
|
|
///
|
|
virtual FontLoader & fontLoader() = 0;
|
|
|
|
/// return a suitable serif font name.
|
|
virtual std::string const romanFontName() = 0;
|
|
|
|
/// return a suitable sans serif font name.
|
|
virtual std::string const sansFontName() = 0;
|
|
|
|
/// return a suitable monospaced font name.
|
|
virtual std::string const typewriterFontName() = 0;
|
|
|
|
///
|
|
LyXFunc & lyxFunc();
|
|
LyXFunc const & lyxFunc() const;
|
|
///
|
|
LyXServer & server();
|
|
LyXServer const & server() const;
|
|
///
|
|
LyXServerSocket & socket();
|
|
LyXServerSocket const & socket() const;
|
|
///
|
|
BufferList & bufferList();
|
|
BufferList const & bufferList() const;
|
|
|
|
/// Create the main window with given geometry settings.
|
|
LyXView & createView(unsigned int width, unsigned int height,
|
|
int posx, int posy, bool maximize);
|
|
|
|
///
|
|
void setBufferView(BufferView * buffer_view);
|
|
|
|
protected:
|
|
/// This BufferView is the one receiving Clipboard and Selection
|
|
/// Events
|
|
/// FIXME: \todo use Gui::currentView() in the future
|
|
BufferView * buffer_view_;
|
|
|
|
private:
|
|
/// Application private implementation.
|
|
Application_pimpl * pimpl_;
|
|
|
|
}; // Application
|
|
|
|
} // namespace frontend
|
|
} // namespace lyx
|
|
|
|
extern lyx::frontend::Application * theApp;
|
|
|
|
|
|
#endif // LYX_APPLICATION_H
|