]> git.lyx.org Git - lyx.git/blob - src/frontends/LyXView.h
Embedding: add embedCB checkboxes to IncludeUi and ExternalUi
[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 FuncStatus;
25 class FuncRequest;
26 class Inset;
27
28 namespace frontend {
29
30 /**
31  * LyXView - main LyX window
32  *
33  * This class represents the main LyX window and provides
34  * accessor functions to its content.
35  *
36  * The eventual intention is that LyX will support a number
37  * of containing LyXViews. Currently a lot of code still
38  * relies on there being a single top-level view.
39  *
40  * Additionally we would like to support multiple views
41  * in a single LyXView.
42  */
43 class LyXView
44 {
45 public:
46         ///
47         LyXView() {}
48         ///
49         virtual ~LyXView() {}
50         ///
51         virtual int id() const = 0;
52         ///
53         virtual void close() = 0;
54
55         /// show busy cursor
56         virtual void setBusy(bool) = 0;
57
58         //@{ generic accessor functions
59
60         /// \return the current buffer view.
61         virtual BufferView * view() = 0;
62
63         /// \return the buffer currently shown in this window
64         virtual Buffer * buffer() = 0;
65         virtual Buffer const * buffer() const = 0;
66         /// set a buffer to the current workarea.
67         virtual void setBuffer(Buffer * b) = 0; ///< \c Buffer to set.
68         ///
69         virtual bool closeBuffer() = 0;
70         ///
71         virtual void newDocument(std::string const & filename,
72                 bool fromTemplate) = 0;
73
74         //@}
75
76         /// display a message in the view
77         virtual void message(docstring const &) = 0;
78
79         ///
80         virtual FuncStatus getStatus(FuncRequest const & cmd) = 0;
81         /// dispatch command.
82         /// \return true if the \c FuncRequest has been dispatched.
83         virtual bool dispatch(FuncRequest const & cmd) = 0;
84
85         ///
86         virtual void restartCursor() = 0;
87
88 private:
89         /// noncopyable
90         LyXView(LyXView const &);
91         void operator=(LyXView const &);
92 };
93
94 } // namespace frontend
95 } // namespace lyx
96
97 #endif // LYXVIEW_H