]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ViewBase.h
Add a buffer_path arg to InsetGraphicsMailer's params2string, string2params.
[lyx.git] / src / frontends / controllers / ViewBase.h
1 // -*- C++ -*-
2 /**
3  * \file ViewBase.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Angus Leeming
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #ifndef VIEWBASE_H
13 #define VIEWBASE_H
14
15 class ControlButtons;
16 class ButtonController;
17
18 #include "LString.h"
19
20 #include <boost/utility.hpp>
21
22 class ViewBase : boost::noncopyable {
23 public:
24         ///
25         ViewBase(string const &);
26         ///
27         virtual ~ViewBase() {}
28
29         /// Apply changes to LyX data from dialog.
30         virtual void apply() = 0;
31         /// build the dialog
32         virtual void build() = 0;
33         /// Hide the dialog.
34         virtual void hide() = 0;
35         /// Redraw the dialog (e.g. if the colors have been remapped).
36         virtual void redraw() {}
37         /// Create the dialog if necessary, update it and display it.
38         virtual void show() = 0;
39         /// Update dialog before/whilst showing it.
40         virtual void update() = 0;
41         ///
42         virtual bool isVisible() const = 0;
43
44         /** Defaults to nothing. Can be used by the controller, however, to
45          *  indicate to the view that something has changed and that the
46          *  dialog therefore needs updating.
47          */
48         virtual void partialUpdate(int) {}
49
50         /** This should be set by the GUI class that owns both the controller
51          *  and the view
52          */
53         void setController(ControlButtons &);
54
55         ///
56         ControlButtons & getController();
57         ///
58         ControlButtons const & getController() const;
59         ///
60         ButtonController & bc();
61         /// sets the title of the dialog (window caption)
62         void setTitle(string const &);
63         /// gets the title of the dialog
64         string const & getTitle() const;
65
66 protected:
67         /// We don't own this.
68         ControlButtons * controller_ptr_;
69
70 private:
71         string title_;
72
73 };
74
75 #endif // VIEWBASE_H