]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/Application.h
remove qPixmapFromMimeSource. This caused the inclusion of Qt3 support headers which...
[lyx.git] / src / frontends / qt4 / Application.h
1 /**
2  * \file qt4/Application.h
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author unknown
7  * \author John Levon
8  * \author Abdelrazak Younes
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef LYX_APPLICATION_H
14 #define LYX_APPLICATION_H
15
16 #include "GuiImplementation.h"
17 #include "FontLoader.h"
18
19 #include <QApplication>
20
21 ///////////////////////////////////////////////////////////////
22 // Specific stuff
23
24 #ifdef Q_WS_MACX
25 #include <Carbon/Carbon.h>
26 #endif
27 ///////////////////////////////////////////////////////////////
28
29 class BufferView;
30
31 namespace lyx {
32 namespace frontend {
33
34 class GuiWorkArea;
35
36 /// The Qt main application class
37 /**
38 There should be only one instance of this class. No Qt object
39 initialisation should be done before the instanciation of this class.
40
41 \todo The work areas handling could be moved to a base virtual class
42 comon to all frontends.
43 */
44 class Application : public QApplication
45 {
46 public:
47         Application(int & argc, char ** argv);
48
49         //
50         Gui & gui() { return gui_; }
51         ///
52         FontLoader & fontLoader() { return font_loader_; }
53         ///
54         void setBufferView(BufferView * buffer_view);
55
56 private:
57         ///
58         BufferView * buffer_view_;
59
60         ///
61         GuiImplementation gui_;
62
63         ///
64         FontLoader font_loader_;
65
66 #ifdef Q_WS_X11
67 public:
68         bool x11EventFilter (XEvent * ev);
69 #endif
70
71 #ifdef Q_WS_MACX
72 public:
73         bool macEventFilter(EventRef event);
74 private:
75 //      static OSStatus handleOpenDocuments(
76         static pascal OSErr     handleOpenDocuments(
77                 const AppleEvent* inEvent, AppleEvent*, long);
78 #endif
79 }; // Application
80
81 } // namespace frontend
82 } // namespace lyx
83
84 extern lyx::frontend::Application * theApp;
85
86
87 #endif // LYX_APPLICATION_H