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 #include "frontends/LyXView.h"
19 #include "FuncRequest.h"
22 #include <QCloseEvent>
23 #include <QMainWindow>
26 class QDragEnterEvent;
37 QWidget* mainWindow();
40 * GuiView - Qt4 implementation of LyXView
42 * qt4-private implementation of the main LyX window.
44 * Note: any QObject emits a destroyed(QObject *) Qt signal when it
45 * is deleted.This might be useful for closing other dialogs
46 * depending on a given GuiView.
48 class GuiView : public QMainWindow, public LyXView {
51 /// create a main window of the given dimensions
58 virtual void setFocus();
59 virtual void setGeometry(
64 unsigned int iconSizeXY,
65 const std::string & geometryArg);
66 virtual void saveGeometry();
67 virtual void busy(bool);
68 /// add toolbar, if newline==true, add a toolbar break before the toolbar
69 Toolbars::ToolbarPtr makeToolbar(ToolbarInfo const & tbinfo, bool newline);
70 virtual void updateStatusBar();
71 virtual void message(docstring const & str);
72 virtual void clearMessage();
73 virtual bool hasFocus() const;
75 /// show - display the top-level window
78 /// add the command buffer
79 void addCommandBuffer(QToolBar * toolbar);
81 /// menu item has been selected
82 void activated(FuncRequest const &);
84 QMenu* createPopupMenu();
91 void update_view_state_qt();
93 /// populate a toplevel menu and all its children on demand
94 void updateMenu(QAction *);
96 void currentTabChanged(int index);
97 void closeCurrentTab();
99 /// slots to change the icon size
100 void smallSizedIcons();
101 void normalSizedIcons();
102 void bigSizedIcons();
105 /// make sure we quit cleanly
106 virtual void closeEvent(QCloseEvent * e);
109 virtual void resizeEvent(QResizeEvent * e);
112 virtual void moveEvent(QMoveEvent * e);
114 /// \return the \c Workarea associated to \p Buffer
115 /// \retval 0 if no \c WorkArea is found.
116 WorkArea * workArea(Buffer & buffer);
118 /// Add a \c WorkArea
119 /// \return the \c Workarea associated to \p Buffer
120 /// \retval 0 if no \c WorkArea is found.
121 WorkArea * addWorkArea(Buffer & buffer);
122 void setCurrentWorkArea(WorkArea * work_area);
123 void removeWorkArea(WorkArea * work_area);
124 WorkArea const * currentWorkArea() const;
125 WorkArea * currentWorkArea();
129 void dragEnterEvent(QDragEnterEvent * ev);
131 void dropEvent(QDropEvent * ev);
133 /// focus the command buffer widget
134 void focus_command_widget();
137 * setWindowTitle - set title of window
138 * @param t main window title
139 * @param it iconified (short) title
141 virtual void setWindowTitle(docstring const & t, docstring const & it);
143 /// in order to catch Tab key press.
144 bool event(QEvent * e);
145 bool focusNextPrevChild(bool);
147 QTimer statusbar_timer_;
150 QCommandBuffer * commandbuffer_;
152 /// are we quitting by the menu?
153 bool quitting_by_menu_;
156 QRect updateFloatingGeometry();
158 QRect floatingGeometry_;
160 void setIconSize(unsigned int size);
169 ToolbarSize toolbarSize_;
171 struct GuiViewPrivate;
175 } // namespace frontend