4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjornes
9 * \author Abdelrazak Younes
11 * Full author contact details are available in file CREDITS.
17 // Must be here because of moc.
20 #include "GuiImplementation.h"
22 #include "frontends/LyXView.h"
23 #include "funcrequest.h"
25 #include <QMainWindow>
28 #include <QCloseEvent>
41 QWidget* mainWindow();
44 * QtView - Qt implementation of LyXView
46 * Qt-private implementation of the main LyX window.
48 class QtView : public QMainWindow, public LyXView {
51 /// create a main window of the given dimensions
52 QtView(unsigned int w, unsigned int h);
56 /// show - display the top-level window
60 virtual void busy(bool) const;
62 /// display a status message
63 virtual void message(std::string const & str);
65 /// clear status message
66 virtual void clearMessage();
68 /// add the command buffer
69 void addCommandBuffer(QToolBar * toolbar);
71 /// menu item has been selected
72 void activated(FuncRequest const &);
74 // returns true if this view has the focus.
75 virtual bool hasFocus() const;
78 Gui & gui() { return frontend_; }
80 static QMainWindow* mainWidget();
84 void update_view_state_qt();
86 /// populate a toplevel menu and all its children on demand
87 void updateMenu(QAction *);
90 /// make sure we quit cleanly
91 virtual void closeEvent(QCloseEvent * e);
93 /// focus the command buffer widget
94 void focus_command_widget();
97 void update_view_state();
100 * setWindowTitle - set title of window
101 * @param t main window title
102 * @param it iconified (short) title
104 virtual void setWindowTitle(std::string const & t, std::string const & it);
106 QTimer statusbar_timer_;
109 QCommandBuffer * commandbuffer_;
112 static QMainWindow* mainWidget_;
114 GuiImplementation frontend_;
117 } // namespace frontend