]> git.lyx.org Git - lyx.git/blob - src/insets/insetoptarg.C
Change _() to return a docstring. Fixup callers with the help of lyx::to_utf8.
[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 #include "insetoptarg.h"
14
15 #include "debug.h"
16 #include "gettext.h"
17 #include "LColor.h"
18 #include "paragraph.h"
19
20 #include <sstream>
21
22 using std::string;
23 using std::auto_ptr;
24 using std::ostream;
25 using std::ostringstream;
26
27
28 InsetOptArg::InsetOptArg(BufferParams const & ins)
29         : InsetCollapsable(ins)
30 {
31         LyXFont font(LyXFont::ALL_SANE);
32         font.setColor(LColor::collapsable);
33         setLabelFont(font);
34         // FIXME UNICODE
35         setLabel(lyx::to_utf8(_("opt")));
36 }
37
38
39 InsetOptArg::InsetOptArg(InsetOptArg const & in)
40         : InsetCollapsable(in)
41 {
42         LyXFont font(LyXFont::ALL_SANE);
43         font.setColor(LColor::collapsable);
44         setLabelFont(font);
45         // FIXME UNICODE
46         setLabel(lyx::to_utf8(_("opt")));
47 }
48
49
50 auto_ptr<InsetBase> InsetOptArg::doClone() const
51 {
52         return auto_ptr<InsetBase>(new InsetOptArg(*this));
53 }
54
55
56 string const InsetOptArg::editMessage() const
57 {
58         // FIXME UNICODE
59         return lyx::to_utf8(_("Opened Optional Argument Inset"));
60 }
61
62
63 void InsetOptArg::write(Buffer const & buf, ostream & os) const
64 {
65         os << "OptArg" << "\n";
66         InsetCollapsable::write(buf, os);
67 }
68
69
70 int InsetOptArg::latex(Buffer const &, ostream &,
71                        OutputParams const &) const
72 {
73         return 0;
74 }
75
76 int InsetOptArg::docbook(Buffer const &, ostream &,
77                        OutputParams const &) const
78 {
79         return 0;
80 }
81
82
83 int InsetOptArg::plaintext(Buffer const &, ostream &,
84                        OutputParams const &) const
85 {
86         return 0;
87 }
88
89
90 int InsetOptArg::latexOptional(Buffer const & buf, ostream & os,
91                                OutputParams const & runparams) const
92 {
93         ostringstream ss;
94         int ret = InsetText::latex(buf, ss, runparams);
95         string str = ss.str();
96         if (str.find(']') != string::npos)
97                 str = '{' + str + '}';
98         os << '[' << str << ']';
99         return ret;
100 }