4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
10 * Full author contact details are available in file CREDITS.
16 #include "frontends/Delegates.h"
17 #include "support/strfwd.h"
23 namespace support { class FileName; }
36 * LyXView - main LyX window
38 * This class represents the main LyX window and provides
39 * accessor functions to its content.
41 * The eventual intention is that LyX will support a number
42 * of containing LyXViews. Currently a lot of code still
43 * relies on there being a single top-level view.
45 * Additionally we would like to support multiple views
46 * in a single LyXView.
49 : public GuiBufferViewDelegate, public GuiBufferDelegate
53 LyXView(int id) : id_(id) {}
57 int id() const { return id_; }
59 virtual void close() = 0;
61 virtual void setFocus() = 0;
64 * This is called after the concrete view has been created.
65 * We have to have the toolbar and the other stuff created
66 * before we can populate it with this call.
68 virtual void init() = 0;
73 HorizontallyMaximized,
78 virtual void setGeometry(
83 unsigned int iconSizeXY,
84 const std::string & geometryArg) = 0;
87 virtual void setBusy(bool) = 0;
89 //@{ generic accessor functions
91 /// \return the current buffer view.
92 virtual BufferView * view() = 0;
94 /// \return the buffer currently shown in this window
95 virtual Buffer * buffer() = 0;
96 virtual Buffer const * buffer() const = 0;
97 /// set a buffer to the current workarea.
98 virtual void setBuffer(Buffer * b) = 0; ///< \c Buffer to set.
101 virtual void openLayoutList() = 0;
103 virtual bool isToolbarVisible(std::string const & id) = 0;
105 virtual void showMiniBuffer(bool visible) = 0;
106 virtual void openMenu(docstring const & name) = 0;
108 /// get access to the dialogs
109 virtual Dialogs & getDialogs() = 0;
111 virtual Dialogs const & getDialogs() const = 0;
115 /// load a buffer into the current workarea.
116 virtual Buffer * loadLyXFile(support::FileName const & name, ///< File to load.
117 bool tolastfiles = true) = 0; ///< append to the "Open recent" menu?
119 /// updates the possible layouts selectable
120 virtual void updateLayoutChoice(bool force) = 0;
122 /// update the toolbar
123 virtual void updateToolbars() = 0;
125 virtual ToolbarInfo * getToolbarInfo(std::string const & name) = 0;
126 /// toggle toolbar state
127 virtual void toggleToolbarState(std::string const & name, bool allowauto) = 0;
128 /// update the status bar
129 virtual void updateStatusBar() = 0;
131 /// display a message in the view
132 virtual void message(docstring const &) = 0;
134 /// clear any temporary message and replace with current status
135 virtual void clearMessage() = 0;
137 /// dispatch to current BufferView
138 virtual void dispatch(FuncRequest const & cmd) = 0;
140 /** redraw \c inset in all the BufferViews in which it is currently
141 * visible. If successful return a pointer to the owning Buffer.
143 virtual Buffer const * updateInset(Inset const *) = 0;
145 /// returns true if this view has the focus.
146 virtual bool hasFocus() const = 0;
150 virtual void restartCursor() = 0;
155 virtual void errors(std::string const &) = 0;
159 LyXView(LyXView const &);
160 void operator=(LyXView const &);
166 } // namespace frontend