]> git.lyx.org Git - lyx.git/blob - src/frontends/Delegates.h
Disable CheckTeX while buffer is processed
[lyx.git] / src / frontends / Delegates.h
1 // -*- C++ -*-
2 /**
3  * \file Delegates.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author André Pönitz
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef DELEGATES_H
13 #define DELEGATES_H
14
15 #include "support/strfwd.h"
16
17 namespace lyx {
18
19 class Buffer;
20 class DocIterator;
21 class Inset;
22
23 namespace frontend {
24
25 class GuiBufferViewDelegate
26 {
27 public:
28         virtual ~GuiBufferViewDelegate() {}
29
30         /// This function is called when some message shows up.
31         virtual void message(docstring const & msg) = 0;
32
33         /// This function is called when some inset dialogs needs to be shown.
34         /** \param name == "bibtex", "citation" etc; an identifier used to
35             launch a particular dialog.
36             \param data is a string representation of the Inset contents.
37             It is often little more than the output from Inset::write.
38             It is passed to, and parsed by, the frontend dialog.
39             Several of these dialogs do not need any data.
40             \param inset ownership is _not_ passed to the frontend dialog.
41             It is stored internally and used by the kernel to ascertain
42             what to do with the FuncRequest dispatched from the frontend
43             dialog on 'Apply'; should it be used to create a new inset at
44             the current cursor position or modify an existing, 'open' inset?
45         */
46         virtual void showDialog(std::string const & name,
47                 std::string const & data, Inset * inset = 0) = 0;
48
49         /// This function is called when some dialogs needs to be reset.
50         /** \param name == "citation", "bibtex" etc; an identifier used
51             to reset the contents of a particular dialog with \param data.
52             See the comments to 'show', above.
53         */
54         virtual void updateDialog(std::string const & name,
55                 std::string const & data) = 0;
56 };
57
58
59 class GuiBufferDelegate
60 {
61 public:
62         virtual ~GuiBufferDelegate() {}
63         /// This function is called when the buffer structure is changed.
64         virtual void structureChanged() = 0;
65         /// This function is called when the buffer structure has been updated.
66         virtual void updateTocItem(std::string const &, DocIterator const &) = 0;
67         /// This function is called when some parsing error shows up.
68         virtual void errors(std::string const &, bool from_master = false) = 0;
69         /// This function is called when some message shows up.
70         virtual void message(docstring const &) = 0;
71         /// This function is called when the buffer busy status change.
72         virtual void setBusy(bool) = 0;
73         /// Reset autosave timers for all users.
74         virtual void resetAutosaveTimers() = 0;
75 };
76
77 } // namespace frontend
78 } // namespace lyx
79
80 #endif