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;
74 void showMiniBuffer(bool);
75 void openMenu(docstring const &);
77 /// show - display the top-level window
80 /// add the command buffer
81 void addCommandBuffer(QToolBar * toolbar);
83 /// menu item has been selected
84 void activated(FuncRequest const &);
86 QMenu* createPopupMenu();
93 void update_view_state_qt();
95 void currentTabChanged(int index);
96 void closeCurrentTab();
98 /// slots to change the icon size
99 void smallSizedIcons();
100 void normalSizedIcons();
101 void bigSizedIcons();
104 /// make sure we quit cleanly
105 virtual void closeEvent(QCloseEvent * e);
108 virtual void resizeEvent(QResizeEvent * e);
111 virtual void moveEvent(QMoveEvent * e);
113 /// \return the \c Workarea associated to \p Buffer
114 /// \retval 0 if no \c WorkArea is found.
115 WorkArea * workArea(Buffer & buffer);
117 /// Add a \c WorkArea
118 /// \return the \c Workarea associated to \p Buffer
119 /// \retval 0 if no \c WorkArea is found.
120 WorkArea * addWorkArea(Buffer & buffer);
121 void setCurrentWorkArea(WorkArea * work_area);
122 void removeWorkArea(WorkArea * work_area);
123 WorkArea const * currentWorkArea() const;
124 WorkArea * currentWorkArea();
128 void dragEnterEvent(QDragEnterEvent * ev);
130 void dropEvent(QDropEvent * ev);
133 * setWindowTitle - set title of window
134 * @param t main window title
135 * @param it iconified (short) title
137 virtual void setWindowTitle(docstring const & t, docstring const & it);
139 /// in order to catch Tab key press.
140 bool event(QEvent * e);
141 bool focusNextPrevChild(bool);
143 QTimer statusbar_timer_;
146 QCommandBuffer * commandbuffer_;
148 /// are we quitting by the menu?
149 bool quitting_by_menu_;
152 QRect updateFloatingGeometry();
154 QRect floatingGeometry_;
156 void setIconSize(unsigned int size);
165 ToolbarSize toolbarSize_;
167 struct GuiViewPrivate;
171 } // namespace frontend