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);
76 /// show - display the top-level window
79 /// add the command buffer
80 void addCommandBuffer(QToolBar * toolbar);
82 /// menu item has been selected
83 void activated(FuncRequest const &);
85 QMenu* createPopupMenu();
92 void update_view_state_qt();
94 /// populate a toplevel menu and all its children on demand
95 void updateMenu(QAction *);
97 void currentTabChanged(int index);
98 void closeCurrentTab();
100 /// slots to change the icon size
101 void smallSizedIcons();
102 void normalSizedIcons();
103 void bigSizedIcons();
106 /// make sure we quit cleanly
107 virtual void closeEvent(QCloseEvent * e);
110 virtual void resizeEvent(QResizeEvent * e);
113 virtual void moveEvent(QMoveEvent * e);
115 /// \return the \c Workarea associated to \p Buffer
116 /// \retval 0 if no \c WorkArea is found.
117 WorkArea * workArea(Buffer & buffer);
119 /// Add a \c WorkArea
120 /// \return the \c Workarea associated to \p Buffer
121 /// \retval 0 if no \c WorkArea is found.
122 WorkArea * addWorkArea(Buffer & buffer);
123 void setCurrentWorkArea(WorkArea * work_area);
124 void removeWorkArea(WorkArea * work_area);
125 WorkArea const * currentWorkArea() const;
126 WorkArea * currentWorkArea();
130 void dragEnterEvent(QDragEnterEvent * ev);
132 void dropEvent(QDropEvent * ev);
135 * setWindowTitle - set title of window
136 * @param t main window title
137 * @param it iconified (short) title
139 virtual void setWindowTitle(docstring const & t, docstring const & it);
141 /// in order to catch Tab key press.
142 bool event(QEvent * e);
143 bool focusNextPrevChild(bool);
145 QTimer statusbar_timer_;
148 QCommandBuffer * commandbuffer_;
150 /// are we quitting by the menu?
151 bool quitting_by_menu_;
154 QRect updateFloatingGeometry();
156 QRect floatingGeometry_;
158 void setIconSize(unsigned int size);
167 ToolbarSize toolbarSize_;
169 struct GuiViewPrivate;
173 } // namespace frontend