2 * \file qt4/GuiApplication.h
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * \author Abdelrazak Younes
10 * Full author contact details are available in file CREDITS.
13 #ifndef QT4_APPLICATION_H
14 #define QT4_APPLICATION_H
16 #include "ColorCache.h"
17 #include "GuiFontLoader.h"
18 #include "GuiClipboard.h"
19 #include "GuiImplementation.h"
20 #include "GuiSelection.h"
22 #include "frontends/Application.h"
24 #include <QApplication>
26 ///////////////////////////////////////////////////////////////
30 #include <Carbon/Carbon.h>
32 ///////////////////////////////////////////////////////////////
41 /// The Qt main application class
43 There should be only one instance of this class. No Qt object
44 initialisation should be done before the instanciation of this class.
46 \todo The work areas handling could be moved to a base virtual class
47 comon to all frontends.
49 class GuiApplication : public QApplication, public Application
52 GuiApplication(int & argc, char ** argv);
54 virtual ~GuiApplication() {}
56 /// Method inherited from \c Application class
58 virtual Clipboard& clipboard();
59 virtual Selection& selection();
60 virtual FontLoader & fontLoader() { return font_loader_; }
61 virtual int const exec();
62 virtual Gui & gui() { return gui_; }
63 virtual void exit(int status);
64 virtual std::string const romanFontName();
65 virtual std::string const sansFontName();
66 virtual std::string const typewriterFontName();
70 ColorCache & colorCache() { return color_cache_; }
73 GuiFontLoader & guiFontLoader() { return font_loader_; }
77 GuiImplementation gui_;
79 GuiClipboard clipboard_;
81 GuiSelection selection_;
83 GuiFontLoader font_loader_;
85 ColorCache color_cache_;
89 bool x11EventFilter (XEvent * ev);
94 bool macEventFilter(EventRef event);
96 // static OSStatus handleOpenDocuments(
97 static pascal OSErr handleOpenDocuments(
98 const AppleEvent* inEvent, AppleEvent*, long);
102 } // namespace frontend
105 extern lyx::frontend::GuiApplication * guiApp;
108 #endif // QT4_APPLICATION_H