lyx_mirror/src/frontends/qt4/GuiApplication.h
Abdelrazak Younes 205096733a This commit introduces the FontLoader interface class. In the future, I intend to extend it with a proper encapsulation of font metrics.
* 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
2006-10-03 16:17:32 +00:00

109 lines
2.3 KiB
C++

/**
* \file qt4/GuiApplication.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author unknown
* \author John Levon
* \author Abdelrazak Younes
*
* Full author contact details are available in file CREDITS.
*/
#ifndef QT4_APPLICATION_H
#define QT4_APPLICATION_H
#include "ColorCache.h"
#include "GuiFontLoader.h"
#include "GuiClipboard.h"
#include "GuiImplementation.h"
#include "GuiSelection.h"
#include "frontends/Application.h"
#include <QApplication>
///////////////////////////////////////////////////////////////
// Specific stuff
#ifdef Q_WS_MACX
#include <Carbon/Carbon.h>
#endif
///////////////////////////////////////////////////////////////
class BufferView;
namespace lyx {
namespace frontend {
class GuiWorkArea;
/// The Qt 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 GuiApplication : public QApplication, public Application
{
public:
GuiApplication(int & argc, char ** argv);
///
virtual ~GuiApplication() {}
/// Method inherited from \c Application class
//@{
virtual Clipboard& clipboard();
virtual Selection& selection();
virtual FontLoader & fontLoader() { return font_loader_; }
virtual int const exec();
virtual Gui & gui() { return gui_; }
virtual void exit(int status);
virtual std::string const romanFontName();
virtual std::string const sansFontName();
virtual std::string const typewriterFontName();
//@}
///
ColorCache & colorCache() { return color_cache_; }
///
///
GuiFontLoader & guiFontLoader() { return font_loader_; }
private:
///
GuiImplementation gui_;
///
GuiClipboard clipboard_;
///
GuiSelection selection_;
///
GuiFontLoader font_loader_;
///
ColorCache color_cache_;
#ifdef Q_WS_X11
public:
bool x11EventFilter (XEvent * ev);
#endif
#ifdef Q_WS_MACX
public:
bool macEventFilter(EventRef event);
private:
// static OSStatus handleOpenDocuments(
static pascal OSErr handleOpenDocuments(
const AppleEvent* inEvent, AppleEvent*, long);
#endif
}; // GuiApplication
} // namespace frontend
} // namespace lyx
extern lyx::frontend::GuiApplication * guiApp;
#endif // QT4_APPLICATION_H