]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlPreamble.C
Convert the preamble dialog to the Dialog-based scheme.
[lyx.git] / src / frontends / controllers / ControlPreamble.C
1 /**
2  * \file ControlPreamble.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Edwin Leuven
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "ControlPreamble.h"
14
15 #include "buffer.h"
16 #include "bufferparams.h"
17
18 using std::string;
19
20
21 ControlPreamble::ControlPreamble(Dialog & parent)
22         : Dialog::Controller(parent)
23 {}
24
25
26 bool ControlPreamble::initialiseParams(std::string const &)
27 {
28         params_ = kernel().buffer().params().preamble;
29         return true;
30 }
31
32
33 void ControlPreamble::clearParams()
34 {
35         params_.erase();
36 }
37
38
39 void ControlPreamble::dispatchParams()
40 {
41         // This can stay because we're going to throw the class away
42         // as soon as xforms 1.1 is released.
43         // Ie, there's no need to define LFUN_BUFFERPREAMBLE_APPLY.
44         Buffer & buffer = kernel().buffer();
45         buffer.params().preamble = params();
46         buffer.markDirty();
47 }
48
49
50 string const & ControlPreamble::params() const
51 {
52         return params_;
53 }
54
55
56 void ControlPreamble::params(string const & newparams)
57 {
58         params_ = newparams;
59 }