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
10 * \author Peter Kümmel
12 * Full author contact details are available in file CREDITS.
18 // Must be here because of moc.
21 #include "frontends/LyXView.h"
22 #include "funcrequest.h"
24 #include <QMainWindow>
27 #include <QCloseEvent>
38 QWidget* mainWindow();
41 * GuiView - Qt4 implementation of LyXView
43 * qt4-private implementation of the main LyX window.
45 * Note: any QObject emits a destroyed(QObject *) Qt signal when it
46 * is deleted.This might be useful for closing other dialogs
47 * depending on a given GuiView.
49 class GuiView : public QMainWindow, public LyXView {
52 /// create a main window of the given dimensions
59 virtual void setFocus();
60 virtual void setGeometry(
65 unsigned int iconSizeXY,
66 const std::string & geometryArg);
67 virtual void saveGeometry();
68 virtual void busy(bool);
69 /// add toolbar, if newline==true, add a toolbar break before the toolbar
70 Toolbars::ToolbarPtr makeToolbar(ToolbarBackend::Toolbar const & tbb, bool newline);
71 virtual void updateStatusBar();
72 virtual void message(lyx::docstring const & str);
73 virtual void clearMessage();
74 virtual bool hasFocus() const;
76 virtual void updateTab();
78 /// show - display the top-level window
81 /// add the command buffer
82 void addCommandBuffer(QToolBar * toolbar);
84 /// menu item has been selected
85 void activated(FuncRequest const &);
87 void initTab(QWidget* workArea);
89 QMenu* createPopupMenu();
96 void update_view_state_qt();
98 /// populate a toplevel menu and all its children on demand
99 void updateMenu(QAction *);
101 void currentTabChanged (int index);
103 /// slots to change the icon size
104 void smallSizedIcons();
105 void normalSizedIcons();
106 void bigSizedIcons();
109 /// make sure we quit cleanly
110 virtual void closeEvent(QCloseEvent * e);
113 virtual void resizeEvent(QResizeEvent * e);
116 virtual void moveEvent(QMoveEvent * e);
119 /// focus the command buffer widget
120 void focus_command_widget();
123 * setWindowTitle - set title of window
124 * @param t main window title
125 * @param it iconified (short) title
127 virtual void setWindowTitle(lyx::docstring const & t, lyx::docstring const & it);
129 /// in order to catch Tab key press.
130 bool event(QEvent * e);
131 bool focusNextPrevChild(bool);
133 QTimer statusbar_timer_;
136 QCommandBuffer * commandbuffer_;
138 /// are we quitting by the menu?
139 bool quitting_by_menu_;
142 QRect updateFloatingGeometry();
144 QRect floatingGeometry_;
146 void setIconSize(unsigned int size);
155 ToolbarSize toolbarSize_;
157 struct GuiViewPrivate;
161 } // namespace frontend