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;
36 QWidget * mainWindow();
39 * GuiView - Qt4 implementation of LyXView
41 * qt4-private implementation of the main LyX window.
43 * Note: a QObject emits a destroyed(QObject *) Qt signal when it
44 * is deleted. This might be useful for closing other dialogs
45 * depending on a given GuiView.
47 class GuiViewBase : 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 GuiToolbar * 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 &);
76 void openLayoutList();
77 void updateLayoutChoice();
78 bool isToolbarVisible(std::string const & id);
79 void updateToolbars();
80 ToolbarInfo * getToolbarInfo(std::string const & name);
81 void toggleToolbarState(std::string const & name, bool allowauto);
83 /// show - display the top-level window
86 /// menu item has been selected
87 void activated(FuncRequest const &);
89 QMenu* createPopupMenu();
96 void update_view_state_qt();
98 void currentTabChanged(int index);
99 void closeCurrentTab();
101 /// slots to change the icon size
102 void smallSizedIcons();
103 void normalSizedIcons();
104 void bigSizedIcons();
107 /// make sure we quit cleanly
108 virtual void closeEvent(QCloseEvent * e);
110 virtual void resizeEvent(QResizeEvent * e);
112 virtual void moveEvent(QMoveEvent * e);
114 /// \return the \c Workarea associated to \p Buffer
115 /// \retval 0 if no \c WorkArea is found.
116 WorkArea * workArea(Buffer & buffer);
118 /// Add a \c WorkArea
119 /// \return the \c Workarea associated to \p Buffer
120 /// \retval 0 if no \c WorkArea is found.
121 WorkArea * addWorkArea(Buffer & buffer);
122 void setCurrentWorkArea(WorkArea * work_area);
123 void removeWorkArea(WorkArea * work_area);
124 WorkArea const * currentWorkArea() const;
125 WorkArea * currentWorkArea();
129 void dragEnterEvent(QDragEnterEvent * ev);
131 void dropEvent(QDropEvent * ev);
134 * setWindowTitle - set title of window
135 * @param t main window title
136 * @param it iconified (short) title
138 virtual void setWindowTitle(docstring const & t, docstring const & it);
140 /// in order to catch Tab key press.
141 bool event(QEvent * e);
142 bool focusNextPrevChild(bool);
144 QTimer statusbar_timer_;
146 /// are we quitting by the menu?
147 bool quitting_by_menu_;
150 QRect updateFloatingGeometry();
152 QRect floatingGeometry_;
154 void setIconSize(unsigned int size);
163 ToolbarSize toolbarSize_;
165 struct GuiViewPrivate;
169 } // namespace frontend