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 // Must be here because of moc.
21 #include "frontends/LyXView.h"
22 #include "FuncRequest.h"
25 #include <QCloseEvent>
26 #include <QMainWindow>
29 class QDragEnterEvent;
40 QWidget* mainWindow();
43 * GuiView - Qt4 implementation of LyXView
45 * qt4-private implementation of the main LyX window.
47 * Note: any QObject emits a destroyed(QObject *) Qt signal when it
48 * is deleted.This might be useful for closing other dialogs
49 * depending on a given GuiView.
51 class GuiView : public QMainWindow, public LyXView {
54 /// create a main window of the given dimensions
61 virtual void setFocus();
62 virtual void setGeometry(
67 unsigned int iconSizeXY,
68 const std::string & geometryArg);
69 virtual void saveGeometry();
70 virtual void busy(bool);
71 /// add toolbar, if newline==true, add a toolbar break before the toolbar
72 Toolbars::ToolbarPtr makeToolbar(ToolbarInfo const & tbinfo, bool newline);
73 virtual void updateStatusBar();
74 virtual void message(docstring const & str);
75 virtual void clearMessage();
76 virtual bool hasFocus() const;
78 /// show - display the top-level window
81 /// add the command buffer
82 void addCommandBuffer(QToolBar * toolbar);
84 /// menu item has been selected
85 void activated(FuncRequest const &);
87 QMenu* createPopupMenu();
94 void update_view_state_qt();
96 /// populate a toplevel menu and all its children on demand
97 void updateMenu(QAction *);
99 void currentTabChanged(int index);
100 void closeCurrentTab();
102 /// slots to change the icon size
103 void smallSizedIcons();
104 void normalSizedIcons();
105 void bigSizedIcons();
108 /// make sure we quit cleanly
109 virtual void closeEvent(QCloseEvent * e);
112 virtual void resizeEvent(QResizeEvent * e);
115 virtual void moveEvent(QMoveEvent * e);
117 /// \return the \c Workarea associated to \p Buffer
118 /// \retval 0 if no \c WorkArea is found.
119 WorkArea * workArea(Buffer & buffer);
121 /// Add a \c WorkArea
122 /// \return the \c Workarea associated to \p Buffer
123 /// \retval 0 if no \c WorkArea is found.
124 WorkArea * addWorkArea(Buffer & buffer);
125 void setCurrentWorkArea(WorkArea * work_area);
126 void removeWorkArea(WorkArea * work_area);
127 WorkArea const * currentWorkArea() const;
128 WorkArea * currentWorkArea();
132 void dragEnterEvent(QDragEnterEvent * ev);
134 void dropEvent(QDropEvent * ev);
136 /// focus the command buffer widget
137 void focus_command_widget();
140 * setWindowTitle - set title of window
141 * @param t main window title
142 * @param it iconified (short) title
144 virtual void setWindowTitle(docstring const & t, docstring const & it);
146 /// in order to catch Tab key press.
147 bool event(QEvent * e);
148 bool focusNextPrevChild(bool);
150 QTimer statusbar_timer_;
153 QCommandBuffer * commandbuffer_;
155 /// are we quitting by the menu?
156 bool quitting_by_menu_;
159 QRect updateFloatingGeometry();
161 QRect floatingGeometry_;
163 void setIconSize(unsigned int size);
172 ToolbarSize toolbarSize_;
174 struct GuiViewPrivate;
178 } // namespace frontend