]> git.lyx.org Git - lyx.git/blob - src/frontends/LyXView.h
Finally add some comments to the currentBufferView() and documentBufferView() functions.
[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         /// The current BufferView refers to the BufferView that has the focus,
54         /// including for example the one that is created when you use the
55         /// advanced search and replace pane.
56         /// \return the currently selected buffer view.
57         virtual BufferView * currentBufferView() = 0;
58         virtual BufferView const * currentBufferView() const = 0;
59
60         /// The document BufferView always refers to the view's main document
61         /// BufferView. So, even if the BufferView in e.g., the advanced
62         /// search and replace pane has the focus.
63         /// \return the current document buffer view.
64         virtual BufferView * documentBufferView() = 0;
65         virtual BufferView const * documentBufferView() const = 0;
66         //@}
67
68         /// display a message in the view
69         virtual void message(docstring const &) = 0;
70
71         ///
72         virtual bool getStatus(FuncRequest const & cmd, FuncStatus & flag) = 0;
73         /// dispatch command.
74         /// \return true if the \c FuncRequest has been dispatched.
75         virtual void dispatch(FuncRequest const & cmd, DispatchResult & dr) = 0;
76
77         ///
78         virtual void restartCursor() = 0;
79
80         /// Update the completion popup and the inline completion state.
81         /// If \c start is true, then a new completion might be started.
82         /// If \c keep is true, an active completion will be kept active
83         /// even though the cursor moved. The update flags of \c cur might
84         /// be changed.
85         virtual void updateCompletion(Cursor & cur, bool start, bool keep) = 0;
86 };
87
88 } // namespace frontend
89 } // namespace lyx
90
91 #endif // LYXVIEW_H