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