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;
35 QWidget* mainWindow();
38 * GuiView - Qt4 implementation of LyXView
40 * qt4-private implementation of the main LyX window.
42 * Note: a QObject emits a destroyed(QObject *) Qt signal when it
43 * is deleted. This might be useful for closing other dialogs
44 * depending on a given GuiView.
46 class GuiViewBase : public QMainWindow, public LyXView {
49 /// create a main window of the given dimensions
56 virtual void setFocus();
57 virtual void setGeometry(
62 unsigned int iconSizeXY,
63 const std::string & geometryArg);
64 virtual void saveGeometry();
65 virtual void busy(bool);
66 /// add toolbar, if newline==true, add a toolbar break before the toolbar
67 Toolbars::ToolbarPtr makeToolbar(ToolbarInfo const & tbinfo, bool newline);
68 virtual void updateStatusBar();
69 virtual void message(docstring const & str);
70 virtual void clearMessage();
71 virtual bool hasFocus() const;
72 void showMiniBuffer(bool);
73 void openMenu(docstring const &);
75 /// show - display the top-level window
78 /// menu item has been selected
79 void activated(FuncRequest const &);
81 QMenu* createPopupMenu();
88 void update_view_state_qt();
90 void currentTabChanged(int index);
91 void closeCurrentTab();
93 /// slots to change the icon size
94 void smallSizedIcons();
95 void normalSizedIcons();
99 /// make sure we quit cleanly
100 virtual void closeEvent(QCloseEvent * e);
103 virtual void resizeEvent(QResizeEvent * e);
106 virtual void moveEvent(QMoveEvent * e);
108 /// \return the \c Workarea associated to \p Buffer
109 /// \retval 0 if no \c WorkArea is found.
110 WorkArea * workArea(Buffer & buffer);
112 /// Add a \c WorkArea
113 /// \return the \c Workarea associated to \p Buffer
114 /// \retval 0 if no \c WorkArea is found.
115 WorkArea * addWorkArea(Buffer & buffer);
116 void setCurrentWorkArea(WorkArea * work_area);
117 void removeWorkArea(WorkArea * work_area);
118 WorkArea const * currentWorkArea() const;
119 WorkArea * currentWorkArea();
123 void dragEnterEvent(QDragEnterEvent * ev);
125 void dropEvent(QDropEvent * ev);
128 * setWindowTitle - set title of window
129 * @param t main window title
130 * @param it iconified (short) title
132 virtual void setWindowTitle(docstring const & t, docstring const & it);
134 /// in order to catch Tab key press.
135 bool event(QEvent * e);
136 bool focusNextPrevChild(bool);
138 QTimer statusbar_timer_;
140 /// are we quitting by the menu?
141 bool quitting_by_menu_;
144 QRect updateFloatingGeometry();
146 QRect floatingGeometry_;
148 void setIconSize(unsigned int size);
157 ToolbarSize toolbarSize_;
159 struct GuiViewPrivate;
163 } // namespace frontend