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>
27 class QDragEnterEvent;
38 QWidget * mainWindow();
41 * GuiView - Qt4 implementation of LyXView
43 * qt4-private implementation of the main LyX window.
45 * Note: a QObject emits a destroyed(QObject *) Qt signal when it
46 * is deleted. This might be useful for closing other dialogs
47 * depending on a given GuiView.
49 class GuiView : public QMainWindow, public LyXView
53 /// create a main window of the given dimensions
60 virtual void setFocus();
61 virtual void setGeometry(
66 unsigned int iconSizeXY,
67 const std::string & geometryArg);
68 virtual void saveGeometry();
69 virtual void setBusy(bool);
70 /// add toolbar, if newline==true, add a toolbar break before the toolbar
71 GuiToolbar * makeToolbar(ToolbarInfo const & tbinfo, bool newline);
72 virtual void updateStatusBar();
73 virtual void message(docstring const & str);
74 virtual void clearMessage();
75 virtual bool hasFocus() const;
76 void showMiniBuffer(bool);
77 void openMenu(docstring const &);
78 void openLayoutList();
79 void updateLayoutChoice(bool force);
80 bool isToolbarVisible(std::string const & id);
81 void updateToolbars();
82 ToolbarInfo * getToolbarInfo(std::string const & name);
83 void toggleToolbarState(std::string const & name, bool allowauto);
85 /// show - display the top-level window
88 /// menu item has been selected
89 void activated(FuncRequest const &);
91 QMenu* createPopupMenu();
93 void addTabWorkArea();
100 void update_view_state_qt();
103 void on_currentWorkAreaChanged(GuiWorkArea *);
105 /// slots to change the icon size
106 void smallSizedIcons();
107 void normalSizedIcons();
108 void bigSizedIcons();
111 /// make sure we quit cleanly
112 virtual void closeEvent(QCloseEvent * e);
114 virtual void resizeEvent(QResizeEvent * e);
116 virtual void moveEvent(QMoveEvent * e);
118 /// \return the \c Workarea associated to \p Buffer
119 /// \retval 0 if no \c WorkArea is found.
120 WorkArea * workArea(Buffer & buffer);
122 /// Add a \c WorkArea
123 /// \return the \c Workarea associated to \p Buffer
124 /// \retval 0 if no \c WorkArea is found.
125 WorkArea * addWorkArea(Buffer & buffer);
126 void setCurrentWorkArea(WorkArea * work_area);
127 void removeWorkArea(WorkArea * work_area);
128 WorkArea const * currentWorkArea() const;
129 WorkArea * currentWorkArea();
133 void dragEnterEvent(QDragEnterEvent * ev);
135 void dropEvent(QDropEvent * ev);
138 * setWindowTitle - set title of window
139 * @param t main window title
140 * @param it iconified (short) title
142 virtual void setWindowTitle(docstring const & t, docstring const & it);
144 /// in order to catch Tab key press.
145 bool event(QEvent * e);
146 bool focusNextPrevChild(bool);
148 QTimer statusbar_timer_;
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;
174 } // namespace frontend