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;
34 QWidget * mainWindow();
37 * GuiView - Qt4 implementation of LyXView
39 * qt4-private implementation of the main LyX window.
41 * Note: a QObject emits a destroyed(QObject *) Qt signal when it
42 * is deleted. This might be useful for closing other dialogs
43 * depending on a given GuiView.
45 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 Toolbar * 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);
102 virtual void resizeEvent(QResizeEvent * e);
104 virtual void moveEvent(QMoveEvent * e);
106 /// \return the \c Workarea associated to \p Buffer
107 /// \retval 0 if no \c WorkArea is found.
108 WorkArea * workArea(Buffer & buffer);
110 /// Add a \c WorkArea
111 /// \return the \c Workarea associated to \p Buffer
112 /// \retval 0 if no \c WorkArea is found.
113 WorkArea * addWorkArea(Buffer & buffer);
114 void setCurrentWorkArea(WorkArea * work_area);
115 void removeWorkArea(WorkArea * work_area);
116 WorkArea const * currentWorkArea() const;
117 WorkArea * currentWorkArea();
121 void dragEnterEvent(QDragEnterEvent * ev);
123 void dropEvent(QDropEvent * ev);
126 * setWindowTitle - set title of window
127 * @param t main window title
128 * @param it iconified (short) title
130 virtual void setWindowTitle(docstring const & t, docstring const & it);
132 /// in order to catch Tab key press.
133 bool event(QEvent * e);
134 bool focusNextPrevChild(bool);
136 QTimer statusbar_timer_;
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