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; }
32 * LyXView - main LyX window
34 * This class represents the main LyX window and provides
35 * accessor functions to its content.
37 * The eventual intention is that LyX will support a number
38 * of containing LyXViews. Currently a lot of code still
39 * relies on there being a single top-level view.
41 * Additionally we would like to support multiple views
42 * in a single LyXView.
45 : public GuiBufferViewDelegate, public GuiBufferDelegate
53 virtual int id() const = 0;
55 virtual void close() = 0;
58 virtual void setBusy(bool) = 0;
60 //@{ generic accessor functions
62 /// \return the current buffer view.
63 virtual BufferView * view() = 0;
65 /// \return the buffer currently shown in this window
66 virtual Buffer * buffer() = 0;
67 virtual Buffer const * buffer() const = 0;
68 /// set a buffer to the current workarea.
69 virtual void setBuffer(Buffer * b) = 0; ///< \c Buffer to set.
73 /// updates the possible layouts selectable
74 virtual void updateLayoutChoice(bool force) = 0;
75 /// update the toolbar
76 virtual void updateToolbars() = 0;
77 /// update the status bar
78 virtual void updateStatusBar() = 0;
79 /// display a message in the view
80 virtual void message(docstring const &) = 0;
83 virtual FuncStatus getStatus(FuncRequest const & cmd) = 0;
84 /// dispatch to current BufferView
85 virtual void dispatch(FuncRequest const & cmd) = 0;
87 /** redraw \c inset in all the BufferViews in which it is currently
88 * visible. If successful return a pointer to the owning Buffer.
90 virtual Buffer const * updateInset(Inset const *) = 0;
92 /// returns true if this view has the focus.
93 virtual bool hasFocus() const = 0;
96 virtual void restartCursor() = 0;
101 virtual void errors(std::string const &) = 0;
105 // This View's Dialogs
108 /// Hide all visible dialogs
109 virtual void hideAll() const = 0;
111 /** \param name == "bibtex", "citation" etc; an identifier used to
112 launch a particular dialog.
113 \param data is a string representation of the Inset contents.
114 It is often little more than the output from Inset::write.
115 It is passed to, and parsed by, the frontend dialog.
116 Several of these dialogs do not need any data,
117 so it defaults to string().
118 \param inset ownership is _not_ passed to the frontend dialog.
119 It is stored internally and used by the kernel to ascertain
120 what to do with the FuncRequest dispatched from the frontend
121 dialog on 'Apply'; should it be used to create a new inset at
122 the current cursor position or modify an existing, 'open' inset?
124 virtual void showDialog(std::string const & name,
125 std::string const & data, Inset * inset = 0) = 0;
128 virtual void disconnectDialog(std::string const & name) = 0;
130 virtual Inset * getOpenInset(std::string const & name) const = 0;
134 LyXView(LyXView const &);
135 void operator=(LyXView const &);
138 } // namespace frontend