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"
21 namespace support { class FileName; }
33 * LyXView - main LyX window
35 * This class represents the main LyX window and provides
36 * accessor functions to its content.
38 * The eventual intention is that LyX will support a number
39 * of containing LyXViews. Currently a lot of code still
40 * relies on there being a single top-level view.
42 * Additionally we would like to support multiple views
43 * in a single LyXView.
46 : public GuiBufferViewDelegate, public GuiBufferDelegate
50 LyXView(int id) : id_(id) {}
54 int id() const { return id_; }
56 virtual void close() = 0;
58 virtual void setFocus() = 0;
61 * This is called after the concrete view has been created.
62 * We have to have the toolbar and the other stuff created
63 * before we can populate it with this call.
65 virtual void init() = 0;
70 HorizontallyMaximized,
75 virtual void setGeometry(
80 unsigned int iconSizeXY,
81 const std::string & geometryArg) = 0;
84 virtual void setBusy(bool) = 0;
86 //@{ generic accessor functions
88 /// \return the current buffer view.
89 virtual BufferView * view() = 0;
91 /// \return the buffer currently shown in this window
92 virtual Buffer * buffer() = 0;
93 virtual Buffer const * buffer() const = 0;
94 /// set a buffer to the current workarea.
95 virtual void setBuffer(Buffer * b) = 0; ///< \c Buffer to set.
98 virtual bool isToolbarVisible(std::string const & id) = 0;
100 /// get access to the dialogs
101 virtual Dialogs & getDialogs() = 0;
103 virtual Dialogs const & getDialogs() const = 0;
107 /// load a buffer into the current workarea.
108 virtual Buffer * loadLyXFile(support::FileName const & name, ///< File to load.
109 bool tolastfiles = true) = 0; ///< append to the "Open recent" menu?
111 /// updates the possible layouts selectable
112 virtual void updateLayoutChoice(bool force) = 0;
113 /// update the toolbar
114 virtual void updateToolbars() = 0;
115 /// update the status bar
116 virtual void updateStatusBar() = 0;
117 /// display a message in the view
118 virtual void message(docstring const &) = 0;
120 /// dispatch to current BufferView
121 virtual void dispatch(FuncRequest const & cmd) = 0;
123 /** redraw \c inset in all the BufferViews in which it is currently
124 * visible. If successful return a pointer to the owning Buffer.
126 virtual Buffer const * updateInset(Inset const *) = 0;
128 /// returns true if this view has the focus.
129 virtual bool hasFocus() const = 0;
132 virtual void restartCursor() = 0;
137 virtual void errors(std::string const &) = 0;
141 LyXView(LyXView const &);
142 void operator=(LyXView const &);
148 } // namespace frontend