2 * \file qt3/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 QT3_APPLICATION_H
14 #define QT3_APPLICATION_H
16 #include "frontends/Application.h"
18 #include "qfont_loader.h"
19 #include "GuiClipboard.h"
20 #include "GuiImplementation.h"
21 #include "GuiSelection.h"
23 #include <qapplication.h>
25 ///////////////////////////////////////////////////////////////
29 #include <Carbon/Carbon.h>
31 ///////////////////////////////////////////////////////////////
40 /// The Qt main application class
42 There should be only one instance of this class. No Qt object
43 initialisation should be done before the instanciation of this class.
45 \todo The work areas handling could be moved to a base virtual class
46 comon to all frontends.
48 class GuiApplication : public QApplication, public Application
51 GuiApplication(int & argc, char ** argv);
53 virtual ~GuiApplication() {}
55 /// Method inherited from \c Application class
57 virtual Clipboard& clipboard();
58 virtual Selection& selection();
59 virtual FontLoader & fontLoader() { return font_loader_; }
60 virtual int const exec();
61 virtual Gui & gui() { return gui_; }
62 virtual void exit(int status);
63 virtual std::string const romanFontName();
64 virtual std::string const sansFontName();
65 virtual std::string const typewriterFontName();
71 GuiImplementation gui_;
73 GuiClipboard clipboard_;
75 GuiSelection selection_;
77 GuiFontLoader font_loader_;
81 bool x11EventFilter (XEvent * ev);
86 bool macEventFilter(EventRef event);
88 // static OSStatus handleOpenDocuments(
89 static pascal OSErr handleOpenDocuments(
90 const AppleEvent* inEvent, AppleEvent*, long);
94 } // namespace frontend
97 extern lyx::frontend::GuiApplication * guiApp;
100 #endif // QT3_APPLICATION_H