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 "support/strfwd.h"
20 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.
52 virtual int id() const = 0;
55 virtual void setBusy(bool) = 0;
57 //@{ generic accessor functions
59 /// \return the currently selected buffer view.
60 virtual BufferView * currentBufferView() = 0;
61 virtual BufferView const * currentBufferView() const = 0;
62 /// \return the current document buffer view.
63 virtual BufferView * documentBufferView() = 0;
64 virtual BufferView const * documentBufferView() const = 0;
66 /// set a buffer to the current workarea.
67 virtual void setBuffer(Buffer * b) = 0; ///< \c Buffer to set.
69 /// load a document into the current workarea.
70 virtual Buffer * loadDocument(
71 support::FileName const & name, ///< File to load.
72 bool tolastfiles = true ///< append to the "Open recent" menu?
75 virtual void newDocument(std::string const & filename,
76 bool fromTemplate) = 0;
80 /// display a message in the view
81 virtual void message(docstring const &) = 0;
84 virtual bool getStatus(FuncRequest const & cmd, FuncStatus & flag) = 0;
86 /// \return true if the \c FuncRequest has been dispatched.
87 virtual bool dispatch(FuncRequest const & cmd) = 0;
90 virtual void restartCursor() = 0;
92 /// Update the completion popup and the inline completion state.
93 /// If \c start is true, then a new completion might be started.
94 /// If \c keep is true, an active completion will be kept active
95 /// even though the cursor moved. The update flags of \c cur might
97 virtual void updateCompletion(Cursor & cur, bool start, bool keep) = 0;
101 LyXView(LyXView const &);
102 void operator=(LyXView const &);
105 } // namespace frontend