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"
25 #include <QCloseEvent>
26 #include <QMainWindow>
29 class QDragEnterEvent;
40 QWidget* mainWindow();
43 * GuiView - Qt4 implementation of LyXView
45 * qt4-private implementation of the main LyX window.
47 * Note: any QObject emits a destroyed(QObject *) Qt signal when it
48 * is deleted.This might be useful for closing other dialogs
49 * depending on a given GuiView.
51 class GuiView : public QMainWindow, public LyXView {
54 /// create a main window of the given dimensions
61 virtual void setFocus();
62 virtual void setGeometry(
67 unsigned int iconSizeXY,
68 const std::string & geometryArg);
69 virtual void saveGeometry();
70 virtual void busy(bool);
71 /// add toolbar, if newline==true, add a toolbar break before the toolbar
72 Toolbars::ToolbarPtr makeToolbar(ToolbarInfo const & tbinfo, bool newline);
73 virtual void updateStatusBar();
74 virtual void message(docstring const & str);
75 virtual void clearMessage();
76 virtual bool hasFocus() const;
78 virtual void updateTab();
80 /// show - display the top-level window
83 /// add the command buffer
84 void addCommandBuffer(QToolBar * toolbar);
86 /// menu item has been selected
87 void activated(FuncRequest const &);
89 void initTab(QWidget* workArea);
91 QMenu* createPopupMenu();
98 void update_view_state_qt();
100 /// populate a toplevel menu and all its children on demand
101 void updateMenu(QAction *);
103 void currentTabChanged(int index);
104 void closeCurrentTab();
106 /// slots to change the icon size
107 void smallSizedIcons();
108 void normalSizedIcons();
109 void bigSizedIcons();
112 /// make sure we quit cleanly
113 virtual void closeEvent(QCloseEvent * e);
116 virtual void resizeEvent(QResizeEvent * e);
119 virtual void moveEvent(QMoveEvent * e);
123 void dragEnterEvent(QDragEnterEvent * ev);
125 void dropEvent(QDropEvent * ev);
127 /// focus the command buffer widget
128 void focus_command_widget();
131 * setWindowTitle - set title of window
132 * @param t main window title
133 * @param it iconified (short) title
135 virtual void setWindowTitle(docstring const & t, docstring const & it);
137 /// in order to catch Tab key press.
138 bool event(QEvent * e);
139 bool focusNextPrevChild(bool);
141 QTimer statusbar_timer_;
144 QCommandBuffer * commandbuffer_;
146 /// are we quitting by the menu?
147 bool quitting_by_menu_;
150 QRect updateFloatingGeometry();
152 QRect floatingGeometry_;
154 void setIconSize(unsigned int size);
163 ToolbarSize toolbarSize_;
165 struct GuiViewPrivate;
169 } // namespace frontend