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; }
34 * LyXView - main LyX window
36 * This class represents the main LyX window and provides
37 * accessor functions to its content.
39 * The eventual intention is that LyX will support a number
40 * of containing LyXViews. Currently a lot of code still
41 * relies on there being a single top-level view.
43 * Additionally we would like to support multiple views
44 * in a single LyXView.
47 : public GuiBufferViewDelegate, public GuiBufferDelegate
51 LyXView(int id) : id_(id) {}
55 int id() const { return id_; }
57 virtual void close() = 0;
59 virtual void setFocus() = 0;
62 * This is called after the concrete view has been created.
63 * We have to have the toolbar and the other stuff created
64 * before we can populate it with this call.
66 virtual void init() = 0;
71 HorizontallyMaximized,
76 virtual void setGeometry(
81 unsigned int iconSizeXY,
82 const std::string & geometryArg) = 0;
85 virtual void setBusy(bool) = 0;
87 //@{ generic accessor functions
89 /// \return the current buffer view.
90 virtual BufferView * view() = 0;
92 /// \return the buffer currently shown in this window
93 virtual Buffer * buffer() = 0;
94 virtual Buffer const * buffer() const = 0;
95 /// set a buffer to the current workarea.
96 virtual void setBuffer(Buffer * b) = 0; ///< \c Buffer to set.
99 virtual void openLayoutList() = 0;
101 virtual bool isToolbarVisible(std::string const & id) = 0;
103 virtual void showMiniBuffer(bool visible) = 0;
104 virtual void openMenu(docstring const & name) = 0;
106 /// get access to the dialogs
107 virtual Dialogs & getDialogs() = 0;
109 virtual Dialogs const & getDialogs() const = 0;
113 /// load a buffer into the current workarea.
114 virtual Buffer * loadLyXFile(support::FileName const & name, ///< File to load.
115 bool tolastfiles = true) = 0; ///< append to the "Open recent" menu?
117 /// updates the possible layouts selectable
118 virtual void updateLayoutChoice(bool force) = 0;
119 /// update the toolbar
120 virtual void updateToolbars() = 0;
122 virtual ToolbarInfo * getToolbarInfo(std::string const & name) = 0;
123 /// toggle toolbar state
124 virtual void toggleToolbarState(std::string const & name, bool allowauto) = 0;
125 /// update the status bar
126 virtual void updateStatusBar() = 0;
127 /// display a message in the view
128 virtual void message(docstring const &) = 0;
130 /// dispatch to current BufferView
131 virtual void dispatch(FuncRequest const & cmd) = 0;
133 /** redraw \c inset in all the BufferViews in which it is currently
134 * visible. If successful return a pointer to the owning Buffer.
136 virtual Buffer const * updateInset(Inset const *) = 0;
138 /// returns true if this view has the focus.
139 virtual bool hasFocus() const = 0;
142 virtual void restartCursor() = 0;
147 virtual void errors(std::string const &) = 0;
151 LyXView(LyXView const &);
152 void operator=(LyXView const &);
158 } // namespace frontend