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 /// display a message in the view
74 virtual void message(docstring const &) = 0;
77 virtual FuncStatus getStatus(FuncRequest const & cmd) = 0;
78 /// dispatch to current BufferView
79 virtual void dispatch(FuncRequest const & cmd) = 0;
82 virtual void restartCursor() = 0;
87 virtual void errors(std::string const &) = 0;
90 // This View's Dialogs
93 /** \param name == "bibtex", "citation" etc; an identifier used to
94 launch a particular dialog.
95 \param data is a string representation of the Inset contents.
96 It is often little more than the output from Inset::write.
97 It is passed to, and parsed by, the frontend dialog.
98 Several of these dialogs do not need any data,
99 so it defaults to string().
100 \param inset ownership is _not_ passed to the frontend dialog.
101 It is stored internally and used by the kernel to ascertain
102 what to do with the FuncRequest dispatched from the frontend
103 dialog on 'Apply'; should it be used to create a new inset at
104 the current cursor position or modify an existing, 'open' inset?
106 virtual void showDialog(std::string const & name,
107 std::string const & data, Inset * inset = 0) = 0;
110 virtual void disconnectDialog(std::string const & name) = 0;
112 virtual Inset * getOpenInset(std::string const & name) const = 0;
116 LyXView(LyXView const &);
117 void operator=(LyXView const &);
120 } // namespace frontend