]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlPreamble.C
Add a buffer_path arg to InsetGraphicsMailer's params2string, string2params.
[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
14 #include "ControlPreamble.h"
15
16 #include "ViewBase.h"
17
18 #include "buffer.h"
19 #include "gettext.h"
20
21 #include "frontends/LyXView.h"
22
23
24 ControlPreamble::ControlPreamble(LyXView & lv, Dialogs & d)
25         : ControlDialogBD(lv, d)
26 {}
27
28
29 void ControlPreamble::apply()
30 {
31         if (!bufferIsAvailable())
32                 return;
33
34         view().apply();
35
36         buffer()->params.preamble = params();
37         buffer()->markDirty();
38         lv_.message(_("LaTeX preamble set"));
39 }
40
41
42 string const & ControlPreamble::params() const
43 {
44         return params_;
45 }
46
47
48 void ControlPreamble::params(string const & newparams)
49 {
50         params_ = newparams;
51 }
52
53
54 void ControlPreamble::setParams()
55 {
56         params_ = buffer()->params.preamble;
57 }
58
59
60 void ControlPreamble::clearParams()
61 {
62         params_.erase();
63 }