]> git.lyx.org Git - lyx.git/blob - src/frontends/Delegates.h
1a41771e3dc7b9de264d3a84de4708376bd647ee
[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 Inset;
21
22 namespace frontend {
23
24 class GuiBufferViewDelegate 
25 {
26 public:
27         virtual ~GuiBufferViewDelegate() {}
28
29         /// This function is called when some message shows up.
30         virtual void message(docstring const & msg) = 0;
31
32         /// This function is called when some inset dialogs needs to be shown.
33         virtual void showDialog(std::string const & name,
34                 std::string const & data, Inset * inset = 0) = 0;
35
36         /// This function is called when some dialogs needs to be updated.
37         /** \param name == "citation", "bibtex" etc; an identifier used
38             to update the contents of a particular dialog with \param data.
39             See the comments to 'show', above.
40         */
41         virtual void updateDialog(std::string const & name,
42                 std::string const & data) = 0;
43 };
44
45
46 class GuiBufferDelegate
47 {
48 public:
49         virtual ~GuiBufferDelegate() {}
50         /// This function is called when the buffer structure is changed.
51         virtual void structureChanged() = 0;
52         /// This function is called when some parsing error shows up.
53         virtual void errors(std::string const &) = 0;
54         /// This function is called when some message shows up.
55         virtual void message(docstring const &) = 0;
56         /// This function is called when the buffer busy status change.
57         virtual void setBusy(bool) = 0;
58         /// Reset autosave timers for all users.
59         virtual void resetAutosaveTimers() = 0;
60 };
61
62 } // namespace frontend
63 } // namespace lyx
64
65 #endif