]> git.lyx.org Git - lyx.git/blob - src/frontends/LyXView.h
add a dispatchresult parameter to lyxview::dispatch
[lyx.git] / src / frontends / LyXView.h
1 // -*- C++ -*-
2 /**
3  * \file LyXView.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  * \author John Levon
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef LYXVIEW_H
14 #define LYXVIEW_H
15
16 #include "support/strfwd.h"
17
18 namespace lyx {
19
20 namespace support { class FileName; }
21
22 class Buffer;
23 class BufferView;
24 class Cursor;
25 class DispatchResult;
26 class FuncStatus;
27 class FuncRequest;
28 class Inset;
29
30 namespace frontend {
31
32 /**
33  * LyXView - main LyX window
34  *
35  * This class represents the main LyX window and provides
36  * accessor functions to its content.
37  *
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.
41  *
42  * Additionally we would like to support multiple views
43  * in a single LyXView.
44  */
45 class LyXView
46 {
47 public:
48         ///
49         virtual ~LyXView() {}
50
51         /// \name Generic accessor functions
52         //@{
53         /// \return the currently selected buffer view.
54         virtual BufferView * currentBufferView() = 0;
55         virtual BufferView const * currentBufferView() const = 0;
56         /// \return the current document buffer view.
57         virtual BufferView * documentBufferView() = 0;
58         virtual BufferView const * documentBufferView() const = 0;
59         //@}
60
61         /// display a message in the view
62         virtual void message(docstring const &) = 0;
63
64         ///
65         virtual bool getStatus(FuncRequest const & cmd, FuncStatus & flag) = 0;
66         /// dispatch command.
67         /// \return true if the \c FuncRequest has been dispatched.
68         virtual void dispatch(FuncRequest const & cmd, DispatchResult & dr) = 0;
69
70         ///
71         virtual void restartCursor() = 0;
72
73         /// Update the completion popup and the inline completion state.
74         /// If \c start is true, then a new completion might be started.
75         /// If \c keep is true, an active completion will be kept active
76         /// even though the cursor moved. The update flags of \c cur might
77         /// be changed.
78         virtual void updateCompletion(Cursor & cur, bool start, bool keep) = 0;
79 };
80
81 } // namespace frontend
82 } // namespace lyx
83
84 #endif // LYXVIEW_H