]> git.lyx.org Git - lyx.git/blob - src/insets/insetoptarg.C
update no.po
[lyx.git] / src / insets / insetoptarg.C
1 /**
2  * \file insetoptarg.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Martin Vermeer
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 "debug.h"
18
19 #include "insetoptarg.h"
20 #include "support/LOstream.h"
21 #include "frontends/Alert.h"
22 #include "support/lstrings.h" // frontStrip, strip
23 #include "lyxtext.h"
24 #include "buffer.h"
25 #include "gettext.h"
26 #include "BufferView.h"
27 #include "support/lstrings.h"
28
29 using std::ostream;
30 using std::vector;
31 using std::pair;
32
33 InsetOptArg::InsetOptArg(BufferParams const & ins)
34         : InsetCollapsable(ins, true)
35 {
36         LyXFont font(LyXFont::ALL_SANE);
37         font.setColor(LColor::collapsable);
38         setLabelFont(font);
39         setLabel(_("opt"));
40 }
41
42
43 InsetOptArg::InsetOptArg(InsetOptArg const & in, bool same_id)
44         : InsetCollapsable(in, same_id)
45 {
46         LyXFont font(LyXFont::ALL_SANE);
47         font.setColor(LColor::collapsable);
48         setLabelFont(font);
49         setLabel(_("opt"));
50 }
51
52
53 Inset * InsetOptArg::clone(Buffer const &, bool same_id) const
54 {
55         return new InsetOptArg(*this, same_id);
56 }
57
58
59 string const InsetOptArg::editMessage() const
60 {
61         return _("Opened Optional Argument Inset");
62 }
63
64
65 void InsetOptArg::write(Buffer const * buf, ostream & os) const
66 {
67         os << "OptArg" << "\n";
68         InsetCollapsable::write(buf, os);
69 }
70
71
72 int InsetOptArg::latex(Buffer const *, ostream &, bool, bool) const
73 {
74         return 0;
75 }
76
77
78 int InsetOptArg::latexOptional(Buffer const * buf, ostream & os,
79                                 bool, bool fp) const
80 {
81         os << '[';
82         int const i = inset.latex(buf, os, false, fp);
83         os << ']';
84         return i + 2;
85 }